commit f0b8df90b9d283bc35522baf9d20a169fe57f459 Author: Jacob Kiers Date: Fri Oct 4 20:27:23 2024 +0200 Initial commit This is definitely not functional yet. Signed-off-by: Jacob Kiers diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0120d95 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/target/ +**/target/ +**/*.rs.bk +.env diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..e1b3f7a --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1652 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" + +[[package]] +name = "async-trait" +version = "0.1.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets", +] + +[[package]] +name = "bank2ff" +version = "0.1.0" +dependencies = [ + "dotenv", + "firefly-iii-api", + "gocardless-bankaccount-data-api", + "serde", + "tokio", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytes" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" + +[[package]] +name = "cc" +version = "1.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "serde", + "windows-targets", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "fastrand" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" + +[[package]] +name = "firefly-iii-api" +version = "2.1.0" +dependencies = [ + "reqwest", + "serde", + "serde_json", + "serde_repr", + "serde_with", + "url", + "uuid", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" + +[[package]] +name = "gocardless-bankaccount-data-api" +version = "2.0.0" +dependencies = [ + "reqwest", + "reqwest-middleware", + "serde", + "serde_json", + "serde_repr", + "serde_with", + "url", + "uuid", +] + +[[package]] +name = "h2" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap 2.5.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" + +[[package]] +name = "hyper" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +dependencies = [ + "equivalent", + "hashbrown 0.14.5", + "serde", +] + +[[package]] +name = "ipnet" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "js-sys" +version = "0.3.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.159" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi", + "libc", + "wasi", + "windows-sys 0.52.0", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.36.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "openssl" +version = "0.10.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" +dependencies = [ + "bitflags", +] + +[[package]] +name = "reqwest" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "mime_guess", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-registry", +] + +[[package]] +name = "reqwest-middleware" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562ceb5a604d3f7c885a792d42c199fd8af239d0a51b2fa6a78aafa092452b04" +dependencies = [ + "anyhow", + "async-trait", + "http", + "reqwest", + "serde", + "thiserror", + "tower-service", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustix" +version = "0.38.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.23.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +dependencies = [ + "base64", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schannel" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +dependencies = [ + "base64", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.5.0", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +dependencies = [ + "cfg-if", + "fastrand", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "thiserror" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls", + "rustls-pki-types", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unicode-normalization" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +dependencies = [ + "getrandom", + "serde", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" + +[[package]] +name = "web-sys" +version = "0.3.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..5ce27db --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,11 @@ +[workspace] +members = [ + 'bank2ff', + 'firefly-iii-api', + 'gocardless-bankaccount-data-api', +] +resolver = "2" + +[workspace.dependencies] +tokio = { version = "1", features = ['full'] } +tokio-macros = "2.4.0" \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..63e7af4 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# Bank2FF + +Bank2FF is a tool that can retrieve bank transactions from Gocardless and +add them to Firefly III. + +It contains autogenerated APIs for both Firefly III and for the +Gocardless Bank Account Data API. + +## Usage + +TBD + + +## Generating the API clients + +These API clients are generated with the OpenAPI Generators for Rust. + +These need Podman installed, and assume this command is run from the same +directory where this README.md file is located. + +For Gocardless: + +`podman run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -g rust -o /local/gocardless-bankaccount-data-api -i 'https://bankaccountdata.gocardless.com/api/v2/swagger.json' --additional-properties=library=reqwest,packageName=gocardless-bankaccount-data-api,packageVersion=2.0.0,supportMiddleware=true,avoidBoxedModels=true` + + +For Firefly III: + +If necessary, change the URL to the definition. If that is a new version, then also change the `packageVersion` parameter. + +`podman run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -g rust -o /local/firefly-iii-api -i 'https://api-docs.firefly-iii.org/firefly-iii-2.1.0-v1.yaml' --additional-properties=library=reqwest,packageName=firefly-iii-api,packageVersion=2.1.0,supportMiddleware=true,avoidBoxedModels=true` \ No newline at end of file diff --git a/bank2ff/.env.example b/bank2ff/.env.example new file mode 100644 index 0000000..3f770c7 --- /dev/null +++ b/bank2ff/.env.example @@ -0,0 +1,6 @@ +FIREFLY_III_URL= +FIREFLY_III_API_KEY= +FIREFLY_III_CLIENT_ID= + +GOCARDLESS_KEY= +GOCARDLESS_ID= diff --git a/bank2ff/.gitignore b/bank2ff/.gitignore new file mode 100644 index 0000000..fbfe76b --- /dev/null +++ b/bank2ff/.gitignore @@ -0,0 +1,2 @@ +/target +../.env \ No newline at end of file diff --git a/bank2ff/Cargo.toml b/bank2ff/Cargo.toml new file mode 100644 index 0000000..e2a54db --- /dev/null +++ b/bank2ff/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "bank2ff" +version = "0.1.0" +edition = "2021" + +[dependencies] +firefly-iii-api = { path = "../firefly-iii-api", version = "2.1.0" } +gocardless-bankaccount-data-api = { path = '../gocardless-bankaccount-data-api', version = "2.0.0" } +dotenv = "0.15.0" +serde = { version = "1.0.210", features = ["derive"] } +tokio = { workspace = true, features = ["rt", "rt-multi-thread", "macros"] } diff --git a/bank2ff/__asn_nordigen_import_config.json b/bank2ff/__asn_nordigen_import_config.json new file mode 100644 index 0000000..f058972 --- /dev/null +++ b/bank2ff/__asn_nordigen_import_config.json @@ -0,0 +1,44 @@ +{ + "version": 3, + "source": "ff3-importer-1.5.2", + "created_at": "2024-09-07T10:07:05+02:00", + "date": "", + "default_account": 1142, + "delimiter": "comma", + "headers": false, + "rules": true, + "skip_form": false, + "add_import_tag": true, + "roles": [], + "do_mapping": [], + "mapping": [], + "duplicate_detection_method": "classic", + "ignore_duplicate_lines": false, + "unique_column_index": 0, + "unique_column_type": "external-id", + "flow": "nordigen", + "content_type": "unknown", + "custom_tag": "", + "identifier": "0", + "connection": "0", + "ignore_spectre_categories": false, + "grouped_transaction_handling": "", + "use_entire_opposing_address": false, + "map_all_data": false, + "accounts": { + "4cda1369-178c-485b-b3d8-1892afdbfb6c": 1142 + }, + "date_range": "range", + "date_range_number": 30, + "date_range_unit": "d", + "date_not_before": "2024-06-29", + "date_not_after": "2024-09-06", + "nordigen_country": "NL", + "nordigen_bank": "ASN_BANK_ASNBNL21", + "nordigen_requisitions": { + "b2e6fd94-fc45-484c-abc1-5f410a58a220": "c5006758-135b-4770-8715-2a047a426973" + }, + "nordigen_max_days": "90", + "conversion": false, + "ignore_duplicate_transactions": true +} \ No newline at end of file diff --git a/bank2ff/src/config.rs b/bank2ff/src/config.rs new file mode 100644 index 0000000..739622d --- /dev/null +++ b/bank2ff/src/config.rs @@ -0,0 +1,29 @@ +use serde::Deserialize; + +#[derive(Deserialize, Debug)] +pub(super) struct AppConfiguration { + pub(crate) firefly_iii_url: String, + pub(crate) firefly_iii_api_key: String, + + pub(crate) go_cardless_key: String, + pub(crate) go_cardless_id: String, +} + +impl AppConfiguration { + pub(super) fn from_env() -> Result { + use dotenv::var; + + let firefly_iii_url = var("FIREFLY_III_URL")?; + let firefly_iii_api_key = var("FIREFLY_III_API_KEY")?; + + let go_cardless_key = var("GOCARDLESS_KEY")?; + let go_cardless_id = var("GOCARDLESS_ID")?; + + Ok(Self { + firefly_iii_url, + firefly_iii_api_key, + go_cardless_key, + go_cardless_id, + }) + } +} diff --git a/bank2ff/src/firefly.rs b/bank2ff/src/firefly.rs new file mode 100644 index 0000000..f8f8961 --- /dev/null +++ b/bank2ff/src/firefly.rs @@ -0,0 +1,108 @@ +use firefly_iii_api::apis::configuration::Configuration; +use firefly_iii_api::apis::{accounts_api, transactions_api}; +use firefly_iii_api::models::{AccountRead, TransactionRead}; + +pub(super) async fn load_all_transactions(ff: &mut FFTransactions) -> Result<(), ()> { + let mut has_more = true; + let mut page = None; + while has_more { + match transactions_api::list_transaction( + &ff.config, + None, + Some(500), + page, + None, + None, + None, + ) + .await + { + Ok(transactions) => { + has_more = transactions.links.next.is_some(); + let pagination = transactions.meta.pagination.clone().unwrap(); + let next = pagination.current_page.unwrap() + 1; + page = Some(next); + + println!( + "Page {} of {}", + pagination.current_page.unwrap(), + pagination.total_pages.unwrap() + ); + transactions + } + Err(e) => { + dbg!(e); + return Ok(()); + } + } + .data + .iter() + .for_each(|tx| { + ff.transactions.push(tx.to_owned()); + }); + } + + Ok(()) +} + +pub(super) async fn load_all_accounts(ff: &mut FFTransactions) -> Result<(), ()> { + let mut has_more = true; + let mut page = None; + while has_more { + match accounts_api::list_account(&ff.config, None, Some(500), page, None, None).await { + Ok(accounts) => { + let pagination = accounts.meta.pagination.clone().unwrap(); + has_more = pagination.current_page < pagination.total_pages; + + let next = pagination.current_page.unwrap() + 1; + page = Some(next); + + println!( + "Page {} of {}", + pagination.current_page.unwrap(), + pagination.total_pages.unwrap() + ); + + accounts.data + } + Err(e) => { + dbg!(e); + return Ok(()); + } + } + .iter() + .for_each(|a| ff.accounts.push(a.to_owned())); + } + + Ok(()) +} + +pub(super) struct FFTransactions { + accounts: Vec, + transactions: Vec, + config: Configuration, +} + +impl FFTransactions { + pub(super) fn new(config: Configuration) -> Self { + Self { + accounts: Vec::with_capacity(1000), + transactions: Vec::with_capacity(10000), + config, + } + } + + pub(super) fn accounts(&self) -> &Vec { + &self.accounts + } + + pub(super) fn transactions(&self) -> &Vec { + &self.transactions + } + + pub fn find_account_by_iban(&self, iban: &str) -> Option<&AccountRead> { + let to_check = Some(Some(iban.to_owned())); + + self.accounts.iter().find(|a| a.attributes.iban == to_check) + } +} diff --git a/bank2ff/src/main.rs b/bank2ff/src/main.rs new file mode 100644 index 0000000..cb02260 --- /dev/null +++ b/bank2ff/src/main.rs @@ -0,0 +1,98 @@ +mod config; +mod firefly; + +use crate::config::AppConfiguration; +use crate::firefly::{load_all_accounts, load_all_transactions, FFTransactions}; +use firefly_iii_api::apis::configuration; +use tokio::io::AsyncReadExt; +use gocardless_bankaccount_data_api::models::{JwtObtainPairRequest, StatusEnum}; + +#[tokio::main] +async fn main() -> Result<(), dotenv::Error> { + dotenv::dotenv().ok(); + let config = AppConfiguration::from_env()?; + + // let mut ff = FFTransactions::new(configuration::Configuration { + // base_path: config.firefly_iii_url, + // user_agent: None, + // client: Default::default(), + // basic_auth: None, + // oauth_access_token: None, + // bearer_access_token: Some(config.firefly_iii_api_key), + // api_key: None, + // }); + // + // let _ = load_all_accounts(&mut ff).await; + // println!("#Accounts:\t{}", ff.accounts().len()); + + // let _ = load_all_transactions(&mut ff).await; + // println!("#Transactions:\t{}", ff.transactions().len()); + + let mut gocardless_config = gocardless_bankaccount_data_api::apis::configuration::Configuration::new(); + let gc_token_pair = gocardless_bankaccount_data_api::apis::token_api::obtain_new_access_slash_refresh_token_pair( + &gocardless_config,JwtObtainPairRequest::new(config.go_cardless_id, config.go_cardless_key)).await.unwrap(); + + gocardless_config.bearer_access_token = gc_token_pair.access; + + + // let institutions = gocardless_bankaccount_data_api::apis::institutions_api::retrieve_all_supported_institutions_in_a_given_country( + // &gocardless_config, + // None, + // None, + // None, + // None, + // None, + // Some("NL"), + // None, + // None, + // None, + // None, + // None, + // None, + // None + // ).await.unwrap(); + + let gc_reqs = gocardless_bankaccount_data_api::apis::requisitions_api::retrieve_all_requisitions(&gocardless_config, None, None) + .await + .unwrap(); + + dbg!("# of requisitions:{} ", &gc_reqs.results.len()); + + + let active_reqs = gc_reqs + .results.iter() + .filter(|req| req.status == Some(StatusEnum::Ln) && req.institution_id != "BUNQ_BUNQNL2A").collect::>(); + + + dbg!("# of active requisitions:{} ", &active_reqs.len()); + + for req in active_reqs { + if req.accounts.is_none() { + dbg!("No active accounts for requisition {}", req.id); + continue; + } + + let accounts = req.accounts.as_ref().unwrap(); + + for account in accounts { + let transactions_resp = gocardless_bankaccount_data_api::apis::accounts_api::retrieve_account_transactions( + &gocardless_config, + &account.to_string(), + Some("2024-09-01".to_string()), + Some("2024-09-30".to_string()) + ).await; + + if transactions_resp.is_err() { + dbg!("{:?}", transactions_resp.unwrap_err()); + // TODO: Do something smarter here, if possible + continue; + } + + let transactions = transactions_resp.unwrap(); + dbg!(&transactions); + } + } + + let _ = tokio::io::stdin().read_u8().await; + Ok(()) +} diff --git a/env.example b/env.example new file mode 100644 index 0000000..bf6bbb1 --- /dev/null +++ b/env.example @@ -0,0 +1,6 @@ +FIREFLY_III_URL= +FIREFLY_III_API_KEY= +FIREFLY_III_CLIENT_ID= + +GOCARDLESS_KEY= +GOCARDLESS_ID= \ No newline at end of file diff --git a/firefly-iii-api/.gitignore b/firefly-iii-api/.gitignore new file mode 100644 index 0000000..6aa1064 --- /dev/null +++ b/firefly-iii-api/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/firefly-iii-api/.idea/.gitignore b/firefly-iii-api/.idea/.gitignore new file mode 100644 index 0000000..1c2fda5 --- /dev/null +++ b/firefly-iii-api/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/firefly-iii-api/.idea/inspectionProfiles/Project_Default.xml b/firefly-iii-api/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..8d66637 --- /dev/null +++ b/firefly-iii-api/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/firefly-iii-api/.idea/misc.xml b/firefly-iii-api/.idea/misc.xml new file mode 100644 index 0000000..5c844e9 --- /dev/null +++ b/firefly-iii-api/.idea/misc.xml @@ -0,0 +1,20 @@ + + + + + + + + + SQL + + + + + CSS + + + + + + \ No newline at end of file diff --git a/firefly-iii-api/.idea/modules.xml b/firefly-iii-api/.idea/modules.xml new file mode 100644 index 0000000..0a91e07 --- /dev/null +++ b/firefly-iii-api/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/firefly-iii-api/.idea/rust.iml b/firefly-iii-api/.idea/rust.iml new file mode 100644 index 0000000..bf4ce7b --- /dev/null +++ b/firefly-iii-api/.idea/rust.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/firefly-iii-api/.openapi-generator-ignore b/firefly-iii-api/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/firefly-iii-api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/firefly-iii-api/.openapi-generator/FILES b/firefly-iii-api/.openapi-generator/FILES new file mode 100644 index 0000000..cf0d43c --- /dev/null +++ b/firefly-iii-api/.openapi-generator/FILES @@ -0,0 +1,484 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/AboutApi.md +docs/Account.md +docs/AccountArray.md +docs/AccountRead.md +docs/AccountRoleProperty.md +docs/AccountSearchFieldFilter.md +docs/AccountSingle.md +docs/AccountStore.md +docs/AccountTypeFilter.md +docs/AccountTypeProperty.md +docs/AccountUpdate.md +docs/AccountsApi.md +docs/AttachableType.md +docs/Attachment.md +docs/AttachmentArray.md +docs/AttachmentRead.md +docs/AttachmentSingle.md +docs/AttachmentStore.md +docs/AttachmentUpdate.md +docs/AttachmentsApi.md +docs/AutoBudgetPeriod.md +docs/AutoBudgetType.md +docs/AutocompleteAccount.md +docs/AutocompleteApi.md +docs/AutocompleteBill.md +docs/AutocompleteBudget.md +docs/AutocompleteCategory.md +docs/AutocompleteCurrency.md +docs/AutocompleteCurrencyCode.md +docs/AutocompleteObjectGroup.md +docs/AutocompletePiggy.md +docs/AutocompletePiggyBalance.md +docs/AutocompleteRecurrence.md +docs/AutocompleteRule.md +docs/AutocompleteRuleGroup.md +docs/AutocompleteTag.md +docs/AutocompleteTransaction.md +docs/AutocompleteTransactionId.md +docs/AutocompleteTransactionType.md +docs/AvailableBudget.md +docs/AvailableBudgetArray.md +docs/AvailableBudgetRead.md +docs/AvailableBudgetSingle.md +docs/AvailableBudgetsApi.md +docs/BadRequestResponse.md +docs/BasicSummaryEntry.md +docs/Bill.md +docs/BillArray.md +docs/BillPaidDatesInner.md +docs/BillRead.md +docs/BillRepeatFrequency.md +docs/BillSingle.md +docs/BillStore.md +docs/BillUpdate.md +docs/BillsApi.md +docs/Budget.md +docs/BudgetArray.md +docs/BudgetLimit.md +docs/BudgetLimitArray.md +docs/BudgetLimitRead.md +docs/BudgetLimitSingle.md +docs/BudgetLimitStore.md +docs/BudgetRead.md +docs/BudgetSingle.md +docs/BudgetSpent.md +docs/BudgetStore.md +docs/BudgetUpdate.md +docs/BudgetsApi.md +docs/CategoriesApi.md +docs/Category.md +docs/CategoryArray.md +docs/CategoryEarned.md +docs/CategoryRead.md +docs/CategorySingle.md +docs/CategorySpent.md +docs/CategoryUpdate.md +docs/ChartDataPoint.md +docs/ChartDataSet.md +docs/ChartsApi.md +docs/ConfigValueFilter.md +docs/ConfigValueUpdateFilter.md +docs/Configuration.md +docs/ConfigurationApi.md +docs/ConfigurationSingle.md +docs/ConfigurationUpdate.md +docs/CreditCardTypeProperty.md +docs/CronResult.md +docs/CronResultRow.md +docs/CurrenciesApi.md +docs/Currency.md +docs/CurrencyArray.md +docs/CurrencyRead.md +docs/CurrencySingle.md +docs/CurrencyStore.md +docs/CurrencyUpdate.md +docs/DataApi.md +docs/DataDestroyObject.md +docs/ExportFileFilter.md +docs/InsightApi.md +docs/InsightGroupEntry.md +docs/InsightTotalEntry.md +docs/InsightTransferEntry.md +docs/InterestPeriodProperty.md +docs/InternalExceptionResponse.md +docs/LiabilityDirectionProperty.md +docs/LiabilityTypeProperty.md +docs/LinkType.md +docs/LinkTypeArray.md +docs/LinkTypeRead.md +docs/LinkTypeSingle.md +docs/LinkTypeUpdate.md +docs/LinksApi.md +docs/Meta.md +docs/MetaPagination.md +docs/NotFoundResponse.md +docs/ObjectGroup.md +docs/ObjectGroupArray.md +docs/ObjectGroupRead.md +docs/ObjectGroupSingle.md +docs/ObjectGroupUpdate.md +docs/ObjectGroupsApi.md +docs/ObjectLink.md +docs/ObjectLink0.md +docs/PageLink.md +docs/PiggyBank.md +docs/PiggyBankArray.md +docs/PiggyBankEvent.md +docs/PiggyBankEventArray.md +docs/PiggyBankEventRead.md +docs/PiggyBankRead.md +docs/PiggyBankSingle.md +docs/PiggyBankStore.md +docs/PiggyBankUpdate.md +docs/PiggyBanksApi.md +docs/PolymorphicProperty.md +docs/Preference.md +docs/PreferenceArray.md +docs/PreferenceRead.md +docs/PreferenceSingle.md +docs/PreferenceUpdate.md +docs/PreferencesApi.md +docs/Recurrence.md +docs/RecurrenceArray.md +docs/RecurrenceRead.md +docs/RecurrenceRepetition.md +docs/RecurrenceRepetitionStore.md +docs/RecurrenceRepetitionType.md +docs/RecurrenceRepetitionUpdate.md +docs/RecurrenceSingle.md +docs/RecurrenceStore.md +docs/RecurrenceTransaction.md +docs/RecurrenceTransactionStore.md +docs/RecurrenceTransactionType.md +docs/RecurrenceTransactionUpdate.md +docs/RecurrenceUpdate.md +docs/RecurrencesApi.md +docs/Rule.md +docs/RuleAction.md +docs/RuleActionKeyword.md +docs/RuleActionStore.md +docs/RuleActionUpdate.md +docs/RuleArray.md +docs/RuleGroup.md +docs/RuleGroupArray.md +docs/RuleGroupRead.md +docs/RuleGroupSingle.md +docs/RuleGroupStore.md +docs/RuleGroupUpdate.md +docs/RuleGroupsApi.md +docs/RuleRead.md +docs/RuleSingle.md +docs/RuleStore.md +docs/RuleTrigger.md +docs/RuleTriggerKeyword.md +docs/RuleTriggerStore.md +docs/RuleTriggerType.md +docs/RuleTriggerUpdate.md +docs/RuleUpdate.md +docs/RulesApi.md +docs/SearchApi.md +docs/ShortAccountTypeProperty.md +docs/SummaryApi.md +docs/SystemInfo.md +docs/SystemInfoData.md +docs/TagArray.md +docs/TagModel.md +docs/TagModelStore.md +docs/TagModelUpdate.md +docs/TagRead.md +docs/TagSingle.md +docs/TagsApi.md +docs/Transaction.md +docs/TransactionArray.md +docs/TransactionLink.md +docs/TransactionLinkArray.md +docs/TransactionLinkRead.md +docs/TransactionLinkSingle.md +docs/TransactionLinkStore.md +docs/TransactionLinkUpdate.md +docs/TransactionRead.md +docs/TransactionSingle.md +docs/TransactionSplit.md +docs/TransactionSplitStore.md +docs/TransactionSplitUpdate.md +docs/TransactionStore.md +docs/TransactionTypeFilter.md +docs/TransactionTypeProperty.md +docs/TransactionUpdate.md +docs/TransactionsApi.md +docs/UnauthenticatedResponse.md +docs/User.md +docs/UserArray.md +docs/UserBlockedCodeProperty.md +docs/UserRead.md +docs/UserRoleProperty.md +docs/UserSingle.md +docs/UsersApi.md +docs/ValidationErrorResponse.md +docs/ValidationErrorResponseErrors.md +docs/Webhook.md +docs/WebhookArray.md +docs/WebhookAttempt.md +docs/WebhookAttemptArray.md +docs/WebhookAttemptRead.md +docs/WebhookAttemptSingle.md +docs/WebhookDelivery.md +docs/WebhookMessage.md +docs/WebhookMessageArray.md +docs/WebhookMessageRead.md +docs/WebhookMessageSingle.md +docs/WebhookRead.md +docs/WebhookResponse.md +docs/WebhookSingle.md +docs/WebhookStore.md +docs/WebhookTrigger.md +docs/WebhookUpdate.md +docs/WebhooksApi.md +git_push.sh +src/apis/about_api.rs +src/apis/accounts_api.rs +src/apis/attachments_api.rs +src/apis/autocomplete_api.rs +src/apis/available_budgets_api.rs +src/apis/bills_api.rs +src/apis/budgets_api.rs +src/apis/categories_api.rs +src/apis/charts_api.rs +src/apis/configuration.rs +src/apis/configuration_api.rs +src/apis/currencies_api.rs +src/apis/data_api.rs +src/apis/insight_api.rs +src/apis/links_api.rs +src/apis/mod.rs +src/apis/object_groups_api.rs +src/apis/piggy_banks_api.rs +src/apis/preferences_api.rs +src/apis/recurrences_api.rs +src/apis/rule_groups_api.rs +src/apis/rules_api.rs +src/apis/search_api.rs +src/apis/summary_api.rs +src/apis/tags_api.rs +src/apis/transactions_api.rs +src/apis/users_api.rs +src/apis/webhooks_api.rs +src/lib.rs +src/models/account.rs +src/models/account_array.rs +src/models/account_read.rs +src/models/account_role_property.rs +src/models/account_search_field_filter.rs +src/models/account_single.rs +src/models/account_store.rs +src/models/account_type_filter.rs +src/models/account_type_property.rs +src/models/account_update.rs +src/models/attachable_type.rs +src/models/attachment.rs +src/models/attachment_array.rs +src/models/attachment_read.rs +src/models/attachment_single.rs +src/models/attachment_store.rs +src/models/attachment_update.rs +src/models/auto_budget_period.rs +src/models/auto_budget_type.rs +src/models/autocomplete_account.rs +src/models/autocomplete_bill.rs +src/models/autocomplete_budget.rs +src/models/autocomplete_category.rs +src/models/autocomplete_currency.rs +src/models/autocomplete_currency_code.rs +src/models/autocomplete_object_group.rs +src/models/autocomplete_piggy.rs +src/models/autocomplete_piggy_balance.rs +src/models/autocomplete_recurrence.rs +src/models/autocomplete_rule.rs +src/models/autocomplete_rule_group.rs +src/models/autocomplete_tag.rs +src/models/autocomplete_transaction.rs +src/models/autocomplete_transaction_id.rs +src/models/autocomplete_transaction_type.rs +src/models/available_budget.rs +src/models/available_budget_array.rs +src/models/available_budget_read.rs +src/models/available_budget_single.rs +src/models/bad_request_response.rs +src/models/basic_summary_entry.rs +src/models/bill.rs +src/models/bill_array.rs +src/models/bill_paid_dates_inner.rs +src/models/bill_read.rs +src/models/bill_repeat_frequency.rs +src/models/bill_single.rs +src/models/bill_store.rs +src/models/bill_update.rs +src/models/budget.rs +src/models/budget_array.rs +src/models/budget_limit.rs +src/models/budget_limit_array.rs +src/models/budget_limit_read.rs +src/models/budget_limit_single.rs +src/models/budget_limit_store.rs +src/models/budget_read.rs +src/models/budget_single.rs +src/models/budget_spent.rs +src/models/budget_store.rs +src/models/budget_update.rs +src/models/category.rs +src/models/category_array.rs +src/models/category_earned.rs +src/models/category_read.rs +src/models/category_single.rs +src/models/category_spent.rs +src/models/category_update.rs +src/models/chart_data_point.rs +src/models/chart_data_set.rs +src/models/config_value_filter.rs +src/models/config_value_update_filter.rs +src/models/configuration.rs +src/models/configuration_single.rs +src/models/configuration_update.rs +src/models/credit_card_type_property.rs +src/models/cron_result.rs +src/models/cron_result_row.rs +src/models/currency.rs +src/models/currency_array.rs +src/models/currency_read.rs +src/models/currency_single.rs +src/models/currency_store.rs +src/models/currency_update.rs +src/models/data_destroy_object.rs +src/models/export_file_filter.rs +src/models/insight_group_entry.rs +src/models/insight_total_entry.rs +src/models/insight_transfer_entry.rs +src/models/interest_period_property.rs +src/models/internal_exception_response.rs +src/models/liability_direction_property.rs +src/models/liability_type_property.rs +src/models/link_type.rs +src/models/link_type_array.rs +src/models/link_type_read.rs +src/models/link_type_single.rs +src/models/link_type_update.rs +src/models/meta.rs +src/models/meta_pagination.rs +src/models/mod.rs +src/models/not_found_response.rs +src/models/object_group.rs +src/models/object_group_array.rs +src/models/object_group_read.rs +src/models/object_group_single.rs +src/models/object_group_update.rs +src/models/object_link.rs +src/models/object_link_0.rs +src/models/page_link.rs +src/models/piggy_bank.rs +src/models/piggy_bank_array.rs +src/models/piggy_bank_event.rs +src/models/piggy_bank_event_array.rs +src/models/piggy_bank_event_read.rs +src/models/piggy_bank_read.rs +src/models/piggy_bank_single.rs +src/models/piggy_bank_store.rs +src/models/piggy_bank_update.rs +src/models/polymorphic_property.rs +src/models/preference.rs +src/models/preference_array.rs +src/models/preference_read.rs +src/models/preference_single.rs +src/models/preference_update.rs +src/models/recurrence.rs +src/models/recurrence_array.rs +src/models/recurrence_read.rs +src/models/recurrence_repetition.rs +src/models/recurrence_repetition_store.rs +src/models/recurrence_repetition_type.rs +src/models/recurrence_repetition_update.rs +src/models/recurrence_single.rs +src/models/recurrence_store.rs +src/models/recurrence_transaction.rs +src/models/recurrence_transaction_store.rs +src/models/recurrence_transaction_type.rs +src/models/recurrence_transaction_update.rs +src/models/recurrence_update.rs +src/models/rule.rs +src/models/rule_action.rs +src/models/rule_action_keyword.rs +src/models/rule_action_store.rs +src/models/rule_action_update.rs +src/models/rule_array.rs +src/models/rule_group.rs +src/models/rule_group_array.rs +src/models/rule_group_read.rs +src/models/rule_group_single.rs +src/models/rule_group_store.rs +src/models/rule_group_update.rs +src/models/rule_read.rs +src/models/rule_single.rs +src/models/rule_store.rs +src/models/rule_trigger.rs +src/models/rule_trigger_keyword.rs +src/models/rule_trigger_store.rs +src/models/rule_trigger_type.rs +src/models/rule_trigger_update.rs +src/models/rule_update.rs +src/models/short_account_type_property.rs +src/models/system_info.rs +src/models/system_info_data.rs +src/models/tag_array.rs +src/models/tag_model.rs +src/models/tag_model_store.rs +src/models/tag_model_update.rs +src/models/tag_read.rs +src/models/tag_single.rs +src/models/transaction.rs +src/models/transaction_array.rs +src/models/transaction_link.rs +src/models/transaction_link_array.rs +src/models/transaction_link_read.rs +src/models/transaction_link_single.rs +src/models/transaction_link_store.rs +src/models/transaction_link_update.rs +src/models/transaction_read.rs +src/models/transaction_single.rs +src/models/transaction_split.rs +src/models/transaction_split_store.rs +src/models/transaction_split_update.rs +src/models/transaction_store.rs +src/models/transaction_type_filter.rs +src/models/transaction_type_property.rs +src/models/transaction_update.rs +src/models/unauthenticated_response.rs +src/models/user.rs +src/models/user_array.rs +src/models/user_blocked_code_property.rs +src/models/user_read.rs +src/models/user_role_property.rs +src/models/user_single.rs +src/models/validation_error_response.rs +src/models/validation_error_response_errors.rs +src/models/webhook.rs +src/models/webhook_array.rs +src/models/webhook_attempt.rs +src/models/webhook_attempt_array.rs +src/models/webhook_attempt_read.rs +src/models/webhook_attempt_single.rs +src/models/webhook_delivery.rs +src/models/webhook_message.rs +src/models/webhook_message_array.rs +src/models/webhook_message_read.rs +src/models/webhook_message_single.rs +src/models/webhook_read.rs +src/models/webhook_response.rs +src/models/webhook_single.rs +src/models/webhook_store.rs +src/models/webhook_trigger.rs +src/models/webhook_update.rs diff --git a/firefly-iii-api/.openapi-generator/VERSION b/firefly-iii-api/.openapi-generator/VERSION new file mode 100644 index 0000000..17f2442 --- /dev/null +++ b/firefly-iii-api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.9.0-SNAPSHOT diff --git a/firefly-iii-api/.travis.yml b/firefly-iii-api/.travis.yml new file mode 100644 index 0000000..22761ba --- /dev/null +++ b/firefly-iii-api/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/firefly-iii-api/Cargo.toml b/firefly-iii-api/Cargo.toml new file mode 100644 index 0000000..a2db45b --- /dev/null +++ b/firefly-iii-api/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "firefly-iii-api" +version = "2.1.0" +authors = ["james@firefly-iii.org"] +description = "This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. " +license = "AGPLv3" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } diff --git a/firefly-iii-api/README.md b/firefly-iii-api/README.md new file mode 100644 index 0000000..7dcf07f --- /dev/null +++ b/firefly-iii-api/README.md @@ -0,0 +1,467 @@ +# Rust API client for openapi + +This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 + +Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + + +For more information, please visit [https://firefly-iii.org](https://firefly-iii.org) + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 2.1.0 +- Package version: 2.1.0 +- Generator version: 7.9.0-SNAPSHOT +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +openapi = { path = "./openapi" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AboutApi* | [**get_about**](docs/AboutApi.md#get_about) | **GET** /v1/about | System information end point. +*AboutApi* | [**get_cron**](docs/AboutApi.md#get_cron) | **GET** /v1/cron/{cliToken} | Cron job endpoint +*AboutApi* | [**get_current_user**](docs/AboutApi.md#get_current_user) | **GET** /v1/about/user | Currently authenticated user endpoint. +*AccountsApi* | [**delete_account**](docs/AccountsApi.md#delete_account) | **DELETE** /v1/accounts/{id} | Permanently delete account. +*AccountsApi* | [**get_account**](docs/AccountsApi.md#get_account) | **GET** /v1/accounts/{id} | Get single account. +*AccountsApi* | [**list_account**](docs/AccountsApi.md#list_account) | **GET** /v1/accounts | List all accounts. +*AccountsApi* | [**list_attachment_by_account**](docs/AccountsApi.md#list_attachment_by_account) | **GET** /v1/accounts/{id}/attachments | Lists all attachments. +*AccountsApi* | [**list_piggy_bank_by_account**](docs/AccountsApi.md#list_piggy_bank_by_account) | **GET** /v1/accounts/{id}/piggy-banks | List all piggy banks related to the account. +*AccountsApi* | [**list_transaction_by_account**](docs/AccountsApi.md#list_transaction_by_account) | **GET** /v1/accounts/{id}/transactions | List all transactions related to the account. +*AccountsApi* | [**store_account**](docs/AccountsApi.md#store_account) | **POST** /v1/accounts | Create new account. +*AccountsApi* | [**update_account**](docs/AccountsApi.md#update_account) | **PUT** /v1/accounts/{id} | Update existing account. +*AttachmentsApi* | [**delete_attachment**](docs/AttachmentsApi.md#delete_attachment) | **DELETE** /v1/attachments/{id} | Delete an attachment. +*AttachmentsApi* | [**download_attachment**](docs/AttachmentsApi.md#download_attachment) | **GET** /v1/attachments/{id}/download | Download a single attachment. +*AttachmentsApi* | [**get_attachment**](docs/AttachmentsApi.md#get_attachment) | **GET** /v1/attachments/{id} | Get a single attachment. +*AttachmentsApi* | [**list_attachment**](docs/AttachmentsApi.md#list_attachment) | **GET** /v1/attachments | List all attachments. +*AttachmentsApi* | [**store_attachment**](docs/AttachmentsApi.md#store_attachment) | **POST** /v1/attachments | Store a new attachment. +*AttachmentsApi* | [**update_attachment**](docs/AttachmentsApi.md#update_attachment) | **PUT** /v1/attachments/{id} | Update existing attachment. +*AttachmentsApi* | [**upload_attachment**](docs/AttachmentsApi.md#upload_attachment) | **POST** /v1/attachments/{id}/upload | Upload an attachment. +*AutocompleteApi* | [**get_accounts_ac**](docs/AutocompleteApi.md#get_accounts_ac) | **GET** /v1/autocomplete/accounts | Returns all accounts of the user returned in a basic auto-complete array. +*AutocompleteApi* | [**get_bills_ac**](docs/AutocompleteApi.md#get_bills_ac) | **GET** /v1/autocomplete/bills | Returns all bills of the user returned in a basic auto-complete array. +*AutocompleteApi* | [**get_budgets_ac**](docs/AutocompleteApi.md#get_budgets_ac) | **GET** /v1/autocomplete/budgets | Returns all budgets of the user returned in a basic auto-complete array. +*AutocompleteApi* | [**get_categories_ac**](docs/AutocompleteApi.md#get_categories_ac) | **GET** /v1/autocomplete/categories | Returns all categories of the user returned in a basic auto-complete array. +*AutocompleteApi* | [**get_currencies_ac**](docs/AutocompleteApi.md#get_currencies_ac) | **GET** /v1/autocomplete/currencies | Returns all currencies of the user returned in a basic auto-complete array. +*AutocompleteApi* | [**get_currencies_code_ac**](docs/AutocompleteApi.md#get_currencies_code_ac) | **GET** /v1/autocomplete/currencies-with-code | Returns all currencies of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it. +*AutocompleteApi* | [**get_object_groups_ac**](docs/AutocompleteApi.md#get_object_groups_ac) | **GET** /v1/autocomplete/object-groups | Returns all object groups of the user returned in a basic auto-complete array. +*AutocompleteApi* | [**get_piggies_ac**](docs/AutocompleteApi.md#get_piggies_ac) | **GET** /v1/autocomplete/piggy-banks | Returns all piggy banks of the user returned in a basic auto-complete array. +*AutocompleteApi* | [**get_piggies_balance_ac**](docs/AutocompleteApi.md#get_piggies_balance_ac) | **GET** /v1/autocomplete/piggy-banks-with-balance | Returns all piggy banks of the user returned in a basic auto-complete array complemented with balance information. +*AutocompleteApi* | [**get_recurring_ac**](docs/AutocompleteApi.md#get_recurring_ac) | **GET** /v1/autocomplete/recurring | Returns all recurring transactions of the user returned in a basic auto-complete array. +*AutocompleteApi* | [**get_rule_groups_ac**](docs/AutocompleteApi.md#get_rule_groups_ac) | **GET** /v1/autocomplete/rule-groups | Returns all rule groups of the user returned in a basic auto-complete array. +*AutocompleteApi* | [**get_rules_ac**](docs/AutocompleteApi.md#get_rules_ac) | **GET** /v1/autocomplete/rules | Returns all rules of the user returned in a basic auto-complete array. +*AutocompleteApi* | [**get_tag_ac**](docs/AutocompleteApi.md#get_tag_ac) | **GET** /v1/autocomplete/tags | Returns all tags of the user returned in a basic auto-complete array. +*AutocompleteApi* | [**get_transaction_types_ac**](docs/AutocompleteApi.md#get_transaction_types_ac) | **GET** /v1/autocomplete/transaction-types | Returns all transaction types returned in a basic auto-complete array. English only. +*AutocompleteApi* | [**get_transactions_ac**](docs/AutocompleteApi.md#get_transactions_ac) | **GET** /v1/autocomplete/transactions | Returns all transaction descriptions of the user returned in a basic auto-complete array. +*AutocompleteApi* | [**get_transactions_idac**](docs/AutocompleteApi.md#get_transactions_idac) | **GET** /v1/autocomplete/transactions-with-id | Returns all transactions, complemented with their ID, of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it. +*AvailableBudgetsApi* | [**get_available_budget**](docs/AvailableBudgetsApi.md#get_available_budget) | **GET** /v1/available-budgets/{id} | Get a single available budget. +*AvailableBudgetsApi* | [**list_available_budget**](docs/AvailableBudgetsApi.md#list_available_budget) | **GET** /v1/available-budgets | List all available budget amounts. +*BillsApi* | [**delete_bill**](docs/BillsApi.md#delete_bill) | **DELETE** /v1/bills/{id} | Delete a bill. +*BillsApi* | [**get_bill**](docs/BillsApi.md#get_bill) | **GET** /v1/bills/{id} | Get a single bill. +*BillsApi* | [**list_attachment_by_bill**](docs/BillsApi.md#list_attachment_by_bill) | **GET** /v1/bills/{id}/attachments | List all attachments uploaded to the bill. +*BillsApi* | [**list_bill**](docs/BillsApi.md#list_bill) | **GET** /v1/bills | List all bills. +*BillsApi* | [**list_rule_by_bill**](docs/BillsApi.md#list_rule_by_bill) | **GET** /v1/bills/{id}/rules | List all rules associated with the bill. +*BillsApi* | [**list_transaction_by_bill**](docs/BillsApi.md#list_transaction_by_bill) | **GET** /v1/bills/{id}/transactions | List all transactions associated with the bill. +*BillsApi* | [**store_bill**](docs/BillsApi.md#store_bill) | **POST** /v1/bills | Store a new bill +*BillsApi* | [**update_bill**](docs/BillsApi.md#update_bill) | **PUT** /v1/bills/{id} | Update existing bill. +*BudgetsApi* | [**delete_budget**](docs/BudgetsApi.md#delete_budget) | **DELETE** /v1/budgets/{id} | Delete a budget. +*BudgetsApi* | [**delete_budget_limit**](docs/BudgetsApi.md#delete_budget_limit) | **DELETE** /v1/budgets/{id}/limits/{limitId} | Delete a budget limit. +*BudgetsApi* | [**get_budget**](docs/BudgetsApi.md#get_budget) | **GET** /v1/budgets/{id} | Get a single budget. +*BudgetsApi* | [**get_budget_limit**](docs/BudgetsApi.md#get_budget_limit) | **GET** /v1/budgets/{id}/limits/{limitId} | Get single budget limit. +*BudgetsApi* | [**list_attachment_by_budget**](docs/BudgetsApi.md#list_attachment_by_budget) | **GET** /v1/budgets/{id}/attachments | Lists all attachments of a budget. +*BudgetsApi* | [**list_budget**](docs/BudgetsApi.md#list_budget) | **GET** /v1/budgets | List all budgets. +*BudgetsApi* | [**list_budget_limit**](docs/BudgetsApi.md#list_budget_limit) | **GET** /v1/budget-limits | Get list of budget limits by date +*BudgetsApi* | [**list_budget_limit_by_budget**](docs/BudgetsApi.md#list_budget_limit_by_budget) | **GET** /v1/budgets/{id}/limits | Get all limits for a budget. +*BudgetsApi* | [**list_transaction_by_budget**](docs/BudgetsApi.md#list_transaction_by_budget) | **GET** /v1/budgets/{id}/transactions | All transactions to a budget. +*BudgetsApi* | [**list_transaction_by_budget_limit**](docs/BudgetsApi.md#list_transaction_by_budget_limit) | **GET** /v1/budgets/{id}/limits/{limitId}/transactions | List all transactions by a budget limit ID. +*BudgetsApi* | [**store_budget**](docs/BudgetsApi.md#store_budget) | **POST** /v1/budgets | Store a new budget +*BudgetsApi* | [**store_budget_limit**](docs/BudgetsApi.md#store_budget_limit) | **POST** /v1/budgets/{id}/limits | Store new budget limit. +*BudgetsApi* | [**update_budget**](docs/BudgetsApi.md#update_budget) | **PUT** /v1/budgets/{id} | Update existing budget. +*BudgetsApi* | [**update_budget_limit**](docs/BudgetsApi.md#update_budget_limit) | **PUT** /v1/budgets/{id}/limits/{limitId} | Update existing budget limit. +*CategoriesApi* | [**delete_category**](docs/CategoriesApi.md#delete_category) | **DELETE** /v1/categories/{id} | Delete a category. +*CategoriesApi* | [**get_category**](docs/CategoriesApi.md#get_category) | **GET** /v1/categories/{id} | Get a single category. +*CategoriesApi* | [**list_attachment_by_category**](docs/CategoriesApi.md#list_attachment_by_category) | **GET** /v1/categories/{id}/attachments | Lists all attachments. +*CategoriesApi* | [**list_category**](docs/CategoriesApi.md#list_category) | **GET** /v1/categories | List all categories. +*CategoriesApi* | [**list_transaction_by_category**](docs/CategoriesApi.md#list_transaction_by_category) | **GET** /v1/categories/{id}/transactions | List all transactions in a category. +*CategoriesApi* | [**store_category**](docs/CategoriesApi.md#store_category) | **POST** /v1/categories | Store a new category +*CategoriesApi* | [**update_category**](docs/CategoriesApi.md#update_category) | **PUT** /v1/categories/{id} | Update existing category. +*ChartsApi* | [**get_chart_account_overview**](docs/ChartsApi.md#get_chart_account_overview) | **GET** /v1/chart/account/overview | Dashboard chart with asset account balance information. +*ConfigurationApi* | [**get_configuration**](docs/ConfigurationApi.md#get_configuration) | **GET** /v1/configuration | Get Firefly III system configuration values. +*ConfigurationApi* | [**get_single_configuration**](docs/ConfigurationApi.md#get_single_configuration) | **GET** /v1/configuration/{name} | Get a single Firefly III system configuration value +*ConfigurationApi* | [**set_configuration**](docs/ConfigurationApi.md#set_configuration) | **PUT** /v1/configuration/{name} | Update configuration value +*CurrenciesApi* | [**default_currency**](docs/CurrenciesApi.md#default_currency) | **POST** /v1/currencies/{code}/default | Make currency default currency. +*CurrenciesApi* | [**delete_currency**](docs/CurrenciesApi.md#delete_currency) | **DELETE** /v1/currencies/{code} | Delete a currency. +*CurrenciesApi* | [**disable_currency**](docs/CurrenciesApi.md#disable_currency) | **POST** /v1/currencies/{code}/disable | Disable a currency. +*CurrenciesApi* | [**enable_currency**](docs/CurrenciesApi.md#enable_currency) | **POST** /v1/currencies/{code}/enable | Enable a single currency. +*CurrenciesApi* | [**get_currency**](docs/CurrenciesApi.md#get_currency) | **GET** /v1/currencies/{code} | Get a single currency. +*CurrenciesApi* | [**get_default_currency**](docs/CurrenciesApi.md#get_default_currency) | **GET** /v1/currencies/default | Get the user's default currency. +*CurrenciesApi* | [**list_account_by_currency**](docs/CurrenciesApi.md#list_account_by_currency) | **GET** /v1/currencies/{code}/accounts | List all accounts with this currency. +*CurrenciesApi* | [**list_available_budget_by_currency**](docs/CurrenciesApi.md#list_available_budget_by_currency) | **GET** /v1/currencies/{code}/available-budgets | List all available budgets with this currency. +*CurrenciesApi* | [**list_bill_by_currency**](docs/CurrenciesApi.md#list_bill_by_currency) | **GET** /v1/currencies/{code}/bills | List all bills with this currency. +*CurrenciesApi* | [**list_budget_limit_by_currency**](docs/CurrenciesApi.md#list_budget_limit_by_currency) | **GET** /v1/currencies/{code}/budget_limits | List all budget limits with this currency +*CurrenciesApi* | [**list_currency**](docs/CurrenciesApi.md#list_currency) | **GET** /v1/currencies | List all currencies. +*CurrenciesApi* | [**list_recurrence_by_currency**](docs/CurrenciesApi.md#list_recurrence_by_currency) | **GET** /v1/currencies/{code}/recurrences | List all recurring transactions with this currency. +*CurrenciesApi* | [**list_rule_by_currency**](docs/CurrenciesApi.md#list_rule_by_currency) | **GET** /v1/currencies/{code}/rules | List all rules with this currency. +*CurrenciesApi* | [**list_transaction_by_currency**](docs/CurrenciesApi.md#list_transaction_by_currency) | **GET** /v1/currencies/{code}/transactions | List all transactions with this currency. +*CurrenciesApi* | [**store_currency**](docs/CurrenciesApi.md#store_currency) | **POST** /v1/currencies | Store a new currency +*CurrenciesApi* | [**update_currency**](docs/CurrenciesApi.md#update_currency) | **PUT** /v1/currencies/{code} | Update existing currency. +*DataApi* | [**bulk_update_transactions**](docs/DataApi.md#bulk_update_transactions) | **POST** /v1/data/bulk/transactions | Bulk update transaction properties. For more information, see https://docs.firefly-iii.org/references/firefly-iii/api/specials/ +*DataApi* | [**destroy_data**](docs/DataApi.md#destroy_data) | **DELETE** /v1/data/destroy | Endpoint to destroy user data +*DataApi* | [**export_accounts**](docs/DataApi.md#export_accounts) | **GET** /v1/data/export/accounts | Export account data from Firefly III +*DataApi* | [**export_bills**](docs/DataApi.md#export_bills) | **GET** /v1/data/export/bills | Export bills from Firefly III +*DataApi* | [**export_budgets**](docs/DataApi.md#export_budgets) | **GET** /v1/data/export/budgets | Export budgets and budget amount data from Firefly III +*DataApi* | [**export_categories**](docs/DataApi.md#export_categories) | **GET** /v1/data/export/categories | Export category data from Firefly III +*DataApi* | [**export_piggies**](docs/DataApi.md#export_piggies) | **GET** /v1/data/export/piggy-banks | Export piggy banks from Firefly III +*DataApi* | [**export_recurring**](docs/DataApi.md#export_recurring) | **GET** /v1/data/export/recurring | Export recurring transaction data from Firefly III +*DataApi* | [**export_rules**](docs/DataApi.md#export_rules) | **GET** /v1/data/export/rules | Export rule groups and rule data from Firefly III +*DataApi* | [**export_tags**](docs/DataApi.md#export_tags) | **GET** /v1/data/export/tags | Export tag data from Firefly III +*DataApi* | [**export_transactions**](docs/DataApi.md#export_transactions) | **GET** /v1/data/export/transactions | Export transaction data from Firefly III +*DataApi* | [**purge_data**](docs/DataApi.md#purge_data) | **DELETE** /v1/data/purge | Endpoint to purge user data +*InsightApi* | [**insight_expense_asset**](docs/InsightApi.md#insight_expense_asset) | **GET** /v1/insight/expense/asset | Insight into expenses, grouped by asset account. +*InsightApi* | [**insight_expense_bill**](docs/InsightApi.md#insight_expense_bill) | **GET** /v1/insight/expense/bill | Insight into expenses, grouped by bill. +*InsightApi* | [**insight_expense_budget**](docs/InsightApi.md#insight_expense_budget) | **GET** /v1/insight/expense/budget | Insight into expenses, grouped by budget. +*InsightApi* | [**insight_expense_category**](docs/InsightApi.md#insight_expense_category) | **GET** /v1/insight/expense/category | Insight into expenses, grouped by category. +*InsightApi* | [**insight_expense_expense**](docs/InsightApi.md#insight_expense_expense) | **GET** /v1/insight/expense/expense | Insight into expenses, grouped by expense account. +*InsightApi* | [**insight_expense_no_bill**](docs/InsightApi.md#insight_expense_no_bill) | **GET** /v1/insight/expense/no-bill | Insight into expenses, without bill. +*InsightApi* | [**insight_expense_no_budget**](docs/InsightApi.md#insight_expense_no_budget) | **GET** /v1/insight/expense/no-budget | Insight into expenses, without budget. +*InsightApi* | [**insight_expense_no_category**](docs/InsightApi.md#insight_expense_no_category) | **GET** /v1/insight/expense/no-category | Insight into expenses, without category. +*InsightApi* | [**insight_expense_no_tag**](docs/InsightApi.md#insight_expense_no_tag) | **GET** /v1/insight/expense/no-tag | Insight into expenses, without tag. +*InsightApi* | [**insight_expense_tag**](docs/InsightApi.md#insight_expense_tag) | **GET** /v1/insight/expense/tag | Insight into expenses, grouped by tag. +*InsightApi* | [**insight_expense_total**](docs/InsightApi.md#insight_expense_total) | **GET** /v1/insight/expense/total | Insight into total expenses. +*InsightApi* | [**insight_income_asset**](docs/InsightApi.md#insight_income_asset) | **GET** /v1/insight/income/asset | Insight into income, grouped by asset account. +*InsightApi* | [**insight_income_category**](docs/InsightApi.md#insight_income_category) | **GET** /v1/insight/income/category | Insight into income, grouped by category. +*InsightApi* | [**insight_income_no_category**](docs/InsightApi.md#insight_income_no_category) | **GET** /v1/insight/income/no-category | Insight into income, without category. +*InsightApi* | [**insight_income_no_tag**](docs/InsightApi.md#insight_income_no_tag) | **GET** /v1/insight/income/no-tag | Insight into income, without tag. +*InsightApi* | [**insight_income_revenue**](docs/InsightApi.md#insight_income_revenue) | **GET** /v1/insight/income/revenue | Insight into income, grouped by revenue account. +*InsightApi* | [**insight_income_tag**](docs/InsightApi.md#insight_income_tag) | **GET** /v1/insight/income/tag | Insight into income, grouped by tag. +*InsightApi* | [**insight_income_total**](docs/InsightApi.md#insight_income_total) | **GET** /v1/insight/income/total | Insight into total income. +*InsightApi* | [**insight_transfer_category**](docs/InsightApi.md#insight_transfer_category) | **GET** /v1/insight/transfer/category | Insight into transfers, grouped by category. +*InsightApi* | [**insight_transfer_no_category**](docs/InsightApi.md#insight_transfer_no_category) | **GET** /v1/insight/transfer/no-category | Insight into transfers, without category. +*InsightApi* | [**insight_transfer_no_tag**](docs/InsightApi.md#insight_transfer_no_tag) | **GET** /v1/insight/transfer/no-tag | Insight into expenses, without tag. +*InsightApi* | [**insight_transfer_tag**](docs/InsightApi.md#insight_transfer_tag) | **GET** /v1/insight/transfer/tag | Insight into transfers, grouped by tag. +*InsightApi* | [**insight_transfer_total**](docs/InsightApi.md#insight_transfer_total) | **GET** /v1/insight/transfer/total | Insight into total transfers. +*InsightApi* | [**insight_transfers**](docs/InsightApi.md#insight_transfers) | **GET** /v1/insight/transfer/asset | Insight into transfers, grouped by account. +*LinksApi* | [**delete_link_type**](docs/LinksApi.md#delete_link_type) | **DELETE** /v1/link-types/{id} | Permanently delete link type. +*LinksApi* | [**delete_transaction_link**](docs/LinksApi.md#delete_transaction_link) | **DELETE** /v1/transaction-links/{id} | Permanently delete link between transactions. +*LinksApi* | [**get_link_type**](docs/LinksApi.md#get_link_type) | **GET** /v1/link-types/{id} | Get single a link type. +*LinksApi* | [**get_transaction_link**](docs/LinksApi.md#get_transaction_link) | **GET** /v1/transaction-links/{id} | Get a single link. +*LinksApi* | [**list_link_type**](docs/LinksApi.md#list_link_type) | **GET** /v1/link-types | List all types of links. +*LinksApi* | [**list_transaction_by_link_type**](docs/LinksApi.md#list_transaction_by_link_type) | **GET** /v1/link-types/{id}/transactions | List all transactions under this link type. +*LinksApi* | [**list_transaction_link**](docs/LinksApi.md#list_transaction_link) | **GET** /v1/transaction-links | List all transaction links. +*LinksApi* | [**store_link_type**](docs/LinksApi.md#store_link_type) | **POST** /v1/link-types | Create a new link type +*LinksApi* | [**store_transaction_link**](docs/LinksApi.md#store_transaction_link) | **POST** /v1/transaction-links | Create a new link between transactions +*LinksApi* | [**update_link_type**](docs/LinksApi.md#update_link_type) | **PUT** /v1/link-types/{id} | Update existing link type. +*LinksApi* | [**update_transaction_link**](docs/LinksApi.md#update_transaction_link) | **PUT** /v1/transaction-links/{id} | Update an existing link between transactions. +*ObjectGroupsApi* | [**delete_object_group**](docs/ObjectGroupsApi.md#delete_object_group) | **DELETE** /v1/object-groups/{id} | Delete a object group. +*ObjectGroupsApi* | [**get_object_group**](docs/ObjectGroupsApi.md#get_object_group) | **GET** /v1/object-groups/{id} | Get a single object group. +*ObjectGroupsApi* | [**list_bill_by_object_group**](docs/ObjectGroupsApi.md#list_bill_by_object_group) | **GET** /v1/object-groups/{id}/bills | List all bills with this object group. +*ObjectGroupsApi* | [**list_object_groups**](docs/ObjectGroupsApi.md#list_object_groups) | **GET** /v1/object-groups | List all oject groups. +*ObjectGroupsApi* | [**list_piggy_bank_by_object_group**](docs/ObjectGroupsApi.md#list_piggy_bank_by_object_group) | **GET** /v1/object-groups/{id}/piggy-banks | List all piggy banks related to the object group. +*ObjectGroupsApi* | [**update_object_group**](docs/ObjectGroupsApi.md#update_object_group) | **PUT** /v1/object-groups/{id} | Update existing object group. +*PiggyBanksApi* | [**delete_piggy_bank**](docs/PiggyBanksApi.md#delete_piggy_bank) | **DELETE** /v1/piggy-banks/{id} | Delete a piggy bank. +*PiggyBanksApi* | [**get_piggy_bank**](docs/PiggyBanksApi.md#get_piggy_bank) | **GET** /v1/piggy-banks/{id} | Get a single piggy bank. +*PiggyBanksApi* | [**list_attachment_by_piggy_bank**](docs/PiggyBanksApi.md#list_attachment_by_piggy_bank) | **GET** /v1/piggy-banks/{id}/attachments | Lists all attachments. +*PiggyBanksApi* | [**list_event_by_piggy_bank**](docs/PiggyBanksApi.md#list_event_by_piggy_bank) | **GET** /v1/piggy-banks/{id}/events | List all events linked to a piggy bank. +*PiggyBanksApi* | [**list_piggy_bank**](docs/PiggyBanksApi.md#list_piggy_bank) | **GET** /v1/piggy-banks | List all piggy banks. +*PiggyBanksApi* | [**store_piggy_bank**](docs/PiggyBanksApi.md#store_piggy_bank) | **POST** /v1/piggy-banks | Store a new piggy bank +*PiggyBanksApi* | [**update_piggy_bank**](docs/PiggyBanksApi.md#update_piggy_bank) | **PUT** /v1/piggy-banks/{id} | Update existing piggy bank. +*PreferencesApi* | [**get_preference**](docs/PreferencesApi.md#get_preference) | **GET** /v1/preferences/{name} | Return a single preference. +*PreferencesApi* | [**list_preference**](docs/PreferencesApi.md#list_preference) | **GET** /v1/preferences | List all users preferences. +*PreferencesApi* | [**store_preference**](docs/PreferencesApi.md#store_preference) | **POST** /v1/preferences | Store a new preference for this user. +*PreferencesApi* | [**update_preference**](docs/PreferencesApi.md#update_preference) | **PUT** /v1/preferences/{name} | Update preference +*RecurrencesApi* | [**delete_recurrence**](docs/RecurrencesApi.md#delete_recurrence) | **DELETE** /v1/recurrences/{id} | Delete a recurring transaction. +*RecurrencesApi* | [**get_recurrence**](docs/RecurrencesApi.md#get_recurrence) | **GET** /v1/recurrences/{id} | Get a single recurring transaction. +*RecurrencesApi* | [**list_recurrence**](docs/RecurrencesApi.md#list_recurrence) | **GET** /v1/recurrences | List all recurring transactions. +*RecurrencesApi* | [**list_transaction_by_recurrence**](docs/RecurrencesApi.md#list_transaction_by_recurrence) | **GET** /v1/recurrences/{id}/transactions | List all transactions created by a recurring transaction. +*RecurrencesApi* | [**store_recurrence**](docs/RecurrencesApi.md#store_recurrence) | **POST** /v1/recurrences | Store a new recurring transaction +*RecurrencesApi* | [**update_recurrence**](docs/RecurrencesApi.md#update_recurrence) | **PUT** /v1/recurrences/{id} | Update existing recurring transaction. +*RuleGroupsApi* | [**delete_rule_group**](docs/RuleGroupsApi.md#delete_rule_group) | **DELETE** /v1/rule-groups/{id} | Delete a rule group. +*RuleGroupsApi* | [**fire_rule_group**](docs/RuleGroupsApi.md#fire_rule_group) | **POST** /v1/rule-groups/{id}/trigger | Fire the rule group on your transactions. +*RuleGroupsApi* | [**get_rule_group**](docs/RuleGroupsApi.md#get_rule_group) | **GET** /v1/rule-groups/{id} | Get a single rule group. +*RuleGroupsApi* | [**list_rule_by_group**](docs/RuleGroupsApi.md#list_rule_by_group) | **GET** /v1/rule-groups/{id}/rules | List rules in this rule group. +*RuleGroupsApi* | [**list_rule_group**](docs/RuleGroupsApi.md#list_rule_group) | **GET** /v1/rule-groups | List all rule groups. +*RuleGroupsApi* | [**store_rule_group**](docs/RuleGroupsApi.md#store_rule_group) | **POST** /v1/rule-groups | Store a new rule group. +*RuleGroupsApi* | [**test_rule_group**](docs/RuleGroupsApi.md#test_rule_group) | **GET** /v1/rule-groups/{id}/test | Test which transactions would be hit by the rule group. No changes will be made. +*RuleGroupsApi* | [**update_rule_group**](docs/RuleGroupsApi.md#update_rule_group) | **PUT** /v1/rule-groups/{id} | Update existing rule group. +*RulesApi* | [**delete_rule**](docs/RulesApi.md#delete_rule) | **DELETE** /v1/rules/{id} | Delete an rule. +*RulesApi* | [**fire_rule**](docs/RulesApi.md#fire_rule) | **POST** /v1/rules/{id}/trigger | Fire the rule on your transactions. +*RulesApi* | [**get_rule**](docs/RulesApi.md#get_rule) | **GET** /v1/rules/{id} | Get a single rule. +*RulesApi* | [**list_rule**](docs/RulesApi.md#list_rule) | **GET** /v1/rules | List all rules. +*RulesApi* | [**store_rule**](docs/RulesApi.md#store_rule) | **POST** /v1/rules | Store a new rule +*RulesApi* | [**test_rule**](docs/RulesApi.md#test_rule) | **GET** /v1/rules/{id}/test | Test which transactions would be hit by the rule. No changes will be made. +*RulesApi* | [**update_rule**](docs/RulesApi.md#update_rule) | **PUT** /v1/rules/{id} | Update existing rule. +*SearchApi* | [**search_accounts**](docs/SearchApi.md#search_accounts) | **GET** /v1/search/accounts | Search for accounts +*SearchApi* | [**search_transactions**](docs/SearchApi.md#search_transactions) | **GET** /v1/search/transactions | Search for transactions +*SummaryApi* | [**get_basic_summary**](docs/SummaryApi.md#get_basic_summary) | **GET** /v1/summary/basic | Returns basic sums of the users data. +*TagsApi* | [**delete_tag**](docs/TagsApi.md#delete_tag) | **DELETE** /v1/tags/{tag} | Delete an tag. +*TagsApi* | [**get_tag**](docs/TagsApi.md#get_tag) | **GET** /v1/tags/{tag} | Get a single tag. +*TagsApi* | [**list_attachment_by_tag**](docs/TagsApi.md#list_attachment_by_tag) | **GET** /v1/tags/{tag}/attachments | Lists all attachments. +*TagsApi* | [**list_tag**](docs/TagsApi.md#list_tag) | **GET** /v1/tags | List all tags. +*TagsApi* | [**list_transaction_by_tag**](docs/TagsApi.md#list_transaction_by_tag) | **GET** /v1/tags/{tag}/transactions | List all transactions with this tag. +*TagsApi* | [**store_tag**](docs/TagsApi.md#store_tag) | **POST** /v1/tags | Store a new tag +*TagsApi* | [**update_tag**](docs/TagsApi.md#update_tag) | **PUT** /v1/tags/{tag} | Update existing tag. +*TransactionsApi* | [**delete_transaction**](docs/TransactionsApi.md#delete_transaction) | **DELETE** /v1/transactions/{id} | Delete a transaction. +*TransactionsApi* | [**delete_transaction_journal**](docs/TransactionsApi.md#delete_transaction_journal) | **DELETE** /v1/transaction-journals/{id} | Delete split from transaction +*TransactionsApi* | [**get_transaction**](docs/TransactionsApi.md#get_transaction) | **GET** /v1/transactions/{id} | Get a single transaction. +*TransactionsApi* | [**get_transaction_by_journal**](docs/TransactionsApi.md#get_transaction_by_journal) | **GET** /v1/transaction-journals/{id} | Get a single transaction, based on one of the underlying transaction journals (transaction splits). +*TransactionsApi* | [**list_attachment_by_transaction**](docs/TransactionsApi.md#list_attachment_by_transaction) | **GET** /v1/transactions/{id}/attachments | Lists all attachments. +*TransactionsApi* | [**list_event_by_transaction**](docs/TransactionsApi.md#list_event_by_transaction) | **GET** /v1/transactions/{id}/piggy-bank-events | Lists all piggy bank events. +*TransactionsApi* | [**list_links_by_journal**](docs/TransactionsApi.md#list_links_by_journal) | **GET** /v1/transaction-journals/{id}/links | Lists all the transaction links for an individual journal (individual split). +*TransactionsApi* | [**list_transaction**](docs/TransactionsApi.md#list_transaction) | **GET** /v1/transactions | List all the user's transactions. +*TransactionsApi* | [**store_transaction**](docs/TransactionsApi.md#store_transaction) | **POST** /v1/transactions | Store a new transaction +*TransactionsApi* | [**update_transaction**](docs/TransactionsApi.md#update_transaction) | **PUT** /v1/transactions/{id} | Update existing transaction. For more information, see https://docs.firefly-iii.org/references/firefly-iii/api/specials/ +*UsersApi* | [**delete_user**](docs/UsersApi.md#delete_user) | **DELETE** /v1/users/{id} | Delete a user. +*UsersApi* | [**get_user**](docs/UsersApi.md#get_user) | **GET** /v1/users/{id} | Get a single user. +*UsersApi* | [**list_user**](docs/UsersApi.md#list_user) | **GET** /v1/users | List all users. +*UsersApi* | [**store_user**](docs/UsersApi.md#store_user) | **POST** /v1/users | Store a new user +*UsersApi* | [**update_user**](docs/UsersApi.md#update_user) | **PUT** /v1/users/{id} | Update an existing user's information. +*WebhooksApi* | [**delete_webhook**](docs/WebhooksApi.md#delete_webhook) | **DELETE** /v1/webhooks/{id} | Delete a webhook. +*WebhooksApi* | [**delete_webhook_message**](docs/WebhooksApi.md#delete_webhook_message) | **DELETE** /v1/webhooks/{id}/messages/{messageId} | Delete a webhook message. +*WebhooksApi* | [**delete_webhook_message_attempt**](docs/WebhooksApi.md#delete_webhook_message_attempt) | **DELETE** /v1/webhooks/{id}/messages/{messageId}/attempts/{attemptId} | Delete a webhook attempt. +*WebhooksApi* | [**get_single_webhook_message**](docs/WebhooksApi.md#get_single_webhook_message) | **GET** /v1/webhooks/{id}/messages/{messageId} | Get a single message from a webhook. +*WebhooksApi* | [**get_single_webhook_message_attempt**](docs/WebhooksApi.md#get_single_webhook_message_attempt) | **GET** /v1/webhooks/{id}/messages/{messageId}/attempts/{attemptId} | Get a single failed attempt from a single webhook message. +*WebhooksApi* | [**get_webhook**](docs/WebhooksApi.md#get_webhook) | **GET** /v1/webhooks/{id} | Get a single webhook. +*WebhooksApi* | [**get_webhook_message_attempts**](docs/WebhooksApi.md#get_webhook_message_attempts) | **GET** /v1/webhooks/{id}/messages/{messageId}/attempts | Get all the failed attempts of a single webhook message. +*WebhooksApi* | [**get_webhook_messages**](docs/WebhooksApi.md#get_webhook_messages) | **GET** /v1/webhooks/{id}/messages | Get all the messages of a single webhook. +*WebhooksApi* | [**list_webhook**](docs/WebhooksApi.md#list_webhook) | **GET** /v1/webhooks | List all webhooks. +*WebhooksApi* | [**store_webhook**](docs/WebhooksApi.md#store_webhook) | **POST** /v1/webhooks | Store a new webhook +*WebhooksApi* | [**submit_webook**](docs/WebhooksApi.md#submit_webook) | **POST** /v1/webhooks/{id}/submit | Submit messages for a webhook. +*WebhooksApi* | [**trigger_transaction_webhook**](docs/WebhooksApi.md#trigger_transaction_webhook) | **POST** /v1/webhooks/{id}/trigger-transaction/{transactionId} | Trigger webhook for a given transaction. +*WebhooksApi* | [**update_webhook**](docs/WebhooksApi.md#update_webhook) | **PUT** /v1/webhooks/{id} | Update existing webhook. + + +## Documentation For Models + + - [Account](docs/Account.md) + - [AccountArray](docs/AccountArray.md) + - [AccountRead](docs/AccountRead.md) + - [AccountRoleProperty](docs/AccountRoleProperty.md) + - [AccountSearchFieldFilter](docs/AccountSearchFieldFilter.md) + - [AccountSingle](docs/AccountSingle.md) + - [AccountStore](docs/AccountStore.md) + - [AccountTypeFilter](docs/AccountTypeFilter.md) + - [AccountTypeProperty](docs/AccountTypeProperty.md) + - [AccountUpdate](docs/AccountUpdate.md) + - [AttachableType](docs/AttachableType.md) + - [Attachment](docs/Attachment.md) + - [AttachmentArray](docs/AttachmentArray.md) + - [AttachmentRead](docs/AttachmentRead.md) + - [AttachmentSingle](docs/AttachmentSingle.md) + - [AttachmentStore](docs/AttachmentStore.md) + - [AttachmentUpdate](docs/AttachmentUpdate.md) + - [AutoBudgetPeriod](docs/AutoBudgetPeriod.md) + - [AutoBudgetType](docs/AutoBudgetType.md) + - [AutocompleteAccount](docs/AutocompleteAccount.md) + - [AutocompleteBill](docs/AutocompleteBill.md) + - [AutocompleteBudget](docs/AutocompleteBudget.md) + - [AutocompleteCategory](docs/AutocompleteCategory.md) + - [AutocompleteCurrency](docs/AutocompleteCurrency.md) + - [AutocompleteCurrencyCode](docs/AutocompleteCurrencyCode.md) + - [AutocompleteObjectGroup](docs/AutocompleteObjectGroup.md) + - [AutocompletePiggy](docs/AutocompletePiggy.md) + - [AutocompletePiggyBalance](docs/AutocompletePiggyBalance.md) + - [AutocompleteRecurrence](docs/AutocompleteRecurrence.md) + - [AutocompleteRule](docs/AutocompleteRule.md) + - [AutocompleteRuleGroup](docs/AutocompleteRuleGroup.md) + - [AutocompleteTag](docs/AutocompleteTag.md) + - [AutocompleteTransaction](docs/AutocompleteTransaction.md) + - [AutocompleteTransactionId](docs/AutocompleteTransactionId.md) + - [AutocompleteTransactionType](docs/AutocompleteTransactionType.md) + - [AvailableBudget](docs/AvailableBudget.md) + - [AvailableBudgetArray](docs/AvailableBudgetArray.md) + - [AvailableBudgetRead](docs/AvailableBudgetRead.md) + - [AvailableBudgetSingle](docs/AvailableBudgetSingle.md) + - [BadRequestResponse](docs/BadRequestResponse.md) + - [BasicSummaryEntry](docs/BasicSummaryEntry.md) + - [Bill](docs/Bill.md) + - [BillArray](docs/BillArray.md) + - [BillPaidDatesInner](docs/BillPaidDatesInner.md) + - [BillRead](docs/BillRead.md) + - [BillRepeatFrequency](docs/BillRepeatFrequency.md) + - [BillSingle](docs/BillSingle.md) + - [BillStore](docs/BillStore.md) + - [BillUpdate](docs/BillUpdate.md) + - [Budget](docs/Budget.md) + - [BudgetArray](docs/BudgetArray.md) + - [BudgetLimit](docs/BudgetLimit.md) + - [BudgetLimitArray](docs/BudgetLimitArray.md) + - [BudgetLimitRead](docs/BudgetLimitRead.md) + - [BudgetLimitSingle](docs/BudgetLimitSingle.md) + - [BudgetLimitStore](docs/BudgetLimitStore.md) + - [BudgetRead](docs/BudgetRead.md) + - [BudgetSingle](docs/BudgetSingle.md) + - [BudgetSpent](docs/BudgetSpent.md) + - [BudgetStore](docs/BudgetStore.md) + - [BudgetUpdate](docs/BudgetUpdate.md) + - [Category](docs/Category.md) + - [CategoryArray](docs/CategoryArray.md) + - [CategoryEarned](docs/CategoryEarned.md) + - [CategoryRead](docs/CategoryRead.md) + - [CategorySingle](docs/CategorySingle.md) + - [CategorySpent](docs/CategorySpent.md) + - [CategoryUpdate](docs/CategoryUpdate.md) + - [ChartDataPoint](docs/ChartDataPoint.md) + - [ChartDataSet](docs/ChartDataSet.md) + - [ConfigValueFilter](docs/ConfigValueFilter.md) + - [ConfigValueUpdateFilter](docs/ConfigValueUpdateFilter.md) + - [Configuration](docs/Configuration.md) + - [ConfigurationSingle](docs/ConfigurationSingle.md) + - [ConfigurationUpdate](docs/ConfigurationUpdate.md) + - [CreditCardTypeProperty](docs/CreditCardTypeProperty.md) + - [CronResult](docs/CronResult.md) + - [CronResultRow](docs/CronResultRow.md) + - [Currency](docs/Currency.md) + - [CurrencyArray](docs/CurrencyArray.md) + - [CurrencyRead](docs/CurrencyRead.md) + - [CurrencySingle](docs/CurrencySingle.md) + - [CurrencyStore](docs/CurrencyStore.md) + - [CurrencyUpdate](docs/CurrencyUpdate.md) + - [DataDestroyObject](docs/DataDestroyObject.md) + - [ExportFileFilter](docs/ExportFileFilter.md) + - [InsightGroupEntry](docs/InsightGroupEntry.md) + - [InsightTotalEntry](docs/InsightTotalEntry.md) + - [InsightTransferEntry](docs/InsightTransferEntry.md) + - [InterestPeriodProperty](docs/InterestPeriodProperty.md) + - [InternalExceptionResponse](docs/InternalExceptionResponse.md) + - [LiabilityDirectionProperty](docs/LiabilityDirectionProperty.md) + - [LiabilityTypeProperty](docs/LiabilityTypeProperty.md) + - [LinkType](docs/LinkType.md) + - [LinkTypeArray](docs/LinkTypeArray.md) + - [LinkTypeRead](docs/LinkTypeRead.md) + - [LinkTypeSingle](docs/LinkTypeSingle.md) + - [LinkTypeUpdate](docs/LinkTypeUpdate.md) + - [Meta](docs/Meta.md) + - [MetaPagination](docs/MetaPagination.md) + - [NotFoundResponse](docs/NotFoundResponse.md) + - [ObjectGroup](docs/ObjectGroup.md) + - [ObjectGroupArray](docs/ObjectGroupArray.md) + - [ObjectGroupRead](docs/ObjectGroupRead.md) + - [ObjectGroupSingle](docs/ObjectGroupSingle.md) + - [ObjectGroupUpdate](docs/ObjectGroupUpdate.md) + - [ObjectLink](docs/ObjectLink.md) + - [ObjectLink0](docs/ObjectLink0.md) + - [PageLink](docs/PageLink.md) + - [PiggyBank](docs/PiggyBank.md) + - [PiggyBankArray](docs/PiggyBankArray.md) + - [PiggyBankEvent](docs/PiggyBankEvent.md) + - [PiggyBankEventArray](docs/PiggyBankEventArray.md) + - [PiggyBankEventRead](docs/PiggyBankEventRead.md) + - [PiggyBankRead](docs/PiggyBankRead.md) + - [PiggyBankSingle](docs/PiggyBankSingle.md) + - [PiggyBankStore](docs/PiggyBankStore.md) + - [PiggyBankUpdate](docs/PiggyBankUpdate.md) + - [PolymorphicProperty](docs/PolymorphicProperty.md) + - [Preference](docs/Preference.md) + - [PreferenceArray](docs/PreferenceArray.md) + - [PreferenceRead](docs/PreferenceRead.md) + - [PreferenceSingle](docs/PreferenceSingle.md) + - [PreferenceUpdate](docs/PreferenceUpdate.md) + - [Recurrence](docs/Recurrence.md) + - [RecurrenceArray](docs/RecurrenceArray.md) + - [RecurrenceRead](docs/RecurrenceRead.md) + - [RecurrenceRepetition](docs/RecurrenceRepetition.md) + - [RecurrenceRepetitionStore](docs/RecurrenceRepetitionStore.md) + - [RecurrenceRepetitionType](docs/RecurrenceRepetitionType.md) + - [RecurrenceRepetitionUpdate](docs/RecurrenceRepetitionUpdate.md) + - [RecurrenceSingle](docs/RecurrenceSingle.md) + - [RecurrenceStore](docs/RecurrenceStore.md) + - [RecurrenceTransaction](docs/RecurrenceTransaction.md) + - [RecurrenceTransactionStore](docs/RecurrenceTransactionStore.md) + - [RecurrenceTransactionType](docs/RecurrenceTransactionType.md) + - [RecurrenceTransactionUpdate](docs/RecurrenceTransactionUpdate.md) + - [RecurrenceUpdate](docs/RecurrenceUpdate.md) + - [Rule](docs/Rule.md) + - [RuleAction](docs/RuleAction.md) + - [RuleActionKeyword](docs/RuleActionKeyword.md) + - [RuleActionStore](docs/RuleActionStore.md) + - [RuleActionUpdate](docs/RuleActionUpdate.md) + - [RuleArray](docs/RuleArray.md) + - [RuleGroup](docs/RuleGroup.md) + - [RuleGroupArray](docs/RuleGroupArray.md) + - [RuleGroupRead](docs/RuleGroupRead.md) + - [RuleGroupSingle](docs/RuleGroupSingle.md) + - [RuleGroupStore](docs/RuleGroupStore.md) + - [RuleGroupUpdate](docs/RuleGroupUpdate.md) + - [RuleRead](docs/RuleRead.md) + - [RuleSingle](docs/RuleSingle.md) + - [RuleStore](docs/RuleStore.md) + - [RuleTrigger](docs/RuleTrigger.md) + - [RuleTriggerKeyword](docs/RuleTriggerKeyword.md) + - [RuleTriggerStore](docs/RuleTriggerStore.md) + - [RuleTriggerType](docs/RuleTriggerType.md) + - [RuleTriggerUpdate](docs/RuleTriggerUpdate.md) + - [RuleUpdate](docs/RuleUpdate.md) + - [ShortAccountTypeProperty](docs/ShortAccountTypeProperty.md) + - [SystemInfo](docs/SystemInfo.md) + - [SystemInfoData](docs/SystemInfoData.md) + - [TagArray](docs/TagArray.md) + - [TagModel](docs/TagModel.md) + - [TagModelStore](docs/TagModelStore.md) + - [TagModelUpdate](docs/TagModelUpdate.md) + - [TagRead](docs/TagRead.md) + - [TagSingle](docs/TagSingle.md) + - [Transaction](docs/Transaction.md) + - [TransactionArray](docs/TransactionArray.md) + - [TransactionLink](docs/TransactionLink.md) + - [TransactionLinkArray](docs/TransactionLinkArray.md) + - [TransactionLinkRead](docs/TransactionLinkRead.md) + - [TransactionLinkSingle](docs/TransactionLinkSingle.md) + - [TransactionLinkStore](docs/TransactionLinkStore.md) + - [TransactionLinkUpdate](docs/TransactionLinkUpdate.md) + - [TransactionRead](docs/TransactionRead.md) + - [TransactionSingle](docs/TransactionSingle.md) + - [TransactionSplit](docs/TransactionSplit.md) + - [TransactionSplitStore](docs/TransactionSplitStore.md) + - [TransactionSplitUpdate](docs/TransactionSplitUpdate.md) + - [TransactionStore](docs/TransactionStore.md) + - [TransactionTypeFilter](docs/TransactionTypeFilter.md) + - [TransactionTypeProperty](docs/TransactionTypeProperty.md) + - [TransactionUpdate](docs/TransactionUpdate.md) + - [UnauthenticatedResponse](docs/UnauthenticatedResponse.md) + - [User](docs/User.md) + - [UserArray](docs/UserArray.md) + - [UserBlockedCodeProperty](docs/UserBlockedCodeProperty.md) + - [UserRead](docs/UserRead.md) + - [UserRoleProperty](docs/UserRoleProperty.md) + - [UserSingle](docs/UserSingle.md) + - [ValidationErrorResponse](docs/ValidationErrorResponse.md) + - [ValidationErrorResponseErrors](docs/ValidationErrorResponseErrors.md) + - [Webhook](docs/Webhook.md) + - [WebhookArray](docs/WebhookArray.md) + - [WebhookAttempt](docs/WebhookAttempt.md) + - [WebhookAttemptArray](docs/WebhookAttemptArray.md) + - [WebhookAttemptRead](docs/WebhookAttemptRead.md) + - [WebhookAttemptSingle](docs/WebhookAttemptSingle.md) + - [WebhookDelivery](docs/WebhookDelivery.md) + - [WebhookMessage](docs/WebhookMessage.md) + - [WebhookMessageArray](docs/WebhookMessageArray.md) + - [WebhookMessageRead](docs/WebhookMessageRead.md) + - [WebhookMessageSingle](docs/WebhookMessageSingle.md) + - [WebhookRead](docs/WebhookRead.md) + - [WebhookResponse](docs/WebhookResponse.md) + - [WebhookSingle](docs/WebhookSingle.md) + - [WebhookStore](docs/WebhookStore.md) + - [WebhookTrigger](docs/WebhookTrigger.md) + - [WebhookUpdate](docs/WebhookUpdate.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + +james@firefly-iii.org + diff --git a/firefly-iii-api/docs/AboutApi.md b/firefly-iii-api/docs/AboutApi.md new file mode 100644 index 0000000..8853ba4 --- /dev/null +++ b/firefly-iii-api/docs/AboutApi.md @@ -0,0 +1,104 @@ +# \AboutApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_about**](AboutApi.md#get_about) | **GET** /v1/about | System information end point. +[**get_cron**](AboutApi.md#get_cron) | **GET** /v1/cron/{cliToken} | Cron job endpoint +[**get_current_user**](AboutApi.md#get_current_user) | **GET** /v1/about/user | Currently authenticated user endpoint. + + + +## get_about + +> models::SystemInfo get_about(x_trace_id) +System information end point. + +Returns general system information and versions of the (supporting) software. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::SystemInfo**](SystemInfo.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_cron + +> models::CronResult get_cron(cli_token, x_trace_id, date, force) +Cron job endpoint + +Firefly III has one endpoint for its various cron related tasks. Send a GET to this endpoint to run the cron. The cron requires the CLI token to be present. The cron job will fire for all users. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**cli_token** | **String** | The CLI token of any user in Firefly III, required to run the cron job. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**date** | Option<**String**> | A date formatted YYYY-MM-DD. This can be used to make the cron job pretend it's running on another day. | | +**force** | Option<**bool**> | Forces the cron job to fire, regardless of whether it has fired before. This may result in double transactions or weird budgets, so be careful. | | + +### Return type + +[**models::CronResult**](CronResult.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_current_user + +> models::UserSingle get_current_user(x_trace_id) +Currently authenticated user endpoint. + +Returns the currently authenticated user. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::UserSingle**](UserSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/Account.md b/firefly-iii-api/docs/Account.md new file mode 100644 index 0000000..4a64d88 --- /dev/null +++ b/firefly-iii-api/docs/Account.md @@ -0,0 +1,41 @@ +# Account + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**active** | Option<**bool**> | If omitted, defaults to true. | [optional][default to true] +**order** | Option<**i32**> | Order of the account. Is NULL if account is not asset or liability. | [optional] +**name** | **String** | | +**r#type** | [**models::ShortAccountTypeProperty**](ShortAccountTypeProperty.md) | | +**account_role** | Option<[**models::AccountRoleProperty**](AccountRoleProperty.md)> | | [optional] +**currency_id** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**currency_code** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**currency_symbol** | Option<**String**> | | [optional][readonly] +**currency_decimal_places** | Option<**i32**> | | [optional][readonly] +**current_balance** | Option<**String**> | | [optional][readonly] +**current_balance_date** | Option<**String**> | The timestamp for this date is always 23:59:59, to indicate it's the balance at the very END of that particular day. | [optional][readonly] +**iban** | Option<**String**> | | [optional] +**bic** | Option<**String**> | | [optional] +**account_number** | Option<**String**> | | [optional] +**opening_balance** | Option<**String**> | Represents the opening balance, the initial amount this account holds. | [optional] +**current_debt** | Option<**String**> | Represents the current debt for liabilities. | [optional] +**opening_balance_date** | Option<**String**> | Represents the date of the opening balance. | [optional] +**virtual_balance** | Option<**String**> | | [optional] +**include_net_worth** | Option<**bool**> | If omitted, defaults to true. | [optional][default to true] +**credit_card_type** | Option<[**models::CreditCardTypeProperty**](CreditCardTypeProperty.md)> | | [optional] +**monthly_payment_date** | Option<**String**> | Mandatory when the account_role is ccAsset. Moment at which CC payment installments are asked for by the bank. | [optional] +**liability_type** | Option<[**models::LiabilityTypeProperty**](LiabilityTypeProperty.md)> | | [optional] +**liability_direction** | Option<[**models::LiabilityDirectionProperty**](LiabilityDirectionProperty.md)> | | [optional] +**interest** | Option<**String**> | Mandatory when type is liability. Interest percentage. | [optional] +**interest_period** | Option<[**models::InterestPeriodProperty**](InterestPeriodProperty.md)> | | [optional] +**notes** | Option<**String**> | | [optional] +**latitude** | Option<**f64**> | Latitude of the accounts's location, if applicable. Can be used to draw a map. | [optional] +**longitude** | Option<**f64**> | Latitude of the accounts's location, if applicable. Can be used to draw a map. | [optional] +**zoom_level** | Option<**i32**> | Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AccountArray.md b/firefly-iii-api/docs/AccountArray.md new file mode 100644 index 0000000..be311b1 --- /dev/null +++ b/firefly-iii-api/docs/AccountArray.md @@ -0,0 +1,12 @@ +# AccountArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](AccountRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AccountRead.md b/firefly-iii-api/docs/AccountRead.md new file mode 100644 index 0000000..f964ecc --- /dev/null +++ b/firefly-iii-api/docs/AccountRead.md @@ -0,0 +1,13 @@ +# AccountRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::Account**](Account.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AccountRoleProperty.md b/firefly-iii-api/docs/AccountRoleProperty.md new file mode 100644 index 0000000..bb63b2d --- /dev/null +++ b/firefly-iii-api/docs/AccountRoleProperty.md @@ -0,0 +1,17 @@ +# AccountRoleProperty + +## Enum Variants + +| Name | Value | +|---- | -----| +| DefaultAsset | defaultAsset | +| SharedAsset | sharedAsset | +| SavingAsset | savingAsset | +| CcAsset | ccAsset | +| CashWalletAsset | cashWalletAsset | +| Null | null | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AccountSearchFieldFilter.md b/firefly-iii-api/docs/AccountSearchFieldFilter.md new file mode 100644 index 0000000..4209a44 --- /dev/null +++ b/firefly-iii-api/docs/AccountSearchFieldFilter.md @@ -0,0 +1,16 @@ +# AccountSearchFieldFilter + +## Enum Variants + +| Name | Value | +|---- | -----| +| All | all | +| Iban | iban | +| Name | name | +| Number | number | +| Id | id | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AccountSingle.md b/firefly-iii-api/docs/AccountSingle.md new file mode 100644 index 0000000..bae77c0 --- /dev/null +++ b/firefly-iii-api/docs/AccountSingle.md @@ -0,0 +1,11 @@ +# AccountSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::AccountRead**](AccountRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AccountStore.md b/firefly-iii-api/docs/AccountStore.md new file mode 100644 index 0000000..7df82b3 --- /dev/null +++ b/firefly-iii-api/docs/AccountStore.md @@ -0,0 +1,34 @@ +# AccountStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**r#type** | [**models::ShortAccountTypeProperty**](ShortAccountTypeProperty.md) | | +**iban** | Option<**String**> | | [optional] +**bic** | Option<**String**> | | [optional] +**account_number** | Option<**String**> | | [optional] +**opening_balance** | Option<**String**> | Represents the opening balance, the initial amount this account holds. | [optional] +**opening_balance_date** | Option<**String**> | Represents the date of the opening balance. | [optional] +**virtual_balance** | Option<**String**> | | [optional] +**currency_id** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**currency_code** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**active** | Option<**bool**> | If omitted, defaults to true. | [optional][default to true] +**order** | Option<**i32**> | Order of the account | [optional] +**include_net_worth** | Option<**bool**> | If omitted, defaults to true. | [optional][default to true] +**account_role** | Option<[**models::AccountRoleProperty**](AccountRoleProperty.md)> | | [optional] +**credit_card_type** | Option<[**models::CreditCardTypeProperty**](CreditCardTypeProperty.md)> | | [optional] +**monthly_payment_date** | Option<**String**> | Mandatory when the account_role is ccAsset. Moment at which CC payment installments are asked for by the bank. | [optional] +**liability_type** | Option<[**models::LiabilityTypeProperty**](LiabilityTypeProperty.md)> | | [optional] +**liability_direction** | Option<[**models::LiabilityDirectionProperty**](LiabilityDirectionProperty.md)> | | [optional] +**interest** | Option<**String**> | Mandatory when type is liability. Interest percentage. | [optional][default to 0] +**interest_period** | Option<[**models::InterestPeriodProperty**](InterestPeriodProperty.md)> | | [optional] +**notes** | Option<**String**> | | [optional] +**latitude** | Option<**f64**> | Latitude of the accounts's location, if applicable. Can be used to draw a map. | [optional] +**longitude** | Option<**f64**> | Latitude of the accounts's location, if applicable. Can be used to draw a map. | [optional] +**zoom_level** | Option<**i32**> | Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AccountTypeFilter.md b/firefly-iii-api/docs/AccountTypeFilter.md new file mode 100644 index 0000000..f1bf466 --- /dev/null +++ b/firefly-iii-api/docs/AccountTypeFilter.md @@ -0,0 +1,32 @@ +# AccountTypeFilter + +## Enum Variants + +| Name | Value | +|---- | -----| +| All | all | +| Asset | asset | +| Cash | cash | +| Expense | expense | +| Revenue | revenue | +| Special | special | +| Hidden | hidden | +| Liability | liability | +| Liabilities | liabilities | +| DefaultAccount | Default account | +| CashAccount | Cash account | +| AssetAccount | Asset account | +| ExpenseAccount | Expense account | +| RevenueAccount | Revenue account | +| InitialBalanceAccount | Initial balance account | +| BeneficiaryAccount | Beneficiary account | +| ImportAccount | Import account | +| ReconciliationAccount | Reconciliation account | +| Loan | Loan | +| Debt | Debt | +| Mortgage | Mortgage | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AccountTypeProperty.md b/firefly-iii-api/docs/AccountTypeProperty.md new file mode 100644 index 0000000..4c9f4fa --- /dev/null +++ b/firefly-iii-api/docs/AccountTypeProperty.md @@ -0,0 +1,23 @@ +# AccountTypeProperty + +## Enum Variants + +| Name | Value | +|---- | -----| +| DefaultAccount | Default account | +| CashAccount | Cash account | +| AssetAccount | Asset account | +| ExpenseAccount | Expense account | +| RevenueAccount | Revenue account | +| InitialBalanceAccount | Initial balance account | +| BeneficiaryAccount | Beneficiary account | +| ImportAccount | Import account | +| ReconciliationAccount | Reconciliation account | +| Loan | Loan | +| Debt | Debt | +| Mortgage | Mortgage | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AccountUpdate.md b/firefly-iii-api/docs/AccountUpdate.md new file mode 100644 index 0000000..c0a90a3 --- /dev/null +++ b/firefly-iii-api/docs/AccountUpdate.md @@ -0,0 +1,32 @@ +# AccountUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**iban** | Option<**String**> | | [optional] +**bic** | Option<**String**> | | [optional] +**account_number** | Option<**String**> | | [optional] +**opening_balance** | Option<**String**> | | [optional] +**opening_balance_date** | Option<**String**> | | [optional] +**virtual_balance** | Option<**String**> | | [optional] +**currency_id** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**currency_code** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**active** | Option<**bool**> | If omitted, defaults to true. | [optional][default to true] +**order** | Option<**i32**> | Order of the account | [optional] +**include_net_worth** | Option<**bool**> | If omitted, defaults to true. | [optional][default to true] +**account_role** | Option<[**models::AccountRoleProperty**](AccountRoleProperty.md)> | | [optional] +**credit_card_type** | Option<[**models::CreditCardTypeProperty**](CreditCardTypeProperty.md)> | | [optional] +**monthly_payment_date** | Option<**String**> | Mandatory when the account_role is ccAsset. Moment at which CC payment installments are asked for by the bank. | [optional] +**liability_type** | Option<[**models::LiabilityTypeProperty**](LiabilityTypeProperty.md)> | | [optional] +**interest** | Option<**String**> | Mandatory when type is liability. Interest percentage. | [optional] +**interest_period** | Option<[**models::InterestPeriodProperty**](InterestPeriodProperty.md)> | | [optional] +**notes** | Option<**String**> | | [optional] +**latitude** | Option<**f64**> | Latitude of the account's location, if applicable. Can be used to draw a map. If omitted, the existing location will be kept. If submitted as NULL, the current location will be removed. | [optional] +**longitude** | Option<**f64**> | Latitude of the account's location, if applicable. Can be used to draw a map. If omitted, the existing location will be kept. If submitted as NULL, the current location will be removed. | [optional] +**zoom_level** | Option<**i32**> | Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. If omitted, the existing location will be kept. If submitted as NULL, the current location will be removed. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AccountsApi.md b/firefly-iii-api/docs/AccountsApi.md new file mode 100644 index 0000000..5b62f6e --- /dev/null +++ b/firefly-iii-api/docs/AccountsApi.md @@ -0,0 +1,278 @@ +# \AccountsApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_account**](AccountsApi.md#delete_account) | **DELETE** /v1/accounts/{id} | Permanently delete account. +[**get_account**](AccountsApi.md#get_account) | **GET** /v1/accounts/{id} | Get single account. +[**list_account**](AccountsApi.md#list_account) | **GET** /v1/accounts | List all accounts. +[**list_attachment_by_account**](AccountsApi.md#list_attachment_by_account) | **GET** /v1/accounts/{id}/attachments | Lists all attachments. +[**list_piggy_bank_by_account**](AccountsApi.md#list_piggy_bank_by_account) | **GET** /v1/accounts/{id}/piggy-banks | List all piggy banks related to the account. +[**list_transaction_by_account**](AccountsApi.md#list_transaction_by_account) | **GET** /v1/accounts/{id}/transactions | List all transactions related to the account. +[**store_account**](AccountsApi.md#store_account) | **POST** /v1/accounts | Create new account. +[**update_account**](AccountsApi.md#update_account) | **PUT** /v1/accounts/{id} | Update existing account. + + + +## delete_account + +> delete_account(id, x_trace_id) +Permanently delete account. + +Will permanently delete an account. Any associated transactions and piggy banks are ALSO deleted. Cannot be recovered from. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the account. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_account + +> models::AccountSingle get_account(id, x_trace_id, date) +Get single account. + +Returns a single account by its ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the account. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**date** | Option<**String**> | A date formatted YYYY-MM-DD. When added to the request, Firefly III will show the account's balance on that day. | | + +### Return type + +[**models::AccountSingle**](AccountSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_account + +> models::AccountArray list_account(x_trace_id, limit, page, date, r#type) +List all accounts. + +This endpoint returns a list of all the accounts owned by the authenticated user. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**date** | Option<**String**> | A date formatted YYYY-MM-DD. When added to the request, Firefly III will show the account's balance on that day. | | +**r#type** | Option<[**AccountTypeFilter**](.md)> | Optional filter on the account type(s) returned | | + +### Return type + +[**models::AccountArray**](AccountArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_attachment_by_account + +> models::AttachmentArray list_attachment_by_account(id, x_trace_id, limit, page) +Lists all attachments. + +Lists all attachments. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the account. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::AttachmentArray**](AttachmentArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_piggy_bank_by_account + +> models::PiggyBankArray list_piggy_bank_by_account(id, x_trace_id, limit, page) +List all piggy banks related to the account. + +This endpoint returns a list of all the piggy banks connected to the account. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the account. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::PiggyBankArray**](PiggyBankArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_transaction_by_account + +> models::TransactionArray list_transaction_by_account(id, x_trace_id, limit, page, start, end, r#type) +List all transactions related to the account. + +This endpoint returns a list of all the transactions connected to the account. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the account. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD. | | +**r#type** | Option<[**TransactionTypeFilter**](.md)> | Optional filter on the transaction type(s) returned. | | + +### Return type + +[**models::TransactionArray**](TransactionArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_account + +> models::AccountSingle store_account(account_store, x_trace_id) +Create new account. + +Creates a new account. The data required can be submitted as a JSON body or as a list of parameters (in key=value pairs, like a webform). + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**account_store** | [**AccountStore**](AccountStore.md) | JSON array with the necessary account information or key=value pairs. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::AccountSingle**](AccountSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_account + +> models::AccountSingle update_account(id, account_update, x_trace_id) +Update existing account. + +Used to update a single account. All fields that are not submitted will be cleared (set to NULL). The model will tell you which fields are mandatory. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the account. | [required] | +**account_update** | [**AccountUpdate**](AccountUpdate.md) | JSON array or formdata with updated account information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::AccountSingle**](AccountSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/AttachableType.md b/firefly-iii-api/docs/AttachableType.md new file mode 100644 index 0000000..83bea1b --- /dev/null +++ b/firefly-iii-api/docs/AttachableType.md @@ -0,0 +1,17 @@ +# AttachableType + +## Enum Variants + +| Name | Value | +|---- | -----| +| Account | Account | +| Budget | Budget | +| Bill | Bill | +| TransactionJournal | TransactionJournal | +| PiggyBank | PiggyBank | +| Tag | Tag | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/Attachment.md b/firefly-iii-api/docs/Attachment.md new file mode 100644 index 0000000..305cfa7 --- /dev/null +++ b/firefly-iii-api/docs/Attachment.md @@ -0,0 +1,22 @@ +# Attachment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**attachable_type** | [**models::AttachableType**](AttachableType.md) | | +**attachable_id** | **String** | ID of the model this attachment is linked to. | +**md5** | Option<**String**> | MD5 hash of the file for basic duplicate detection. | [optional] +**filename** | **String** | | +**download_url** | Option<**String**> | | [optional] +**upload_url** | Option<**String**> | | [optional] +**title** | Option<**String**> | | [optional] +**notes** | Option<**String**> | | [optional] +**mime** | Option<**String**> | | [optional][readonly] +**size** | Option<**i32**> | | [optional][readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AttachmentArray.md b/firefly-iii-api/docs/AttachmentArray.md new file mode 100644 index 0000000..7356cb9 --- /dev/null +++ b/firefly-iii-api/docs/AttachmentArray.md @@ -0,0 +1,12 @@ +# AttachmentArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](AttachmentRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AttachmentRead.md b/firefly-iii-api/docs/AttachmentRead.md new file mode 100644 index 0000000..7209b83 --- /dev/null +++ b/firefly-iii-api/docs/AttachmentRead.md @@ -0,0 +1,14 @@ +# AttachmentRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::Attachment**](Attachment.md) | | +**links** | [**models::ObjectLink**](ObjectLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AttachmentSingle.md b/firefly-iii-api/docs/AttachmentSingle.md new file mode 100644 index 0000000..71068fd --- /dev/null +++ b/firefly-iii-api/docs/AttachmentSingle.md @@ -0,0 +1,11 @@ +# AttachmentSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::AttachmentRead**](AttachmentRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AttachmentStore.md b/firefly-iii-api/docs/AttachmentStore.md new file mode 100644 index 0000000..e38684d --- /dev/null +++ b/firefly-iii-api/docs/AttachmentStore.md @@ -0,0 +1,15 @@ +# AttachmentStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filename** | **String** | | +**attachable_type** | [**models::AttachableType**](AttachableType.md) | | +**attachable_id** | **String** | ID of the model this attachment is linked to. | +**title** | Option<**String**> | | [optional] +**notes** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AttachmentUpdate.md b/firefly-iii-api/docs/AttachmentUpdate.md new file mode 100644 index 0000000..e968a19 --- /dev/null +++ b/firefly-iii-api/docs/AttachmentUpdate.md @@ -0,0 +1,13 @@ +# AttachmentUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filename** | Option<**String**> | | [optional] +**title** | Option<**String**> | | [optional] +**notes** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AttachmentsApi.md b/firefly-iii-api/docs/AttachmentsApi.md new file mode 100644 index 0000000..f05e706 --- /dev/null +++ b/firefly-iii-api/docs/AttachmentsApi.md @@ -0,0 +1,235 @@ +# \AttachmentsApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_attachment**](AttachmentsApi.md#delete_attachment) | **DELETE** /v1/attachments/{id} | Delete an attachment. +[**download_attachment**](AttachmentsApi.md#download_attachment) | **GET** /v1/attachments/{id}/download | Download a single attachment. +[**get_attachment**](AttachmentsApi.md#get_attachment) | **GET** /v1/attachments/{id} | Get a single attachment. +[**list_attachment**](AttachmentsApi.md#list_attachment) | **GET** /v1/attachments | List all attachments. +[**store_attachment**](AttachmentsApi.md#store_attachment) | **POST** /v1/attachments | Store a new attachment. +[**update_attachment**](AttachmentsApi.md#update_attachment) | **PUT** /v1/attachments/{id} | Update existing attachment. +[**upload_attachment**](AttachmentsApi.md#upload_attachment) | **POST** /v1/attachments/{id}/upload | Upload an attachment. + + + +## delete_attachment + +> delete_attachment(id, x_trace_id) +Delete an attachment. + +With this endpoint you delete an attachment, including any stored file data. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the single attachment. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## download_attachment + +> std::path::PathBuf download_attachment(id, x_trace_id) +Download a single attachment. + +This endpoint allows you to download the binary content of a transaction. It will be sent to you as a download, using the content type \"application/octet-stream\" and content disposition \"attachment; filename=example.pdf\". + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the attachment. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**std::path::PathBuf**](std::path::PathBuf.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_attachment + +> models::AttachmentSingle get_attachment(id, x_trace_id) +Get a single attachment. + +Get a single attachment. This endpoint only returns the available metadata for the attachment. Actual file data is handled in two other endpoints (see below). + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the attachment. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::AttachmentSingle**](AttachmentSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_attachment + +> models::AttachmentArray list_attachment(x_trace_id, limit, page) +List all attachments. + +This endpoint lists all attachments. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::AttachmentArray**](AttachmentArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_attachment + +> models::AttachmentSingle store_attachment(attachment_store, x_trace_id) +Store a new attachment. + +Creates a new attachment. The data required can be submitted as a JSON body or as a list of parameters. You cannot use this endpoint to upload the actual file data (see below). This endpoint only creates the attachment object. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**attachment_store** | [**AttachmentStore**](AttachmentStore.md) | JSON array or key=value pairs with the necessary attachment information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::AttachmentSingle**](AttachmentSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_attachment + +> models::AttachmentSingle update_attachment(id, attachment_update, x_trace_id) +Update existing attachment. + +Update the meta data for an existing attachment. This endpoint does not allow you to upload or download data. For that, see below. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the attachment. | [required] | +**attachment_update** | [**AttachmentUpdate**](AttachmentUpdate.md) | JSON array with updated attachment information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::AttachmentSingle**](AttachmentSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## upload_attachment + +> upload_attachment(id, x_trace_id, body) +Upload an attachment. + +Use this endpoint to upload (and possible overwrite) the file contents of an attachment. Simply put the entire file in the body as binary data. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the attachment. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**body** | Option<**std::path::PathBuf**> | | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/AutoBudgetPeriod.md b/firefly-iii-api/docs/AutoBudgetPeriod.md new file mode 100644 index 0000000..8903afa --- /dev/null +++ b/firefly-iii-api/docs/AutoBudgetPeriod.md @@ -0,0 +1,18 @@ +# AutoBudgetPeriod + +## Enum Variants + +| Name | Value | +|---- | -----| +| Daily | daily | +| Weekly | weekly | +| Monthly | monthly | +| Quarterly | quarterly | +| HalfYear | half-year | +| Yearly | yearly | +| Null | null | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutoBudgetType.md b/firefly-iii-api/docs/AutoBudgetType.md new file mode 100644 index 0000000..155e458 --- /dev/null +++ b/firefly-iii-api/docs/AutoBudgetType.md @@ -0,0 +1,15 @@ +# AutoBudgetType + +## Enum Variants + +| Name | Value | +|---- | -----| +| Reset | reset | +| Rollover | rollover | +| None | none | +| Null | null | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompleteAccount.md b/firefly-iii-api/docs/AutocompleteAccount.md new file mode 100644 index 0000000..69449bc --- /dev/null +++ b/firefly-iii-api/docs/AutocompleteAccount.md @@ -0,0 +1,19 @@ +# AutocompleteAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | Name of the account found by an auto-complete search. | +**name_with_balance** | **String** | Asset accounts and liabilities have a second field with the given date's account balance. | +**r#type** | **String** | Account type of the account found by the auto-complete search. | +**currency_id** | **String** | ID for the currency used by this account. | +**currency_name** | **String** | Currency name for the currency used by this account. | +**currency_code** | **String** | Currency code for the currency used by this account. | +**currency_symbol** | **String** | Currency symbol for the currency used by this account. | +**currency_decimal_places** | **i32** | Number of decimal places for the currency used by this account. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompleteApi.md b/firefly-iii-api/docs/AutocompleteApi.md new file mode 100644 index 0000000..19cfab7 --- /dev/null +++ b/firefly-iii-api/docs/AutocompleteApi.md @@ -0,0 +1,506 @@ +# \AutocompleteApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_accounts_ac**](AutocompleteApi.md#get_accounts_ac) | **GET** /v1/autocomplete/accounts | Returns all accounts of the user returned in a basic auto-complete array. +[**get_bills_ac**](AutocompleteApi.md#get_bills_ac) | **GET** /v1/autocomplete/bills | Returns all bills of the user returned in a basic auto-complete array. +[**get_budgets_ac**](AutocompleteApi.md#get_budgets_ac) | **GET** /v1/autocomplete/budgets | Returns all budgets of the user returned in a basic auto-complete array. +[**get_categories_ac**](AutocompleteApi.md#get_categories_ac) | **GET** /v1/autocomplete/categories | Returns all categories of the user returned in a basic auto-complete array. +[**get_currencies_ac**](AutocompleteApi.md#get_currencies_ac) | **GET** /v1/autocomplete/currencies | Returns all currencies of the user returned in a basic auto-complete array. +[**get_currencies_code_ac**](AutocompleteApi.md#get_currencies_code_ac) | **GET** /v1/autocomplete/currencies-with-code | Returns all currencies of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it. +[**get_object_groups_ac**](AutocompleteApi.md#get_object_groups_ac) | **GET** /v1/autocomplete/object-groups | Returns all object groups of the user returned in a basic auto-complete array. +[**get_piggies_ac**](AutocompleteApi.md#get_piggies_ac) | **GET** /v1/autocomplete/piggy-banks | Returns all piggy banks of the user returned in a basic auto-complete array. +[**get_piggies_balance_ac**](AutocompleteApi.md#get_piggies_balance_ac) | **GET** /v1/autocomplete/piggy-banks-with-balance | Returns all piggy banks of the user returned in a basic auto-complete array complemented with balance information. +[**get_recurring_ac**](AutocompleteApi.md#get_recurring_ac) | **GET** /v1/autocomplete/recurring | Returns all recurring transactions of the user returned in a basic auto-complete array. +[**get_rule_groups_ac**](AutocompleteApi.md#get_rule_groups_ac) | **GET** /v1/autocomplete/rule-groups | Returns all rule groups of the user returned in a basic auto-complete array. +[**get_rules_ac**](AutocompleteApi.md#get_rules_ac) | **GET** /v1/autocomplete/rules | Returns all rules of the user returned in a basic auto-complete array. +[**get_tag_ac**](AutocompleteApi.md#get_tag_ac) | **GET** /v1/autocomplete/tags | Returns all tags of the user returned in a basic auto-complete array. +[**get_transaction_types_ac**](AutocompleteApi.md#get_transaction_types_ac) | **GET** /v1/autocomplete/transaction-types | Returns all transaction types returned in a basic auto-complete array. English only. +[**get_transactions_ac**](AutocompleteApi.md#get_transactions_ac) | **GET** /v1/autocomplete/transactions | Returns all transaction descriptions of the user returned in a basic auto-complete array. +[**get_transactions_idac**](AutocompleteApi.md#get_transactions_idac) | **GET** /v1/autocomplete/transactions-with-id | Returns all transactions, complemented with their ID, of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it. + + + +## get_accounts_ac + +> Vec get_accounts_ac(x_trace_id, query, limit, date, types) +Returns all accounts of the user returned in a basic auto-complete array. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | +**date** | Option<**String**> | If the account is an asset account or a liability, the autocomplete will also return the balance of the account on this date. | | +**types** | Option<[**Vec**](models::AccountTypeFilter.md)> | Optional filter on the account type(s) used in the autocomplete. | | + +### Return type + +[**Vec**](AutocompleteAccount.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_bills_ac + +> Vec get_bills_ac(x_trace_id, query, limit) +Returns all bills of the user returned in a basic auto-complete array. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | + +### Return type + +[**Vec**](AutocompleteBill.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_budgets_ac + +> Vec get_budgets_ac(x_trace_id, query, limit) +Returns all budgets of the user returned in a basic auto-complete array. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | + +### Return type + +[**Vec**](AutocompleteBudget.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_categories_ac + +> Vec get_categories_ac(x_trace_id, query, limit) +Returns all categories of the user returned in a basic auto-complete array. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | + +### Return type + +[**Vec**](AutocompleteCategory.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_currencies_ac + +> Vec get_currencies_ac(x_trace_id, query, limit) +Returns all currencies of the user returned in a basic auto-complete array. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | + +### Return type + +[**Vec**](AutocompleteCurrency.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_currencies_code_ac + +> Vec get_currencies_code_ac(x_trace_id, query, limit) +Returns all currencies of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | + +### Return type + +[**Vec**](AutocompleteCurrencyCode.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_object_groups_ac + +> Vec get_object_groups_ac(x_trace_id, query, limit) +Returns all object groups of the user returned in a basic auto-complete array. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | + +### Return type + +[**Vec**](AutocompleteObjectGroup.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_piggies_ac + +> Vec get_piggies_ac(x_trace_id, query, limit) +Returns all piggy banks of the user returned in a basic auto-complete array. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | + +### Return type + +[**Vec**](AutocompletePiggy.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_piggies_balance_ac + +> Vec get_piggies_balance_ac(x_trace_id, query, limit) +Returns all piggy banks of the user returned in a basic auto-complete array complemented with balance information. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | + +### Return type + +[**Vec**](AutocompletePiggyBalance.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_recurring_ac + +> Vec get_recurring_ac(x_trace_id, query, limit) +Returns all recurring transactions of the user returned in a basic auto-complete array. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | + +### Return type + +[**Vec**](AutocompleteRecurrence.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_rule_groups_ac + +> Vec get_rule_groups_ac(x_trace_id, query, limit) +Returns all rule groups of the user returned in a basic auto-complete array. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | + +### Return type + +[**Vec**](AutocompleteRuleGroup.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_rules_ac + +> Vec get_rules_ac(x_trace_id, query, limit) +Returns all rules of the user returned in a basic auto-complete array. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | + +### Return type + +[**Vec**](AutocompleteRule.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_tag_ac + +> Vec get_tag_ac(x_trace_id, query, limit) +Returns all tags of the user returned in a basic auto-complete array. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | + +### Return type + +[**Vec**](AutocompleteTag.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_transaction_types_ac + +> Vec get_transaction_types_ac(x_trace_id, query, limit) +Returns all transaction types returned in a basic auto-complete array. English only. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | + +### Return type + +[**Vec**](AutocompleteTransactionType.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_transactions_ac + +> Vec get_transactions_ac(x_trace_id, query, limit) +Returns all transaction descriptions of the user returned in a basic auto-complete array. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | + +### Return type + +[**Vec**](AutocompleteTransaction.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_transactions_idac + +> Vec get_transactions_idac(x_trace_id, query, limit) +Returns all transactions, complemented with their ID, of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**query** | Option<**String**> | The autocomplete search query. | | +**limit** | Option<**i32**> | The number of items returned. | | + +### Return type + +[**Vec**](AutocompleteTransactionID.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/AutocompleteBill.md b/firefly-iii-api/docs/AutocompleteBill.md new file mode 100644 index 0000000..f7123df --- /dev/null +++ b/firefly-iii-api/docs/AutocompleteBill.md @@ -0,0 +1,13 @@ +# AutocompleteBill + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | Name of the bill found by an auto-complete search. | +**active** | Option<**bool**> | Is the bill active or not? | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompleteBudget.md b/firefly-iii-api/docs/AutocompleteBudget.md new file mode 100644 index 0000000..ccdb83d --- /dev/null +++ b/firefly-iii-api/docs/AutocompleteBudget.md @@ -0,0 +1,12 @@ +# AutocompleteBudget + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | Name of the budget found by an auto-complete search. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompleteCategory.md b/firefly-iii-api/docs/AutocompleteCategory.md new file mode 100644 index 0000000..a1fcf48 --- /dev/null +++ b/firefly-iii-api/docs/AutocompleteCategory.md @@ -0,0 +1,12 @@ +# AutocompleteCategory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | Name of the category found by an auto-complete search. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompleteCurrency.md b/firefly-iii-api/docs/AutocompleteCurrency.md new file mode 100644 index 0000000..7b5ca76 --- /dev/null +++ b/firefly-iii-api/docs/AutocompleteCurrency.md @@ -0,0 +1,15 @@ +# AutocompleteCurrency + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | Currency name. | +**code** | **String** | Currency code. | +**symbol** | **String** | | +**decimal_places** | **i32** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompleteCurrencyCode.md b/firefly-iii-api/docs/AutocompleteCurrencyCode.md new file mode 100644 index 0000000..a6b519e --- /dev/null +++ b/firefly-iii-api/docs/AutocompleteCurrencyCode.md @@ -0,0 +1,15 @@ +# AutocompleteCurrencyCode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | Currency name with the code between brackets. | +**code** | **String** | Currency code. | +**symbol** | **String** | | +**decimal_places** | **i32** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompleteObjectGroup.md b/firefly-iii-api/docs/AutocompleteObjectGroup.md new file mode 100644 index 0000000..12ec831 --- /dev/null +++ b/firefly-iii-api/docs/AutocompleteObjectGroup.md @@ -0,0 +1,13 @@ +# AutocompleteObjectGroup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**title** | **String** | Title of the object group found by an auto-complete search. | +**name** | **String** | Title of the object group found by an auto-complete search. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompletePiggy.md b/firefly-iii-api/docs/AutocompletePiggy.md new file mode 100644 index 0000000..e04a796 --- /dev/null +++ b/firefly-iii-api/docs/AutocompletePiggy.md @@ -0,0 +1,19 @@ +# AutocompletePiggy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | Name of the piggy bank found by an auto-complete search. | +**currency_id** | Option<**String**> | Currency ID for this piggy bank. | [optional] +**currency_code** | Option<**String**> | Currency code for this piggy bank. | [optional] +**currency_symbol** | Option<**String**> | | [optional] +**currency_name** | Option<**String**> | Currency name for the currency used by this account. | [optional] +**currency_decimal_places** | Option<**i32**> | | [optional] +**object_group_id** | Option<**String**> | The group ID of the group this object is part of. NULL if no group. | [optional] +**object_group_title** | Option<**String**> | The name of the group. NULL if no group. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompletePiggyBalance.md b/firefly-iii-api/docs/AutocompletePiggyBalance.md new file mode 100644 index 0000000..1de593e --- /dev/null +++ b/firefly-iii-api/docs/AutocompletePiggyBalance.md @@ -0,0 +1,19 @@ +# AutocompletePiggyBalance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | Name of the piggy bank found by an auto-complete search. | +**name_with_balance** | Option<**String**> | Name of the piggy bank found by an auto-complete search with the current balance formatted nicely. | [optional] +**currency_id** | Option<**String**> | Currency ID for this piggy bank. | [optional] +**currency_code** | Option<**String**> | Currency code for this piggy bank. | [optional] +**currency_symbol** | Option<**String**> | | [optional] +**currency_decimal_places** | Option<**i32**> | | [optional] +**object_group_id** | Option<**String**> | The group ID of the group this object is part of. NULL if no group. | [optional] +**object_group_title** | Option<**String**> | The name of the group. NULL if no group. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompleteRecurrence.md b/firefly-iii-api/docs/AutocompleteRecurrence.md new file mode 100644 index 0000000..924125b --- /dev/null +++ b/firefly-iii-api/docs/AutocompleteRecurrence.md @@ -0,0 +1,13 @@ +# AutocompleteRecurrence + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | Name of the recurrence found by an auto-complete search. | +**description** | Option<**String**> | Description of the recurrence found by auto-complete. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompleteRule.md b/firefly-iii-api/docs/AutocompleteRule.md new file mode 100644 index 0000000..a077632 --- /dev/null +++ b/firefly-iii-api/docs/AutocompleteRule.md @@ -0,0 +1,13 @@ +# AutocompleteRule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | Name of the rule found by an auto-complete search. | +**description** | Option<**String**> | Description of the rule found by auto-complete. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompleteRuleGroup.md b/firefly-iii-api/docs/AutocompleteRuleGroup.md new file mode 100644 index 0000000..4dc6c05 --- /dev/null +++ b/firefly-iii-api/docs/AutocompleteRuleGroup.md @@ -0,0 +1,13 @@ +# AutocompleteRuleGroup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | Name of the rule group found by an auto-complete search. | +**description** | Option<**String**> | Description of the rule group found by auto-complete. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompleteTag.md b/firefly-iii-api/docs/AutocompleteTag.md new file mode 100644 index 0000000..848a6a9 --- /dev/null +++ b/firefly-iii-api/docs/AutocompleteTag.md @@ -0,0 +1,13 @@ +# AutocompleteTag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | Name of the tag found by an auto-complete search. | +**tag** | **String** | Name of the tag found by an auto-complete search. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompleteTransaction.md b/firefly-iii-api/docs/AutocompleteTransaction.md new file mode 100644 index 0000000..07ca455 --- /dev/null +++ b/firefly-iii-api/docs/AutocompleteTransaction.md @@ -0,0 +1,14 @@ +# AutocompleteTransaction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | The ID of a transaction journal (basically a single split). | +**transaction_group_id** | Option<**String**> | The ID of the underlying transaction group. | [optional] +**name** | **String** | Transaction description | +**description** | **String** | Transaction description | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompleteTransactionId.md b/firefly-iii-api/docs/AutocompleteTransactionId.md new file mode 100644 index 0000000..cb3b649 --- /dev/null +++ b/firefly-iii-api/docs/AutocompleteTransactionId.md @@ -0,0 +1,14 @@ +# AutocompleteTransactionId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | The ID of a transaction journal (basically a single split). | +**transaction_group_id** | Option<**String**> | The ID of the underlying transaction group. | [optional] +**name** | **String** | Transaction description with ID in the name. | +**description** | **String** | Transaction description with ID in the name. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AutocompleteTransactionType.md b/firefly-iii-api/docs/AutocompleteTransactionType.md new file mode 100644 index 0000000..76f8536 --- /dev/null +++ b/firefly-iii-api/docs/AutocompleteTransactionType.md @@ -0,0 +1,13 @@ +# AutocompleteTransactionType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | Type of the object found by an auto-complete search. | +**r#type** | **String** | Name of the object found by an auto-complete search. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AvailableBudget.md b/firefly-iii-api/docs/AvailableBudget.md new file mode 100644 index 0000000..326b776 --- /dev/null +++ b/firefly-iii-api/docs/AvailableBudget.md @@ -0,0 +1,21 @@ +# AvailableBudget + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**currency_id** | Option<**String**> | Use either currency_id or currency_code. | [optional] +**currency_code** | Option<**String**> | Use either currency_id or currency_code. | [optional] +**currency_symbol** | Option<**String**> | | [optional][readonly] +**currency_decimal_places** | Option<**i32**> | | [optional][readonly] +**amount** | **String** | | +**start** | **String** | Start date of the available budget. | +**end** | **String** | End date of the available budget. | +**spent_in_budgets** | Option<[**Vec**](BudgetSpent.md)> | | [optional][readonly] +**spent_outside_budget** | Option<[**Vec**](BudgetSpent.md)> | | [optional][readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AvailableBudgetArray.md b/firefly-iii-api/docs/AvailableBudgetArray.md new file mode 100644 index 0000000..075c923 --- /dev/null +++ b/firefly-iii-api/docs/AvailableBudgetArray.md @@ -0,0 +1,12 @@ +# AvailableBudgetArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](AvailableBudgetRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AvailableBudgetRead.md b/firefly-iii-api/docs/AvailableBudgetRead.md new file mode 100644 index 0000000..58afb85 --- /dev/null +++ b/firefly-iii-api/docs/AvailableBudgetRead.md @@ -0,0 +1,13 @@ +# AvailableBudgetRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::AvailableBudget**](AvailableBudget.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AvailableBudgetSingle.md b/firefly-iii-api/docs/AvailableBudgetSingle.md new file mode 100644 index 0000000..d1d3239 --- /dev/null +++ b/firefly-iii-api/docs/AvailableBudgetSingle.md @@ -0,0 +1,11 @@ +# AvailableBudgetSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::AvailableBudgetRead**](AvailableBudgetRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/AvailableBudgetsApi.md b/firefly-iii-api/docs/AvailableBudgetsApi.md new file mode 100644 index 0000000..3e6258c --- /dev/null +++ b/firefly-iii-api/docs/AvailableBudgetsApi.md @@ -0,0 +1,75 @@ +# \AvailableBudgetsApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_available_budget**](AvailableBudgetsApi.md#get_available_budget) | **GET** /v1/available-budgets/{id} | Get a single available budget. +[**list_available_budget**](AvailableBudgetsApi.md#list_available_budget) | **GET** /v1/available-budgets | List all available budget amounts. + + + +## get_available_budget + +> models::AvailableBudgetSingle get_available_budget(id, x_trace_id) +Get a single available budget. + +Get a single available budget, by ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the available budget. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::AvailableBudgetSingle**](AvailableBudgetSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_available_budget + +> models::AvailableBudgetArray list_available_budget(x_trace_id, limit, page, start, end) +List all available budget amounts. + +Firefly III allows users to set the amount that is available to be budgeted in so-called \"available budgets\". For example, the user could have 1200,- available to be divided during the coming month. This amount is used on the /budgets page. This endpoint returns all of these amounts and the periods for which they are set. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD. | | + +### Return type + +[**models::AvailableBudgetArray**](AvailableBudgetArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/BadRequestResponse.md b/firefly-iii-api/docs/BadRequestResponse.md new file mode 100644 index 0000000..17e114a --- /dev/null +++ b/firefly-iii-api/docs/BadRequestResponse.md @@ -0,0 +1,12 @@ +# BadRequestResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | Option<**String**> | | [optional] +**exception** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BasicSummaryEntry.md b/firefly-iii-api/docs/BasicSummaryEntry.md new file mode 100644 index 0000000..66d91fe --- /dev/null +++ b/firefly-iii-api/docs/BasicSummaryEntry.md @@ -0,0 +1,20 @@ +# BasicSummaryEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | Option<**String**> | This is a reference to the type of info shared, not influenced by translations or user preferences. The EUR value is a reference to the currency code. Possibilities are: balance-in-ABC, spent-in-ABC, earned-in-ABC, bills-paid-in-ABC, bills-unpaid-in-ABC, left-to-spend-in-ABC and net-worth-in-ABC. | [optional] +**title** | Option<**String**> | A translated title for the information shared. | [optional] +**monetary_value** | Option<**f64**> | The amount as a float. | [optional] +**currency_id** | Option<**String**> | The currency ID of the associated currency. | [optional] +**currency_code** | Option<**String**> | | [optional] +**currency_symbol** | Option<**String**> | | [optional] +**currency_decimal_places** | Option<**i32**> | Number of decimals for the associated currency. | [optional] +**value_parsed** | Option<**String**> | The amount formatted according to the users locale | [optional] +**local_icon** | Option<**String**> | Reference to a font-awesome icon without the fa- part. | [optional] +**sub_title** | Option<**String**> | A short explanation of the amounts origin. Already formatted according to the locale of the user or translated, if relevant. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/Bill.md b/firefly-iii-api/docs/Bill.md new file mode 100644 index 0000000..0fc079e --- /dev/null +++ b/firefly-iii-api/docs/Bill.md @@ -0,0 +1,34 @@ +# Bill + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**currency_id** | Option<**String**> | Use either currency_id or currency_code | [optional] +**currency_code** | Option<**String**> | Use either currency_id or currency_code | [optional] +**currency_symbol** | Option<**String**> | | [optional][readonly] +**currency_decimal_places** | Option<**i32**> | | [optional][readonly] +**name** | **String** | | +**amount_min** | **String** | | +**amount_max** | **String** | | +**date** | **String** | | +**end_date** | Option<**String**> | The date after which this bill is no longer valid or applicable | [optional] +**extension_date** | Option<**String**> | The date before which the bill must be renewed (or cancelled) | [optional] +**repeat_freq** | [**models::BillRepeatFrequency**](BillRepeatFrequency.md) | | +**skip** | Option<**i32**> | How often the bill must be skipped. 1 means a bi-monthly bill. | [optional] +**active** | Option<**bool**> | If the bill is active. | [optional] +**order** | Option<**i32**> | Order of the bill. | [optional] +**notes** | Option<**String**> | | [optional] +**next_expected_match** | Option<**String**> | When the bill is expected to be due. | [optional][readonly] +**next_expected_match_diff** | Option<**String**> | Formatted (locally) when the bill is due. | [optional][readonly] +**object_group_id** | Option<**String**> | The group ID of the group this object is part of. NULL if no group. | [optional] +**object_group_order** | Option<**i32**> | The order of the group. At least 1, for the highest sorting. | [optional][readonly] +**object_group_title** | Option<**String**> | The name of the group. NULL if no group. | [optional] +**pay_dates** | Option<**Vec**> | Array of future dates when the bill is expected to be paid. Autogenerated. | [optional][readonly] +**paid_dates** | Option<[**Vec**](Bill_paid_dates_inner.md)> | Array of past transactions when the bill was paid. | [optional][readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BillArray.md b/firefly-iii-api/docs/BillArray.md new file mode 100644 index 0000000..f8b59ad --- /dev/null +++ b/firefly-iii-api/docs/BillArray.md @@ -0,0 +1,12 @@ +# BillArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](BillRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BillPaidDatesInner.md b/firefly-iii-api/docs/BillPaidDatesInner.md new file mode 100644 index 0000000..120e849 --- /dev/null +++ b/firefly-iii-api/docs/BillPaidDatesInner.md @@ -0,0 +1,13 @@ +# BillPaidDatesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transaction_group_id** | Option<**String**> | Transaction group ID of the paid bill. | [optional][readonly] +**transaction_journal_id** | Option<**String**> | Transaction journal ID of the paid bill. | [optional][readonly] +**date** | Option<**String**> | Date the bill was paid. | [optional][readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BillRead.md b/firefly-iii-api/docs/BillRead.md new file mode 100644 index 0000000..1907a60 --- /dev/null +++ b/firefly-iii-api/docs/BillRead.md @@ -0,0 +1,13 @@ +# BillRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::Bill**](Bill.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BillRepeatFrequency.md b/firefly-iii-api/docs/BillRepeatFrequency.md new file mode 100644 index 0000000..f54f17b --- /dev/null +++ b/firefly-iii-api/docs/BillRepeatFrequency.md @@ -0,0 +1,16 @@ +# BillRepeatFrequency + +## Enum Variants + +| Name | Value | +|---- | -----| +| Weekly | weekly | +| Monthly | monthly | +| Quarterly | quarterly | +| HalfYear | half-year | +| Yearly | yearly | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BillSingle.md b/firefly-iii-api/docs/BillSingle.md new file mode 100644 index 0000000..189ff6d --- /dev/null +++ b/firefly-iii-api/docs/BillSingle.md @@ -0,0 +1,11 @@ +# BillSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::BillRead**](BillRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BillStore.md b/firefly-iii-api/docs/BillStore.md new file mode 100644 index 0000000..5ed09f1 --- /dev/null +++ b/firefly-iii-api/docs/BillStore.md @@ -0,0 +1,24 @@ +# BillStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_id** | Option<**String**> | Use either currency_id or currency_code | [optional] +**currency_code** | Option<**String**> | Use either currency_id or currency_code | [optional] +**name** | **String** | | +**amount_min** | **String** | | +**amount_max** | **String** | | +**date** | **String** | | +**end_date** | Option<**String**> | The date after which this bill is no longer valid or applicable | [optional] +**extension_date** | Option<**String**> | The date before which the bill must be renewed (or cancelled) | [optional] +**repeat_freq** | [**models::BillRepeatFrequency**](BillRepeatFrequency.md) | | +**skip** | Option<**i32**> | How often the bill must be skipped. 1 means a bi-monthly bill. | [optional] +**active** | Option<**bool**> | If the bill is active. | [optional] +**notes** | Option<**String**> | | [optional] +**object_group_id** | Option<**String**> | The group ID of the group this object is part of. NULL if no group. | [optional] +**object_group_title** | Option<**String**> | The name of the group. NULL if no group. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BillUpdate.md b/firefly-iii-api/docs/BillUpdate.md new file mode 100644 index 0000000..4b1cbf6 --- /dev/null +++ b/firefly-iii-api/docs/BillUpdate.md @@ -0,0 +1,24 @@ +# BillUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_id** | Option<**String**> | Use either currency_id or currency_code | [optional] +**currency_code** | Option<**String**> | Use either currency_id or currency_code | [optional] +**name** | **String** | | +**amount_min** | Option<**String**> | | [optional] +**amount_max** | Option<**String**> | | [optional] +**date** | Option<**String**> | | [optional] +**end_date** | Option<**String**> | The date after which this bill is no longer valid or applicable | [optional] +**extension_date** | Option<**String**> | The date before which the bill must be renewed (or cancelled) | [optional] +**repeat_freq** | Option<[**models::BillRepeatFrequency**](BillRepeatFrequency.md)> | | [optional] +**skip** | Option<**i32**> | How often the bill must be skipped. 1 means a bi-monthly bill. | [optional] +**active** | Option<**bool**> | If the bill is active. | [optional] +**notes** | Option<**String**> | | [optional] +**object_group_id** | Option<**String**> | The group ID of the group this object is part of. NULL if no group. | [optional] +**object_group_title** | Option<**String**> | The name of the group. NULL if no group. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BillsApi.md b/firefly-iii-api/docs/BillsApi.md new file mode 100644 index 0000000..6d885b8 --- /dev/null +++ b/firefly-iii-api/docs/BillsApi.md @@ -0,0 +1,277 @@ +# \BillsApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_bill**](BillsApi.md#delete_bill) | **DELETE** /v1/bills/{id} | Delete a bill. +[**get_bill**](BillsApi.md#get_bill) | **GET** /v1/bills/{id} | Get a single bill. +[**list_attachment_by_bill**](BillsApi.md#list_attachment_by_bill) | **GET** /v1/bills/{id}/attachments | List all attachments uploaded to the bill. +[**list_bill**](BillsApi.md#list_bill) | **GET** /v1/bills | List all bills. +[**list_rule_by_bill**](BillsApi.md#list_rule_by_bill) | **GET** /v1/bills/{id}/rules | List all rules associated with the bill. +[**list_transaction_by_bill**](BillsApi.md#list_transaction_by_bill) | **GET** /v1/bills/{id}/transactions | List all transactions associated with the bill. +[**store_bill**](BillsApi.md#store_bill) | **POST** /v1/bills | Store a new bill +[**update_bill**](BillsApi.md#update_bill) | **PUT** /v1/bills/{id} | Update existing bill. + + + +## delete_bill + +> delete_bill(id, x_trace_id) +Delete a bill. + +Delete a bill. This will not delete any associated rules. Will not remove associated transactions. WILL remove all associated attachments. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the bill. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_bill + +> models::BillSingle get_bill(id, x_trace_id, start, end) +Get a single bill. + +Get a single bill. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the bill. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD. If it is are added to the request, Firefly III will calculate the appropriate payment and paid dates. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD. If it is added to the request, Firefly III will calculate the appropriate payment and paid dates. | | + +### Return type + +[**models::BillSingle**](BillSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_attachment_by_bill + +> models::AttachmentArray list_attachment_by_bill(id, x_trace_id, limit, page) +List all attachments uploaded to the bill. + +This endpoint will list all attachments linked to the bill. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the bill. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::AttachmentArray**](AttachmentArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_bill + +> models::BillArray list_bill(x_trace_id, limit, page, start, end) +List all bills. + +This endpoint will list all the user's bills. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD. If it is are added to the request, Firefly III will calculate the appropriate payment and paid dates. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD. If it is added to the request, Firefly III will calculate the appropriate payment and paid dates. | | + +### Return type + +[**models::BillArray**](BillArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_rule_by_bill + +> models::RuleArray list_rule_by_bill(id, x_trace_id) +List all rules associated with the bill. + +This endpoint will list all rules that have an action to set the bill to this bill. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the bill. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::RuleArray**](RuleArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_transaction_by_bill + +> models::TransactionArray list_transaction_by_bill(id, x_trace_id, limit, page, start, end, r#type) +List all transactions associated with the bill. + +This endpoint will list all transactions linked to this bill. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the bill. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD. | | +**r#type** | Option<[**TransactionTypeFilter**](.md)> | Optional filter on the transaction type(s) returned | | + +### Return type + +[**models::TransactionArray**](TransactionArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_bill + +> models::BillSingle store_bill(bill_store, x_trace_id) +Store a new bill + +Creates a new bill. The data required can be submitted as a JSON body or as a list of parameters. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**bill_store** | [**BillStore**](BillStore.md) | JSON array or key=value pairs with the necessary bill information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::BillSingle**](BillSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_bill + +> models::BillSingle update_bill(id, bill_update, x_trace_id) +Update existing bill. + +Update existing bill. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the bill. | [required] | +**bill_update** | [**BillUpdate**](BillUpdate.md) | JSON array or key=value pairs with updated bill information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::BillSingle**](BillSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/Budget.md b/firefly-iii-api/docs/Budget.md new file mode 100644 index 0000000..e2207fa --- /dev/null +++ b/firefly-iii-api/docs/Budget.md @@ -0,0 +1,22 @@ +# Budget + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**name** | **String** | | +**active** | Option<**bool**> | | [optional] +**notes** | Option<**String**> | | [optional] +**order** | Option<**i32**> | | [optional][readonly] +**auto_budget_type** | Option<[**models::AutoBudgetType**](AutoBudgetType.md)> | | [optional] +**auto_budget_currency_id** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**auto_budget_currency_code** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**auto_budget_amount** | Option<**String**> | | [optional] +**auto_budget_period** | Option<[**models::AutoBudgetPeriod**](AutoBudgetPeriod.md)> | | [optional] +**spent** | Option<[**Vec**](BudgetSpent.md)> | Information on how much was spent in this budget. Is only filled in when the start and end date are submitted. | [optional][readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BudgetArray.md b/firefly-iii-api/docs/BudgetArray.md new file mode 100644 index 0000000..3fa16e9 --- /dev/null +++ b/firefly-iii-api/docs/BudgetArray.md @@ -0,0 +1,12 @@ +# BudgetArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](BudgetRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BudgetLimit.md b/firefly-iii-api/docs/BudgetLimit.md new file mode 100644 index 0000000..e750b07 --- /dev/null +++ b/firefly-iii-api/docs/BudgetLimit.md @@ -0,0 +1,23 @@ +# BudgetLimit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**start** | **String** | Start date of the budget limit. | +**end** | **String** | End date of the budget limit. | +**currency_id** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**currency_code** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**currency_name** | Option<**String**> | | [optional][readonly] +**currency_symbol** | Option<**String**> | | [optional][readonly] +**currency_decimal_places** | Option<**i32**> | | [optional][readonly] +**budget_id** | **String** | The budget ID of the associated budget. | [readonly] +**period** | Option<**String**> | Period of the budget limit. Only used when auto-generated by auto-budget. | [optional][readonly] +**amount** | **String** | | +**spent** | Option<**String**> | | [optional][readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BudgetLimitArray.md b/firefly-iii-api/docs/BudgetLimitArray.md new file mode 100644 index 0000000..8e452d1 --- /dev/null +++ b/firefly-iii-api/docs/BudgetLimitArray.md @@ -0,0 +1,12 @@ +# BudgetLimitArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](BudgetLimitRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BudgetLimitRead.md b/firefly-iii-api/docs/BudgetLimitRead.md new file mode 100644 index 0000000..0adf5e4 --- /dev/null +++ b/firefly-iii-api/docs/BudgetLimitRead.md @@ -0,0 +1,13 @@ +# BudgetLimitRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::BudgetLimit**](BudgetLimit.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BudgetLimitSingle.md b/firefly-iii-api/docs/BudgetLimitSingle.md new file mode 100644 index 0000000..05b1111 --- /dev/null +++ b/firefly-iii-api/docs/BudgetLimitSingle.md @@ -0,0 +1,11 @@ +# BudgetLimitSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::BudgetLimitRead**](BudgetLimitRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BudgetLimitStore.md b/firefly-iii-api/docs/BudgetLimitStore.md new file mode 100644 index 0000000..611f222 --- /dev/null +++ b/firefly-iii-api/docs/BudgetLimitStore.md @@ -0,0 +1,17 @@ +# BudgetLimitStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_id** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**currency_code** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**budget_id** | **String** | The budget ID of the associated budget. | [readonly] +**start** | [**String**](string.md) | Start date of the budget limit. | +**period** | Option<**String**> | Period of the budget limit. Only used when auto-generated by auto-budget. | [optional][readonly] +**end** | [**String**](string.md) | End date of the budget limit. | +**amount** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BudgetRead.md b/firefly-iii-api/docs/BudgetRead.md new file mode 100644 index 0000000..63c8df4 --- /dev/null +++ b/firefly-iii-api/docs/BudgetRead.md @@ -0,0 +1,13 @@ +# BudgetRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::Budget**](Budget.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BudgetSingle.md b/firefly-iii-api/docs/BudgetSingle.md new file mode 100644 index 0000000..32dabba --- /dev/null +++ b/firefly-iii-api/docs/BudgetSingle.md @@ -0,0 +1,11 @@ +# BudgetSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::BudgetRead**](BudgetRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BudgetSpent.md b/firefly-iii-api/docs/BudgetSpent.md new file mode 100644 index 0000000..206ba92 --- /dev/null +++ b/firefly-iii-api/docs/BudgetSpent.md @@ -0,0 +1,15 @@ +# BudgetSpent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sum** | Option<**String**> | The amount spent. | [optional] +**currency_id** | Option<**String**> | | [optional] +**currency_code** | Option<**String**> | | [optional] +**currency_symbol** | Option<**String**> | | [optional] +**currency_decimal_places** | Option<**i32**> | Number of decimals supported by the currency | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BudgetStore.md b/firefly-iii-api/docs/BudgetStore.md new file mode 100644 index 0000000..daa8248 --- /dev/null +++ b/firefly-iii-api/docs/BudgetStore.md @@ -0,0 +1,19 @@ +# BudgetStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**active** | Option<**bool**> | | [optional] +**order** | Option<**i32**> | | [optional][readonly] +**notes** | Option<**String**> | | [optional] +**auto_budget_type** | Option<[**models::AutoBudgetType**](AutoBudgetType.md)> | | [optional] +**auto_budget_currency_id** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**auto_budget_currency_code** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**auto_budget_amount** | Option<**String**> | | [optional] +**auto_budget_period** | Option<[**models::AutoBudgetPeriod**](AutoBudgetPeriod.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BudgetUpdate.md b/firefly-iii-api/docs/BudgetUpdate.md new file mode 100644 index 0000000..fb55992 --- /dev/null +++ b/firefly-iii-api/docs/BudgetUpdate.md @@ -0,0 +1,19 @@ +# BudgetUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**active** | Option<**bool**> | | [optional] +**order** | Option<**i32**> | | [optional] +**notes** | Option<**String**> | | [optional] +**auto_budget_type** | Option<[**models::AutoBudgetType**](AutoBudgetType.md)> | | [optional] +**auto_budget_currency_id** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**auto_budget_currency_code** | Option<**String**> | Use either currency_id or currency_code. Defaults to the user's default currency. | [optional] +**auto_budget_amount** | Option<**String**> | | [optional] +**auto_budget_period** | Option<[**models::AutoBudgetPeriod**](AutoBudgetPeriod.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/BudgetsApi.md b/firefly-iii-api/docs/BudgetsApi.md new file mode 100644 index 0000000..31c4daa --- /dev/null +++ b/firefly-iii-api/docs/BudgetsApi.md @@ -0,0 +1,479 @@ +# \BudgetsApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_budget**](BudgetsApi.md#delete_budget) | **DELETE** /v1/budgets/{id} | Delete a budget. +[**delete_budget_limit**](BudgetsApi.md#delete_budget_limit) | **DELETE** /v1/budgets/{id}/limits/{limitId} | Delete a budget limit. +[**get_budget**](BudgetsApi.md#get_budget) | **GET** /v1/budgets/{id} | Get a single budget. +[**get_budget_limit**](BudgetsApi.md#get_budget_limit) | **GET** /v1/budgets/{id}/limits/{limitId} | Get single budget limit. +[**list_attachment_by_budget**](BudgetsApi.md#list_attachment_by_budget) | **GET** /v1/budgets/{id}/attachments | Lists all attachments of a budget. +[**list_budget**](BudgetsApi.md#list_budget) | **GET** /v1/budgets | List all budgets. +[**list_budget_limit**](BudgetsApi.md#list_budget_limit) | **GET** /v1/budget-limits | Get list of budget limits by date +[**list_budget_limit_by_budget**](BudgetsApi.md#list_budget_limit_by_budget) | **GET** /v1/budgets/{id}/limits | Get all limits for a budget. +[**list_transaction_by_budget**](BudgetsApi.md#list_transaction_by_budget) | **GET** /v1/budgets/{id}/transactions | All transactions to a budget. +[**list_transaction_by_budget_limit**](BudgetsApi.md#list_transaction_by_budget_limit) | **GET** /v1/budgets/{id}/limits/{limitId}/transactions | List all transactions by a budget limit ID. +[**store_budget**](BudgetsApi.md#store_budget) | **POST** /v1/budgets | Store a new budget +[**store_budget_limit**](BudgetsApi.md#store_budget_limit) | **POST** /v1/budgets/{id}/limits | Store new budget limit. +[**update_budget**](BudgetsApi.md#update_budget) | **PUT** /v1/budgets/{id} | Update existing budget. +[**update_budget_limit**](BudgetsApi.md#update_budget_limit) | **PUT** /v1/budgets/{id}/limits/{limitId} | Update existing budget limit. + + + +## delete_budget + +> delete_budget(id, x_trace_id) +Delete a budget. + +Delete a budget. Transactions will not be deleted. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the budget. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_budget_limit + +> delete_budget_limit(id, limit_id, x_trace_id) +Delete a budget limit. + +Delete a budget limit. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the budget. The budget limit MUST be associated to the budget ID. | [required] | +**limit_id** | **String** | The ID of the budget limit. The budget limit MUST be associated to the budget ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_budget + +> models::BudgetSingle get_budget(id, x_trace_id, start, end) +Get a single budget. + +Get a single budget. If the start date and end date are submitted as well, the \"spent\" array will be updated accordingly. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the requested budget. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD, to get info on how much the user has spent. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD, to get info on how much the user has spent. | | + +### Return type + +[**models::BudgetSingle**](BudgetSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_budget_limit + +> models::BudgetLimitSingle get_budget_limit(id, limit_id, x_trace_id) +Get single budget limit. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the budget. The budget limit MUST be associated to the budget ID. | [required] | +**limit_id** | **i32** | The ID of the budget limit. The budget limit MUST be associated to the budget ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::BudgetLimitSingle**](BudgetLimitSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_attachment_by_budget + +> models::AttachmentArray list_attachment_by_budget(id, x_trace_id, limit, page) +Lists all attachments of a budget. + +Lists all attachments. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the budget. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::AttachmentArray**](AttachmentArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_budget + +> models::BudgetArray list_budget(x_trace_id, limit, page, start, end) +List all budgets. + +List all the budgets the user has made. If the start date and end date are submitted as well, the \"spent\" array will be updated accordingly. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD, to get info on how much the user has spent. You must submit both start and end. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD, to get info on how much the user has spent. You must submit both start and end. | | + +### Return type + +[**models::BudgetArray**](BudgetArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_budget_limit + +> models::BudgetLimitArray list_budget_limit(start, end, x_trace_id) +Get list of budget limits by date + +Get all budget limits for for this date range. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::BudgetLimitArray**](BudgetLimitArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_budget_limit_by_budget + +> models::BudgetLimitArray list_budget_limit_by_budget(id, x_trace_id, start, end) +Get all limits for a budget. + +Get all budget limits for this budget and the money spent, and money left. You can limit the list by submitting a date range as well. The \"spent\" array for each budget limit is NOT influenced by the start and end date of your query, but by the start and end date of the budget limit itself. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the requested budget. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD. | | + +### Return type + +[**models::BudgetLimitArray**](BudgetLimitArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_transaction_by_budget + +> models::TransactionArray list_transaction_by_budget(id, x_trace_id, limit, page, start, end, r#type) +All transactions to a budget. + +Get all transactions linked to a budget, possibly limited by start and end + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the budget. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD. | | +**r#type** | Option<[**TransactionTypeFilter**](.md)> | Optional filter on the transaction type(s) returned | | + +### Return type + +[**models::TransactionArray**](TransactionArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_transaction_by_budget_limit + +> models::TransactionArray list_transaction_by_budget_limit(id, limit_id, x_trace_id, limit, page, r#type) +List all transactions by a budget limit ID. + +List all the transactions within one budget limit. The start and end date are dictated by the budget limit. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the budget. The budget limit MUST be associated to the budget ID. | [required] | +**limit_id** | **String** | The ID of the budget limit. The budget limit MUST be associated to the budget ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**r#type** | Option<[**TransactionTypeFilter**](.md)> | Optional filter on the transaction type(s) returned | | + +### Return type + +[**models::TransactionArray**](TransactionArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_budget + +> models::BudgetSingle store_budget(budget_store, x_trace_id) +Store a new budget + +Creates a new budget. The data required can be submitted as a JSON body or as a list of parameters. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**budget_store** | [**BudgetStore**](BudgetStore.md) | JSON array or key=value pairs with the necessary budget information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::BudgetSingle**](BudgetSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_budget_limit + +> models::BudgetLimitSingle store_budget_limit(id, budget_limit_store, x_trace_id) +Store new budget limit. + +Store a new budget limit under this budget. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the budget. | [required] | +**budget_limit_store** | [**BudgetLimitStore**](BudgetLimitStore.md) | JSON array or key=value pairs with the necessary budget information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::BudgetLimitSingle**](BudgetLimitSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_budget + +> models::BudgetSingle update_budget(id, budget_update, x_trace_id) +Update existing budget. + +Update existing budget. This endpoint cannot be used to set budget amount limits. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the budget. | [required] | +**budget_update** | [**BudgetUpdate**](BudgetUpdate.md) | JSON array with updated budget information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::BudgetSingle**](BudgetSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_budget_limit + +> models::BudgetLimitSingle update_budget_limit(id, limit_id, budget_limit, x_trace_id) +Update existing budget limit. + +Update existing budget limit. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the budget. The budget limit MUST be associated to the budget ID. | [required] | +**limit_id** | **String** | The ID of the budget limit. The budget limit MUST be associated to the budget ID. | [required] | +**budget_limit** | [**BudgetLimit**](BudgetLimit.md) | JSON array with updated budget limit information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::BudgetLimitSingle**](BudgetLimitSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/CategoriesApi.md b/firefly-iii-api/docs/CategoriesApi.md new file mode 100644 index 0000000..0790610 --- /dev/null +++ b/firefly-iii-api/docs/CategoriesApi.md @@ -0,0 +1,243 @@ +# \CategoriesApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_category**](CategoriesApi.md#delete_category) | **DELETE** /v1/categories/{id} | Delete a category. +[**get_category**](CategoriesApi.md#get_category) | **GET** /v1/categories/{id} | Get a single category. +[**list_attachment_by_category**](CategoriesApi.md#list_attachment_by_category) | **GET** /v1/categories/{id}/attachments | Lists all attachments. +[**list_category**](CategoriesApi.md#list_category) | **GET** /v1/categories | List all categories. +[**list_transaction_by_category**](CategoriesApi.md#list_transaction_by_category) | **GET** /v1/categories/{id}/transactions | List all transactions in a category. +[**store_category**](CategoriesApi.md#store_category) | **POST** /v1/categories | Store a new category +[**update_category**](CategoriesApi.md#update_category) | **PUT** /v1/categories/{id} | Update existing category. + + + +## delete_category + +> delete_category(id, x_trace_id) +Delete a category. + +Delete a category. Transactions will not be removed. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the category. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_category + +> models::CategorySingle get_category(id, x_trace_id, start, end) +Get a single category. + +Get a single category. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the category. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD, to show spent and earned info. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD, to show spent and earned info. | | + +### Return type + +[**models::CategorySingle**](CategorySingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_attachment_by_category + +> models::AttachmentArray list_attachment_by_category(id, x_trace_id, limit, page) +Lists all attachments. + +Lists all attachments. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the category. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::AttachmentArray**](AttachmentArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_category + +> models::CategoryArray list_category(x_trace_id, limit, page) +List all categories. + +List all categories. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::CategoryArray**](CategoryArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_transaction_by_category + +> models::TransactionArray list_transaction_by_category(id, x_trace_id, limit, page, start, end, r#type) +List all transactions in a category. + +List all transactions in a category, optionally limited to the date ranges specified. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the category. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD, to limit the result list. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD, to limit the result list. | | +**r#type** | Option<[**TransactionTypeFilter**](.md)> | Optional filter on the transaction type(s) returned | | + +### Return type + +[**models::TransactionArray**](TransactionArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_category + +> models::CategorySingle store_category(category, x_trace_id) +Store a new category + +Creates a new category. The data required can be submitted as a JSON body or as a list of parameters. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**category** | [**Category**](Category.md) | JSON array or key=value pairs with the necessary category information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::CategorySingle**](CategorySingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_category + +> models::CategorySingle update_category(id, category_update, x_trace_id) +Update existing category. + +Update existing category. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the category. | [required] | +**category_update** | [**CategoryUpdate**](CategoryUpdate.md) | JSON array with updated category information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::CategorySingle**](CategorySingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/Category.md b/firefly-iii-api/docs/Category.md new file mode 100644 index 0000000..35d9bf4 --- /dev/null +++ b/firefly-iii-api/docs/Category.md @@ -0,0 +1,16 @@ +# Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**name** | **String** | | +**notes** | Option<**String**> | | [optional] +**spent** | Option<[**Vec**](CategorySpent.md)> | | [optional][readonly] +**earned** | Option<[**Vec**](CategoryEarned.md)> | | [optional][readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/CategoryArray.md b/firefly-iii-api/docs/CategoryArray.md new file mode 100644 index 0000000..7c7c6f5 --- /dev/null +++ b/firefly-iii-api/docs/CategoryArray.md @@ -0,0 +1,12 @@ +# CategoryArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](CategoryRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/CategoryEarned.md b/firefly-iii-api/docs/CategoryEarned.md new file mode 100644 index 0000000..021b46b --- /dev/null +++ b/firefly-iii-api/docs/CategoryEarned.md @@ -0,0 +1,15 @@ +# CategoryEarned + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_id** | Option<**String**> | | [optional] +**currency_code** | Option<**String**> | | [optional] +**currency_symbol** | Option<**String**> | | [optional] +**currency_decimal_places** | Option<**i32**> | Number of decimals supported by the currency | [optional] +**sum** | Option<**String**> | The amount earned. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/CategoryRead.md b/firefly-iii-api/docs/CategoryRead.md new file mode 100644 index 0000000..cdae048 --- /dev/null +++ b/firefly-iii-api/docs/CategoryRead.md @@ -0,0 +1,13 @@ +# CategoryRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::Category**](Category.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/CategorySingle.md b/firefly-iii-api/docs/CategorySingle.md new file mode 100644 index 0000000..65e3e23 --- /dev/null +++ b/firefly-iii-api/docs/CategorySingle.md @@ -0,0 +1,11 @@ +# CategorySingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::CategoryRead**](CategoryRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/CategorySpent.md b/firefly-iii-api/docs/CategorySpent.md new file mode 100644 index 0000000..7f64716 --- /dev/null +++ b/firefly-iii-api/docs/CategorySpent.md @@ -0,0 +1,15 @@ +# CategorySpent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_id** | Option<**String**> | | [optional] +**currency_code** | Option<**String**> | | [optional] +**currency_symbol** | Option<**String**> | | [optional] +**currency_decimal_places** | Option<**i32**> | Number of decimals supported by the currency | [optional] +**sum** | Option<**String**> | The amount spent. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/CategoryUpdate.md b/firefly-iii-api/docs/CategoryUpdate.md new file mode 100644 index 0000000..934ed97 --- /dev/null +++ b/firefly-iii-api/docs/CategoryUpdate.md @@ -0,0 +1,12 @@ +# CategoryUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**notes** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/ChartDataPoint.md b/firefly-iii-api/docs/ChartDataPoint.md new file mode 100644 index 0000000..13215b2 --- /dev/null +++ b/firefly-iii-api/docs/ChartDataPoint.md @@ -0,0 +1,11 @@ +# ChartDataPoint + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | Option<**String**> | The key is the label of the value, so for example: '2018-01-01' => 13 or 'Groceries' => -123. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/ChartDataSet.md b/firefly-iii-api/docs/ChartDataSet.md new file mode 100644 index 0000000..9021cde --- /dev/null +++ b/firefly-iii-api/docs/ChartDataSet.md @@ -0,0 +1,20 @@ +# ChartDataSet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | Option<**String**> | This is the title of the current set. It can refer to an account, a budget or another object (by name). | [optional] +**currency_id** | Option<**String**> | The currency ID of the currency associated to the data in the entries. | [optional] +**currency_code** | Option<**String**> | | [optional] +**currency_symbol** | Option<**String**> | | [optional] +**currency_decimal_places** | Option<**i32**> | Number of decimals for the currency associated to the data in the entries. | [optional] +**start_date** | Option<**String**> | | [optional] +**end_date** | Option<**String**> | | [optional] +**r#type** | Option<**String**> | Indicated the type of chart that is expected to be rendered. You can safely ignore this if you want. | [optional] +**y_axis_id** | Option<**i32**> | Used to indicate the Y axis for this data set. Is usually between 0 and 1 (left and right side of the chart). | [optional] +**entries** | Option<[**Vec**](ChartDataPoint.md)> | The actual entries for this data set. They 'key' value is the label for the data point. The value is the actual (numerical) value. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/ChartsApi.md b/firefly-iii-api/docs/ChartsApi.md new file mode 100644 index 0000000..54cc68a --- /dev/null +++ b/firefly-iii-api/docs/ChartsApi.md @@ -0,0 +1,41 @@ +# \ChartsApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_chart_account_overview**](ChartsApi.md#get_chart_account_overview) | **GET** /v1/chart/account/overview | Dashboard chart with asset account balance information. + + + +## get_chart_account_overview + +> Vec get_chart_account_overview(start, end, x_trace_id) +Dashboard chart with asset account balance information. + +This endpoint returns the data required to generate a chart with basic asset account balance information. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**Vec**](ChartDataSet.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/ConfigValueFilter.md b/firefly-iii-api/docs/ConfigValueFilter.md new file mode 100644 index 0000000..d7d106e --- /dev/null +++ b/firefly-iii-api/docs/ConfigValueFilter.md @@ -0,0 +1,30 @@ +# ConfigValueFilter + +## Enum Variants + +| Name | Value | +|---- | -----| +| ConfigurationPeriodIsDemoSite | configuration.is_demo_site | +| ConfigurationPeriodPermissionUpdateCheck | configuration.permission_update_check | +| ConfigurationPeriodLastUpdateCheck | configuration.last_update_check | +| ConfigurationPeriodSingleUserMode | configuration.single_user_mode | +| FireflyPeriodVersion | firefly.version | +| FireflyPeriodApiVersion | firefly.api_version | +| FireflyPeriodDefaultLocation | firefly.default_location | +| FireflyPeriodAccountToTransaction | firefly.account_to_transaction | +| FireflyPeriodAllowedOpposingTypes | firefly.allowed_opposing_types | +| FireflyPeriodAccountRoles | firefly.accountRoles | +| FireflyPeriodValidLiabilities | firefly.valid_liabilities | +| FireflyPeriodInterestPeriods | firefly.interest_periods | +| FireflyPeriodEnableExternalMap | firefly.enable_external_map | +| FireflyPeriodExpectedSourceTypes | firefly.expected_source_types | +| AppPeriodTimezone | app.timezone | +| FireflyPeriodBillPeriods | firefly.bill_periods | +| FireflyPeriodCreditCardTypes | firefly.credit_card_types | +| FireflyPeriodLanguages | firefly.languages | +| FireflyPeriodValidViewRanges | firefly.valid_view_ranges | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/ConfigValueUpdateFilter.md b/firefly-iii-api/docs/ConfigValueUpdateFilter.md new file mode 100644 index 0000000..3efaa3b --- /dev/null +++ b/firefly-iii-api/docs/ConfigValueUpdateFilter.md @@ -0,0 +1,15 @@ +# ConfigValueUpdateFilter + +## Enum Variants + +| Name | Value | +|---- | -----| +| IsDemoSite | configuration.is_demo_site | +| PermissionUpdateCheck | configuration.permission_update_check | +| LastUpdateCheck | configuration.last_update_check | +| SingleUserMode | configuration.single_user_mode | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/Configuration.md b/firefly-iii-api/docs/Configuration.md new file mode 100644 index 0000000..25f2219 --- /dev/null +++ b/firefly-iii-api/docs/Configuration.md @@ -0,0 +1,13 @@ +# Configuration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | [**models::ConfigValueFilter**](ConfigValueFilter.md) | | +**value** | [**models::PolymorphicProperty**](PolymorphicProperty.md) | | +**editable** | **bool** | If this config variable can be edited by the user | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/ConfigurationApi.md b/firefly-iii-api/docs/ConfigurationApi.md new file mode 100644 index 0000000..00b9a7b --- /dev/null +++ b/firefly-iii-api/docs/ConfigurationApi.md @@ -0,0 +1,104 @@ +# \ConfigurationApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_configuration**](ConfigurationApi.md#get_configuration) | **GET** /v1/configuration | Get Firefly III system configuration values. +[**get_single_configuration**](ConfigurationApi.md#get_single_configuration) | **GET** /v1/configuration/{name} | Get a single Firefly III system configuration value +[**set_configuration**](ConfigurationApi.md#set_configuration) | **PUT** /v1/configuration/{name} | Update configuration value + + + +## get_configuration + +> Vec get_configuration(x_trace_id) +Get Firefly III system configuration values. + +Returns all editable and not-editable configuration values for this Firefly III installation + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**Vec**](Configuration.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/x-www-form-urlencoded + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_single_configuration + +> models::ConfigurationSingle get_single_configuration(name, x_trace_id) +Get a single Firefly III system configuration value + +Returns one configuration variable for this Firefly III installation + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**name** | [**ConfigValueFilter**](.md) | The name of the configuration value you want to know. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::ConfigurationSingle**](ConfigurationSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## set_configuration + +> models::ConfigurationSingle set_configuration(name, value, x_trace_id) +Update configuration value + +Set a single configuration value. Not all configuration values can be updated so the list of accepted configuration variables is small. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**name** | [**ConfigValueUpdateFilter**](.md) | The name of the configuration value you want to update. | [required] | +**value** | [**models::PolymorphicProperty**](PolymorphicProperty.md) | | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::ConfigurationSingle**](ConfigurationSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded, application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/ConfigurationSingle.md b/firefly-iii-api/docs/ConfigurationSingle.md new file mode 100644 index 0000000..d957cb1 --- /dev/null +++ b/firefly-iii-api/docs/ConfigurationSingle.md @@ -0,0 +1,11 @@ +# ConfigurationSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::Configuration**](Configuration.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/ConfigurationUpdate.md b/firefly-iii-api/docs/ConfigurationUpdate.md new file mode 100644 index 0000000..eaafcb6 --- /dev/null +++ b/firefly-iii-api/docs/ConfigurationUpdate.md @@ -0,0 +1,11 @@ +# ConfigurationUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**models::PolymorphicProperty**](PolymorphicProperty.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/CreditCardTypeProperty.md b/firefly-iii-api/docs/CreditCardTypeProperty.md new file mode 100644 index 0000000..ce2eb1d --- /dev/null +++ b/firefly-iii-api/docs/CreditCardTypeProperty.md @@ -0,0 +1,13 @@ +# CreditCardTypeProperty + +## Enum Variants + +| Name | Value | +|---- | -----| +| MonthlyFull | monthlyFull | +| Null | null | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/CronResult.md b/firefly-iii-api/docs/CronResult.md new file mode 100644 index 0000000..5836799 --- /dev/null +++ b/firefly-iii-api/docs/CronResult.md @@ -0,0 +1,13 @@ +# CronResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**recurring_transactions** | Option<[**models::CronResultRow**](CronResultRow.md)> | | [optional] +**auto_budgets** | Option<[**models::CronResultRow**](CronResultRow.md)> | | [optional] +**telemetry** | Option<[**models::CronResultRow**](CronResultRow.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/CronResultRow.md b/firefly-iii-api/docs/CronResultRow.md new file mode 100644 index 0000000..6760f70 --- /dev/null +++ b/firefly-iii-api/docs/CronResultRow.md @@ -0,0 +1,14 @@ +# CronResultRow + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**job_fired** | Option<**bool**> | This value tells you if this specific cron job actually fired. It may not fire. Some cron jobs only fire every 24 hours, for example. | [optional] +**job_succeeded** | Option<**bool**> | This value tells you if this specific cron job actually did something. The job may fire but not change anything. | [optional] +**job_errored** | Option<**bool**> | If the cron job ran into some kind of an error, this value will be true. | [optional] +**message** | Option<**String**> | If the cron job ran into some kind of an error, this value will be the error message. The success message if the job actually ran OK. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/CurrenciesApi.md b/firefly-iii-api/docs/CurrenciesApi.md new file mode 100644 index 0000000..e8c43ba --- /dev/null +++ b/firefly-iii-api/docs/CurrenciesApi.md @@ -0,0 +1,542 @@ +# \CurrenciesApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**default_currency**](CurrenciesApi.md#default_currency) | **POST** /v1/currencies/{code}/default | Make currency default currency. +[**delete_currency**](CurrenciesApi.md#delete_currency) | **DELETE** /v1/currencies/{code} | Delete a currency. +[**disable_currency**](CurrenciesApi.md#disable_currency) | **POST** /v1/currencies/{code}/disable | Disable a currency. +[**enable_currency**](CurrenciesApi.md#enable_currency) | **POST** /v1/currencies/{code}/enable | Enable a single currency. +[**get_currency**](CurrenciesApi.md#get_currency) | **GET** /v1/currencies/{code} | Get a single currency. +[**get_default_currency**](CurrenciesApi.md#get_default_currency) | **GET** /v1/currencies/default | Get the user's default currency. +[**list_account_by_currency**](CurrenciesApi.md#list_account_by_currency) | **GET** /v1/currencies/{code}/accounts | List all accounts with this currency. +[**list_available_budget_by_currency**](CurrenciesApi.md#list_available_budget_by_currency) | **GET** /v1/currencies/{code}/available-budgets | List all available budgets with this currency. +[**list_bill_by_currency**](CurrenciesApi.md#list_bill_by_currency) | **GET** /v1/currencies/{code}/bills | List all bills with this currency. +[**list_budget_limit_by_currency**](CurrenciesApi.md#list_budget_limit_by_currency) | **GET** /v1/currencies/{code}/budget_limits | List all budget limits with this currency +[**list_currency**](CurrenciesApi.md#list_currency) | **GET** /v1/currencies | List all currencies. +[**list_recurrence_by_currency**](CurrenciesApi.md#list_recurrence_by_currency) | **GET** /v1/currencies/{code}/recurrences | List all recurring transactions with this currency. +[**list_rule_by_currency**](CurrenciesApi.md#list_rule_by_currency) | **GET** /v1/currencies/{code}/rules | List all rules with this currency. +[**list_transaction_by_currency**](CurrenciesApi.md#list_transaction_by_currency) | **GET** /v1/currencies/{code}/transactions | List all transactions with this currency. +[**store_currency**](CurrenciesApi.md#store_currency) | **POST** /v1/currencies | Store a new currency +[**update_currency**](CurrenciesApi.md#update_currency) | **PUT** /v1/currencies/{code} | Update existing currency. + + + +## default_currency + +> models::CurrencySingle default_currency(code, x_trace_id) +Make currency default currency. + +Make this currency the default currency for the user. If the currency is not enabled, it will be enabled as well. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**code** | **String** | The currency code. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::CurrencySingle**](CurrencySingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_currency + +> delete_currency(code, x_trace_id) +Delete a currency. + +Delete a currency. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**code** | **String** | The currency code. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## disable_currency + +> models::CurrencySingle disable_currency(code, x_trace_id) +Disable a currency. + +Disable a currency. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**code** | **String** | The currency code. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::CurrencySingle**](CurrencySingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## enable_currency + +> models::CurrencySingle enable_currency(code, x_trace_id) +Enable a single currency. + +Enable a single currency. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**code** | **String** | The currency code. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::CurrencySingle**](CurrencySingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_currency + +> models::CurrencySingle get_currency(code, x_trace_id) +Get a single currency. + +Get a single currency. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**code** | **String** | The currency code. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::CurrencySingle**](CurrencySingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_default_currency + +> models::CurrencySingle get_default_currency(x_trace_id) +Get the user's default currency. + +Get the user's default currency. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::CurrencySingle**](CurrencySingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_account_by_currency + +> models::AccountArray list_account_by_currency(code, x_trace_id, limit, page, date, r#type) +List all accounts with this currency. + +List all accounts with this currency. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**code** | **String** | The currency code. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**date** | Option<**String**> | A date formatted YYYY-MM-DD. When added to the request, Firefly III will show the account's balance on that day. | | +**r#type** | Option<[**AccountTypeFilter**](.md)> | Optional filter on the account type(s) returned | | + +### Return type + +[**models::AccountArray**](AccountArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_available_budget_by_currency + +> models::AvailableBudgetArray list_available_budget_by_currency(code, x_trace_id, limit, page) +List all available budgets with this currency. + +List all available budgets with this currency. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**code** | **String** | The currency code. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::AvailableBudgetArray**](AvailableBudgetArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_bill_by_currency + +> models::BillArray list_bill_by_currency(code, x_trace_id, limit, page) +List all bills with this currency. + +List all bills with this currency. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**code** | **String** | The currency code. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::BillArray**](BillArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_budget_limit_by_currency + +> models::BudgetLimitArray list_budget_limit_by_currency(code, x_trace_id, limit, page, start, end) +List all budget limits with this currency + +List all budget limits with this currency + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**code** | **String** | The currency code. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**start** | Option<**String**> | Start date for the budget limit list. | | +**end** | Option<**String**> | End date for the budget limit list. | | + +### Return type + +[**models::BudgetLimitArray**](BudgetLimitArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_currency + +> models::CurrencyArray list_currency(x_trace_id, limit, page) +List all currencies. + +List all currencies. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::CurrencyArray**](CurrencyArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_recurrence_by_currency + +> models::RecurrenceArray list_recurrence_by_currency(code, x_trace_id, limit, page) +List all recurring transactions with this currency. + +List all recurring transactions with this currency. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**code** | **String** | The currency code. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::RecurrenceArray**](RecurrenceArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_rule_by_currency + +> models::RuleArray list_rule_by_currency(code, x_trace_id, limit, page) +List all rules with this currency. + +List all rules with this currency. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**code** | **String** | The currency code. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::RuleArray**](RuleArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_transaction_by_currency + +> models::TransactionArray list_transaction_by_currency(code, x_trace_id, limit, page, start, end, r#type) +List all transactions with this currency. + +List all transactions with this currency. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**code** | **String** | The currency code. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD, to limit the list of transactions. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD, to limit the list of transactions. | | +**r#type** | Option<[**TransactionTypeFilter**](.md)> | Optional filter on the transaction type(s) returned | | + +### Return type + +[**models::TransactionArray**](TransactionArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_currency + +> models::CurrencySingle store_currency(currency_store, x_trace_id) +Store a new currency + +Creates a new currency. The data required can be submitted as a JSON body or as a list of parameters. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**currency_store** | [**CurrencyStore**](CurrencyStore.md) | JSON array or key=value pairs with the necessary currency information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::CurrencySingle**](CurrencySingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_currency + +> models::CurrencySingle update_currency(code, currency_update, x_trace_id) +Update existing currency. + +Update existing currency. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**code** | **String** | The currency code. | [required] | +**currency_update** | [**CurrencyUpdate**](CurrencyUpdate.md) | JSON array with updated currency information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::CurrencySingle**](CurrencySingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/vnd.api+json, application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/Currency.md b/firefly-iii-api/docs/Currency.md new file mode 100644 index 0000000..d7aa680 --- /dev/null +++ b/firefly-iii-api/docs/Currency.md @@ -0,0 +1,18 @@ +# Currency + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**enabled** | Option<**bool**> | Defaults to true | [optional][default to true] +**default** | Option<**bool**> | Make this currency the default currency. | [optional] +**code** | **String** | | +**name** | **String** | | +**symbol** | **String** | | +**decimal_places** | Option<**i32**> | Supports 0-16 decimals. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/CurrencyArray.md b/firefly-iii-api/docs/CurrencyArray.md new file mode 100644 index 0000000..e41c82a --- /dev/null +++ b/firefly-iii-api/docs/CurrencyArray.md @@ -0,0 +1,13 @@ +# CurrencyArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](CurrencyRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | +**links** | [**models::PageLink**](PageLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/CurrencyRead.md b/firefly-iii-api/docs/CurrencyRead.md new file mode 100644 index 0000000..bcc6307 --- /dev/null +++ b/firefly-iii-api/docs/CurrencyRead.md @@ -0,0 +1,13 @@ +# CurrencyRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::Currency**](Currency.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/CurrencySingle.md b/firefly-iii-api/docs/CurrencySingle.md new file mode 100644 index 0000000..9a8a389 --- /dev/null +++ b/firefly-iii-api/docs/CurrencySingle.md @@ -0,0 +1,11 @@ +# CurrencySingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::CurrencyRead**](CurrencyRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/CurrencyStore.md b/firefly-iii-api/docs/CurrencyStore.md new file mode 100644 index 0000000..bc13cbb --- /dev/null +++ b/firefly-iii-api/docs/CurrencyStore.md @@ -0,0 +1,16 @@ +# CurrencyStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | Option<**bool**> | Defaults to true | [optional][default to true] +**default** | Option<**bool**> | Make this currency the default currency. You can set this value to FALSE, in which case nothing will change to the default currency. If you set it to TRUE, the current default currency will no longer be the default currency. | [optional] +**code** | **String** | | +**name** | **String** | | +**symbol** | **String** | | +**decimal_places** | Option<**i32**> | Supports 0-16 decimals. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/CurrencyUpdate.md b/firefly-iii-api/docs/CurrencyUpdate.md new file mode 100644 index 0000000..81fcc43 --- /dev/null +++ b/firefly-iii-api/docs/CurrencyUpdate.md @@ -0,0 +1,16 @@ +# CurrencyUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | Option<**bool**> | If the currency is enabled | [optional] +**default** | Option<**bool**> | If the currency must be the default for the user. You can only submit TRUE. Submitting FALSE will not drop this currency as the default currency, because then the system would be without one. | [optional] +**code** | Option<**String**> | The currency code | [optional] +**name** | Option<**String**> | The currency name | [optional] +**symbol** | Option<**String**> | The currency symbol | [optional] +**decimal_places** | Option<**i32**> | How many decimals to use when displaying this currency. Between 0 and 16. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/DataApi.md b/firefly-iii-api/docs/DataApi.md new file mode 100644 index 0000000..9a7eb5d --- /dev/null +++ b/firefly-iii-api/docs/DataApi.md @@ -0,0 +1,393 @@ +# \DataApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**bulk_update_transactions**](DataApi.md#bulk_update_transactions) | **POST** /v1/data/bulk/transactions | Bulk update transaction properties. For more information, see https://docs.firefly-iii.org/references/firefly-iii/api/specials/ +[**destroy_data**](DataApi.md#destroy_data) | **DELETE** /v1/data/destroy | Endpoint to destroy user data +[**export_accounts**](DataApi.md#export_accounts) | **GET** /v1/data/export/accounts | Export account data from Firefly III +[**export_bills**](DataApi.md#export_bills) | **GET** /v1/data/export/bills | Export bills from Firefly III +[**export_budgets**](DataApi.md#export_budgets) | **GET** /v1/data/export/budgets | Export budgets and budget amount data from Firefly III +[**export_categories**](DataApi.md#export_categories) | **GET** /v1/data/export/categories | Export category data from Firefly III +[**export_piggies**](DataApi.md#export_piggies) | **GET** /v1/data/export/piggy-banks | Export piggy banks from Firefly III +[**export_recurring**](DataApi.md#export_recurring) | **GET** /v1/data/export/recurring | Export recurring transaction data from Firefly III +[**export_rules**](DataApi.md#export_rules) | **GET** /v1/data/export/rules | Export rule groups and rule data from Firefly III +[**export_tags**](DataApi.md#export_tags) | **GET** /v1/data/export/tags | Export tag data from Firefly III +[**export_transactions**](DataApi.md#export_transactions) | **GET** /v1/data/export/transactions | Export transaction data from Firefly III +[**purge_data**](DataApi.md#purge_data) | **DELETE** /v1/data/purge | Endpoint to purge user data + + + +## bulk_update_transactions + +> bulk_update_transactions(query) +Bulk update transaction properties. For more information, see https://docs.firefly-iii.org/references/firefly-iii/api/specials/ + +Allows you to update transactions in bulk. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**query** | **String** | The JSON query. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## destroy_data + +> destroy_data(objects, x_trace_id) +Endpoint to destroy user data + +A call to this endpoint deletes the requested data type. Use it with care and always with user permission. The demo user is incapable of using this endpoint. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**objects** | [**DataDestroyObject**](.md) | The type of data that you wish to destroy. You can only use one at a time. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## export_accounts + +> std::path::PathBuf export_accounts(x_trace_id, r#type) +Export account data from Firefly III + +This endpoint allows you to export your accounts from Firefly III into a file. Currently supports CSV exports only. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**r#type** | Option<[**ExportFileFilter**](.md)> | The file type the export file (CSV is currently the only option). | | + +### Return type + +[**std::path::PathBuf**](std::path::PathBuf.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## export_bills + +> std::path::PathBuf export_bills(x_trace_id, r#type) +Export bills from Firefly III + +This endpoint allows you to export your bills from Firefly III into a file. Currently supports CSV exports only. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**r#type** | Option<[**ExportFileFilter**](.md)> | The file type the export file (CSV is currently the only option). | | + +### Return type + +[**std::path::PathBuf**](std::path::PathBuf.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## export_budgets + +> std::path::PathBuf export_budgets(x_trace_id, r#type) +Export budgets and budget amount data from Firefly III + +This endpoint allows you to export your budgets and associated budget data from Firefly III into a file. Currently supports CSV exports only. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**r#type** | Option<[**ExportFileFilter**](.md)> | The file type the export file (CSV is currently the only option). | | + +### Return type + +[**std::path::PathBuf**](std::path::PathBuf.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## export_categories + +> std::path::PathBuf export_categories(x_trace_id, r#type) +Export category data from Firefly III + +This endpoint allows you to export your categories from Firefly III into a file. Currently supports CSV exports only. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**r#type** | Option<[**ExportFileFilter**](.md)> | The file type the export file (CSV is currently the only option). | | + +### Return type + +[**std::path::PathBuf**](std::path::PathBuf.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## export_piggies + +> std::path::PathBuf export_piggies(x_trace_id, r#type) +Export piggy banks from Firefly III + +This endpoint allows you to export your piggy banks from Firefly III into a file. Currently supports CSV exports only. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**r#type** | Option<[**ExportFileFilter**](.md)> | The file type the export file (CSV is currently the only option). | | + +### Return type + +[**std::path::PathBuf**](std::path::PathBuf.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## export_recurring + +> std::path::PathBuf export_recurring(x_trace_id, r#type) +Export recurring transaction data from Firefly III + +This endpoint allows you to export your recurring transactions from Firefly III into a file. Currently supports CSV exports only. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**r#type** | Option<[**ExportFileFilter**](.md)> | The file type the export file (CSV is currently the only option). | | + +### Return type + +[**std::path::PathBuf**](std::path::PathBuf.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## export_rules + +> std::path::PathBuf export_rules(x_trace_id, r#type) +Export rule groups and rule data from Firefly III + +This endpoint allows you to export your rules and rule groups from Firefly III into a file. Currently supports CSV exports only. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**r#type** | Option<[**ExportFileFilter**](.md)> | The file type the export file (CSV is currently the only option). | | + +### Return type + +[**std::path::PathBuf**](std::path::PathBuf.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## export_tags + +> std::path::PathBuf export_tags(x_trace_id, r#type) +Export tag data from Firefly III + +This endpoint allows you to export your tags from Firefly III into a file. Currently supports CSV exports only. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**r#type** | Option<[**ExportFileFilter**](.md)> | The file type the export file (CSV is currently the only option). | | + +### Return type + +[**std::path::PathBuf**](std::path::PathBuf.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## export_transactions + +> std::path::PathBuf export_transactions(start, end, x_trace_id, accounts, r#type) +Export transaction data from Firefly III + +This endpoint allows you to export transactions from Firefly III into a file. Currently supports CSV exports only. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts** | Option<**String**> | Limit the export of transactions to these accounts only. Only asset accounts will be accepted. Other types will be silently dropped. | | +**r#type** | Option<[**ExportFileFilter**](.md)> | The file type the export file (CSV is currently the only option). | | + +### Return type + +[**std::path::PathBuf**](std::path::PathBuf.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## purge_data + +> purge_data(x_trace_id) +Endpoint to purge user data + +A call to this endpoint purges all previously deleted data. Use it with care and always with user permission. The demo user is incapable of using this endpoint. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/DataDestroyObject.md b/firefly-iii-api/docs/DataDestroyObject.md new file mode 100644 index 0000000..11cdcfc --- /dev/null +++ b/firefly-iii-api/docs/DataDestroyObject.md @@ -0,0 +1,29 @@ +# DataDestroyObject + +## Enum Variants + +| Name | Value | +|---- | -----| +| NotAssetsLiabilities | not_assets_liabilities | +| Budgets | budgets | +| Bills | bills | +| PiggyBanks | piggy_banks | +| Rules | rules | +| Recurring | recurring | +| Categories | categories | +| Tags | tags | +| ObjectGroups | object_groups | +| Accounts | accounts | +| AssetAccounts | asset_accounts | +| ExpenseAccounts | expense_accounts | +| RevenueAccounts | revenue_accounts | +| Liabilities | liabilities | +| Transactions | transactions | +| Withdrawals | withdrawals | +| Deposits | deposits | +| Transfers | transfers | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/ExportFileFilter.md b/firefly-iii-api/docs/ExportFileFilter.md new file mode 100644 index 0000000..00cf3cc --- /dev/null +++ b/firefly-iii-api/docs/ExportFileFilter.md @@ -0,0 +1,12 @@ +# ExportFileFilter + +## Enum Variants + +| Name | Value | +|---- | -----| +| Csv | csv | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/InsightApi.md b/firefly-iii-api/docs/InsightApi.md new file mode 100644 index 0000000..ebedd8c --- /dev/null +++ b/firefly-iii-api/docs/InsightApi.md @@ -0,0 +1,832 @@ +# \InsightApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**insight_expense_asset**](InsightApi.md#insight_expense_asset) | **GET** /v1/insight/expense/asset | Insight into expenses, grouped by asset account. +[**insight_expense_bill**](InsightApi.md#insight_expense_bill) | **GET** /v1/insight/expense/bill | Insight into expenses, grouped by bill. +[**insight_expense_budget**](InsightApi.md#insight_expense_budget) | **GET** /v1/insight/expense/budget | Insight into expenses, grouped by budget. +[**insight_expense_category**](InsightApi.md#insight_expense_category) | **GET** /v1/insight/expense/category | Insight into expenses, grouped by category. +[**insight_expense_expense**](InsightApi.md#insight_expense_expense) | **GET** /v1/insight/expense/expense | Insight into expenses, grouped by expense account. +[**insight_expense_no_bill**](InsightApi.md#insight_expense_no_bill) | **GET** /v1/insight/expense/no-bill | Insight into expenses, without bill. +[**insight_expense_no_budget**](InsightApi.md#insight_expense_no_budget) | **GET** /v1/insight/expense/no-budget | Insight into expenses, without budget. +[**insight_expense_no_category**](InsightApi.md#insight_expense_no_category) | **GET** /v1/insight/expense/no-category | Insight into expenses, without category. +[**insight_expense_no_tag**](InsightApi.md#insight_expense_no_tag) | **GET** /v1/insight/expense/no-tag | Insight into expenses, without tag. +[**insight_expense_tag**](InsightApi.md#insight_expense_tag) | **GET** /v1/insight/expense/tag | Insight into expenses, grouped by tag. +[**insight_expense_total**](InsightApi.md#insight_expense_total) | **GET** /v1/insight/expense/total | Insight into total expenses. +[**insight_income_asset**](InsightApi.md#insight_income_asset) | **GET** /v1/insight/income/asset | Insight into income, grouped by asset account. +[**insight_income_category**](InsightApi.md#insight_income_category) | **GET** /v1/insight/income/category | Insight into income, grouped by category. +[**insight_income_no_category**](InsightApi.md#insight_income_no_category) | **GET** /v1/insight/income/no-category | Insight into income, without category. +[**insight_income_no_tag**](InsightApi.md#insight_income_no_tag) | **GET** /v1/insight/income/no-tag | Insight into income, without tag. +[**insight_income_revenue**](InsightApi.md#insight_income_revenue) | **GET** /v1/insight/income/revenue | Insight into income, grouped by revenue account. +[**insight_income_tag**](InsightApi.md#insight_income_tag) | **GET** /v1/insight/income/tag | Insight into income, grouped by tag. +[**insight_income_total**](InsightApi.md#insight_income_total) | **GET** /v1/insight/income/total | Insight into total income. +[**insight_transfer_category**](InsightApi.md#insight_transfer_category) | **GET** /v1/insight/transfer/category | Insight into transfers, grouped by category. +[**insight_transfer_no_category**](InsightApi.md#insight_transfer_no_category) | **GET** /v1/insight/transfer/no-category | Insight into transfers, without category. +[**insight_transfer_no_tag**](InsightApi.md#insight_transfer_no_tag) | **GET** /v1/insight/transfer/no-tag | Insight into expenses, without tag. +[**insight_transfer_tag**](InsightApi.md#insight_transfer_tag) | **GET** /v1/insight/transfer/tag | Insight into transfers, grouped by tag. +[**insight_transfer_total**](InsightApi.md#insight_transfer_total) | **GET** /v1/insight/transfer/total | Insight into total transfers. +[**insight_transfers**](InsightApi.md#insight_transfers) | **GET** /v1/insight/transfer/asset | Insight into transfers, grouped by account. + + + +## insight_expense_asset + +> Vec insight_expense_asset(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into expenses, grouped by asset account. + +This endpoint gives a summary of the expenses made by the user, grouped by asset account. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightGroupEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_expense_bill + +> Vec insight_expense_bill(start, end, x_trace_id, bills_left_square_bracket_right_square_bracket, accounts_left_square_bracket_right_square_bracket) +Insight into expenses, grouped by bill. + +This endpoint gives a summary of the expenses made by the user, grouped by (any) bill. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**bills_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The bills to be included in the results. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightGroupEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_expense_budget + +> Vec insight_expense_budget(start, end, x_trace_id, budgets_left_square_bracket_right_square_bracket, accounts_left_square_bracket_right_square_bracket) +Insight into expenses, grouped by budget. + +This endpoint gives a summary of the expenses made by the user, grouped by (any) budget. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**budgets_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The budgets to be included in the results. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightGroupEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_expense_category + +> Vec insight_expense_category(start, end, x_trace_id, categories_left_square_bracket_right_square_bracket, accounts_left_square_bracket_right_square_bracket) +Insight into expenses, grouped by category. + +This endpoint gives a summary of the expenses made by the user, grouped by (any) category. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**categories_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The categories to be included in the results. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightGroupEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_expense_expense + +> Vec insight_expense_expense(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into expenses, grouped by expense account. + +This endpoint gives a summary of the expenses made by the user, grouped by expense account. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you add the accounts ID's of expense accounts, only those accounts are included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. You can combine both asset / liability and expense account ID's. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightGroupEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_expense_no_bill + +> Vec insight_expense_no_bill(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into expenses, without bill. + +This endpoint gives a summary of the expenses made by the user, including only expenses with no bill. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightTotalEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_expense_no_budget + +> Vec insight_expense_no_budget(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into expenses, without budget. + +This endpoint gives a summary of the expenses made by the user, including only expenses with no budget. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightTotalEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_expense_no_category + +> Vec insight_expense_no_category(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into expenses, without category. + +This endpoint gives a summary of the expenses made by the user, including only expenses with no category. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightTotalEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_expense_no_tag + +> Vec insight_expense_no_tag(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into expenses, without tag. + +This endpoint gives a summary of the expenses made by the user, including only expenses with no tag. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightTotalEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_expense_tag + +> Vec insight_expense_tag(start, end, x_trace_id, tags_left_square_bracket_right_square_bracket, accounts_left_square_bracket_right_square_bracket) +Insight into expenses, grouped by tag. + +This endpoint gives a summary of the expenses made by the user, grouped by (any) tag. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**tags_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The tags to be included in the results. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightGroupEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_expense_total + +> Vec insight_expense_total(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into total expenses. + +This endpoint gives a sum of the total expenses made by the user. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only withdrawals from those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightTotalEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_income_asset + +> Vec insight_income_asset(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into income, grouped by asset account. + +This endpoint gives a summary of the income received by the user, grouped by asset account. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only deposits to those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightGroupEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_income_category + +> Vec insight_income_category(start, end, x_trace_id, categories_left_square_bracket_right_square_bracket, accounts_left_square_bracket_right_square_bracket) +Insight into income, grouped by category. + +This endpoint gives a summary of the income received by the user, grouped by (any) category. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**categories_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The categories to be included in the results. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only deposits to those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightGroupEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_income_no_category + +> Vec insight_income_no_category(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into income, without category. + +This endpoint gives a summary of the income received by the user, including only income with no category. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only deposits to those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightTotalEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_income_no_tag + +> Vec insight_income_no_tag(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into income, without tag. + +This endpoint gives a summary of the income received by the user, including only income with no tag. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only deposits to those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightTotalEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_income_revenue + +> Vec insight_income_revenue(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into income, grouped by revenue account. + +This endpoint gives a summary of the income received by the user, grouped by revenue account. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you add the accounts ID's of revenue accounts, only those accounts are included in the results. If you include ID's of asset accounts or liabilities, only deposits to those asset accounts / liabilities will be included. You can combine both asset / liability and deposit account ID's. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightGroupEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_income_tag + +> Vec insight_income_tag(start, end, x_trace_id, tags_left_square_bracket_right_square_bracket, accounts_left_square_bracket_right_square_bracket) +Insight into income, grouped by tag. + +This endpoint gives a summary of the income received by the user, grouped by (any) tag. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**tags_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The tags to be included in the results. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only deposits to those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightGroupEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_income_total + +> Vec insight_income_total(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into total income. + +This endpoint gives a sum of the total income received by the user. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only deposits to those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightTotalEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_transfer_category + +> Vec insight_transfer_category(start, end, x_trace_id, categories_left_square_bracket_right_square_bracket, accounts_left_square_bracket_right_square_bracket) +Insight into transfers, grouped by category. + +This endpoint gives a summary of the transfers made by the user, grouped by (any) category. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**categories_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The categories to be included in the results. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only transfers between those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightGroupEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_transfer_no_category + +> Vec insight_transfer_no_category(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into transfers, without category. + +This endpoint gives a summary of the transfers made by the user, including only transfers with no category. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only transfers between those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightTotalEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_transfer_no_tag + +> Vec insight_transfer_no_tag(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into expenses, without tag. + +This endpoint gives a summary of the transfers made by the user, including only transfers with no tag. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only transfers from those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightTotalEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_transfer_tag + +> Vec insight_transfer_tag(start, end, x_trace_id, tags_left_square_bracket_right_square_bracket, accounts_left_square_bracket_right_square_bracket) +Insight into transfers, grouped by tag. + +This endpoint gives a summary of the transfers created by the user, grouped by (any) tag. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**tags_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The tags to be included in the results. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only transfers between those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightGroupEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_transfer_total + +> Vec insight_transfer_total(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into total transfers. + +This endpoint gives a sum of the total amount transfers made by the user. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only transfers between those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightTotalEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## insight_transfers + +> Vec insight_transfers(start, end, x_trace_id, accounts_left_square_bracket_right_square_bracket) +Insight into transfers, grouped by account. + +This endpoint gives a summary of the transfers made by the user, grouped by asset account or lability. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | The accounts to be included in the results. If you include ID's of asset accounts or liabilities, only transfers between those asset accounts / liabilities will be included. Other account ID's will be ignored. | | + +### Return type + +[**Vec**](InsightTransferEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/InsightGroupEntry.md b/firefly-iii-api/docs/InsightGroupEntry.md new file mode 100644 index 0000000..7ac8801 --- /dev/null +++ b/firefly-iii-api/docs/InsightGroupEntry.md @@ -0,0 +1,16 @@ +# InsightGroupEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**String**> | This ID is a reference to the original object. | [optional] +**name** | Option<**String**> | This is the name of the object. | [optional] +**difference** | Option<**String**> | The amount spent or earned between start date and end date, a number defined as a string, for this object and all asset accounts. | [optional] +**difference_float** | Option<**f64**> | The amount spent or earned between start date and end date, a number as a float, for this object and all asset accounts. May have rounding errors. | [optional] +**currency_id** | Option<**String**> | The currency ID of the expenses listed for this account. | [optional] +**currency_code** | Option<**String**> | The currency code of the expenses listed for this account. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/InsightTotalEntry.md b/firefly-iii-api/docs/InsightTotalEntry.md new file mode 100644 index 0000000..588a84a --- /dev/null +++ b/firefly-iii-api/docs/InsightTotalEntry.md @@ -0,0 +1,14 @@ +# InsightTotalEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**difference** | Option<**String**> | The amount spent between start date and end date, defined as a string, for this expense account and all asset accounts. | [optional] +**difference_float** | Option<**f64**> | The amount spent between start date and end date, defined as a string, for this expense account and all asset accounts. This number is a float (double) and may have rounding errors. | [optional] +**currency_id** | Option<**String**> | The currency ID of the expenses listed for this expense account. | [optional] +**currency_code** | Option<**String**> | The currency code of the expenses listed for this expense account. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/InsightTransferEntry.md b/firefly-iii-api/docs/InsightTransferEntry.md new file mode 100644 index 0000000..657d69a --- /dev/null +++ b/firefly-iii-api/docs/InsightTransferEntry.md @@ -0,0 +1,20 @@ +# InsightTransferEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**String**> | This ID is a reference to the original object. | [optional] +**name** | Option<**String**> | This is the name of the object. | [optional] +**difference** | Option<**String**> | The total amount transferred between start date and end date, a number defined as a string, for this asset account. | [optional] +**difference_float** | Option<**f64**> | The total amount transferred between start date and end date, a number as a float, for this asset account. May have rounding errors. | [optional] +**r#in** | Option<**String**> | The total amount transferred TO this account between start date and end date, a number defined as a string, for this asset account. | [optional] +**in_float** | Option<**f64**> | The total amount transferred FROM this account between start date and end date, a number as a float, for this asset account. May have rounding errors. | [optional] +**out** | Option<**String**> | The total amount transferred FROM this account between start date and end date, a number defined as a string, for this asset account. | [optional] +**out_float** | Option<**f64**> | The total amount transferred TO this account between start date and end date, a number as a float, for this asset account. May have rounding errors. | [optional] +**currency_id** | Option<**String**> | The currency ID of the expenses listed for this account. | [optional] +**currency_code** | Option<**String**> | The currency code of the expenses listed for this account. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/InterestPeriodProperty.md b/firefly-iii-api/docs/InterestPeriodProperty.md new file mode 100644 index 0000000..abf5d48 --- /dev/null +++ b/firefly-iii-api/docs/InterestPeriodProperty.md @@ -0,0 +1,17 @@ +# InterestPeriodProperty + +## Enum Variants + +| Name | Value | +|---- | -----| +| Weekly | weekly | +| Monthly | monthly | +| Quarterly | quarterly | +| HalfYear | half-year | +| Yearly | yearly | +| Null | null | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/InternalExceptionResponse.md b/firefly-iii-api/docs/InternalExceptionResponse.md new file mode 100644 index 0000000..2cfd20c --- /dev/null +++ b/firefly-iii-api/docs/InternalExceptionResponse.md @@ -0,0 +1,12 @@ +# InternalExceptionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | Option<**String**> | | [optional] +**exception** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/LiabilityDirectionProperty.md b/firefly-iii-api/docs/LiabilityDirectionProperty.md new file mode 100644 index 0000000..3dfedfa --- /dev/null +++ b/firefly-iii-api/docs/LiabilityDirectionProperty.md @@ -0,0 +1,14 @@ +# LiabilityDirectionProperty + +## Enum Variants + +| Name | Value | +|---- | -----| +| Credit | credit | +| Debit | debit | +| Null | null | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/LiabilityTypeProperty.md b/firefly-iii-api/docs/LiabilityTypeProperty.md new file mode 100644 index 0000000..7357cc7 --- /dev/null +++ b/firefly-iii-api/docs/LiabilityTypeProperty.md @@ -0,0 +1,15 @@ +# LiabilityTypeProperty + +## Enum Variants + +| Name | Value | +|---- | -----| +| Loan | loan | +| Debt | debt | +| Mortgage | mortgage | +| Null | null | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/LinkType.md b/firefly-iii-api/docs/LinkType.md new file mode 100644 index 0000000..b6857b8 --- /dev/null +++ b/firefly-iii-api/docs/LinkType.md @@ -0,0 +1,14 @@ +# LinkType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**inward** | **String** | | +**outward** | **String** | | +**editable** | Option<**bool**> | | [optional][readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/LinkTypeArray.md b/firefly-iii-api/docs/LinkTypeArray.md new file mode 100644 index 0000000..08fa559 --- /dev/null +++ b/firefly-iii-api/docs/LinkTypeArray.md @@ -0,0 +1,13 @@ +# LinkTypeArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](LinkTypeRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | +**links** | [**models::PageLink**](PageLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/LinkTypeRead.md b/firefly-iii-api/docs/LinkTypeRead.md new file mode 100644 index 0000000..fe3daed --- /dev/null +++ b/firefly-iii-api/docs/LinkTypeRead.md @@ -0,0 +1,14 @@ +# LinkTypeRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::LinkType**](LinkType.md) | | +**links** | [**models::ObjectLink**](ObjectLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/LinkTypeSingle.md b/firefly-iii-api/docs/LinkTypeSingle.md new file mode 100644 index 0000000..c9d3a76 --- /dev/null +++ b/firefly-iii-api/docs/LinkTypeSingle.md @@ -0,0 +1,11 @@ +# LinkTypeSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::LinkTypeRead**](LinkTypeRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/LinkTypeUpdate.md b/firefly-iii-api/docs/LinkTypeUpdate.md new file mode 100644 index 0000000..d8bfd7c --- /dev/null +++ b/firefly-iii-api/docs/LinkTypeUpdate.md @@ -0,0 +1,13 @@ +# LinkTypeUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | | [optional] +**inward** | Option<**String**> | | [optional] +**outward** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/LinksApi.md b/firefly-iii-api/docs/LinksApi.md new file mode 100644 index 0000000..4783f34 --- /dev/null +++ b/firefly-iii-api/docs/LinksApi.md @@ -0,0 +1,369 @@ +# \LinksApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_link_type**](LinksApi.md#delete_link_type) | **DELETE** /v1/link-types/{id} | Permanently delete link type. +[**delete_transaction_link**](LinksApi.md#delete_transaction_link) | **DELETE** /v1/transaction-links/{id} | Permanently delete link between transactions. +[**get_link_type**](LinksApi.md#get_link_type) | **GET** /v1/link-types/{id} | Get single a link type. +[**get_transaction_link**](LinksApi.md#get_transaction_link) | **GET** /v1/transaction-links/{id} | Get a single link. +[**list_link_type**](LinksApi.md#list_link_type) | **GET** /v1/link-types | List all types of links. +[**list_transaction_by_link_type**](LinksApi.md#list_transaction_by_link_type) | **GET** /v1/link-types/{id}/transactions | List all transactions under this link type. +[**list_transaction_link**](LinksApi.md#list_transaction_link) | **GET** /v1/transaction-links | List all transaction links. +[**store_link_type**](LinksApi.md#store_link_type) | **POST** /v1/link-types | Create a new link type +[**store_transaction_link**](LinksApi.md#store_transaction_link) | **POST** /v1/transaction-links | Create a new link between transactions +[**update_link_type**](LinksApi.md#update_link_type) | **PUT** /v1/link-types/{id} | Update existing link type. +[**update_transaction_link**](LinksApi.md#update_transaction_link) | **PUT** /v1/transaction-links/{id} | Update an existing link between transactions. + + + +## delete_link_type + +> delete_link_type(id, x_trace_id) +Permanently delete link type. + +Will permanently delete a link type. The links between transactions will be removed. The transactions themselves remain. You cannot delete some of the system provided link types, indicated by the editable=false flag when you list it. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the link type. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_transaction_link + +> delete_transaction_link(id, x_trace_id) +Permanently delete link between transactions. + +Will permanently delete link. Transactions remain. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the transaction link. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_link_type + +> models::LinkTypeSingle get_link_type(id, x_trace_id) +Get single a link type. + +Returns a single link type by its ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the link type. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::LinkTypeSingle**](LinkTypeSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_transaction_link + +> models::TransactionLinkSingle get_transaction_link(id, x_trace_id) +Get a single link. + +Returns a single link by its ID. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the transaction link. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::TransactionLinkSingle**](TransactionLinkSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_link_type + +> models::LinkTypeArray list_link_type(x_trace_id, limit, page) +List all types of links. + +List all the link types the system has. These include the default ones as well as any new ones. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::LinkTypeArray**](LinkTypeArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_transaction_by_link_type + +> models::TransactionArray list_transaction_by_link_type(id, x_trace_id, limit, page, start, end, r#type) +List all transactions under this link type. + +List all transactions under this link type, both the inward and outward transactions. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the link type. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD, to limit the results. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD, to limit the results. | | +**r#type** | Option<[**TransactionTypeFilter**](.md)> | Optional filter on the transaction type(s) returned. | | + +### Return type + +[**models::TransactionArray**](TransactionArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_transaction_link + +> models::TransactionLinkArray list_transaction_link(x_trace_id, limit, page) +List all transaction links. + +List all the transaction links. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::TransactionLinkArray**](TransactionLinkArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_link_type + +> models::LinkTypeSingle store_link_type(link_type, x_trace_id) +Create a new link type + +Creates a new link type. The data required can be submitted as a JSON body or as a list of parameters (in key=value pairs, like a webform). + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**link_type** | [**LinkType**](LinkType.md) | JSON array with the necessary link type information or key=value pairs. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::LinkTypeSingle**](LinkTypeSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_transaction_link + +> models::TransactionLinkSingle store_transaction_link(transaction_link_store, x_trace_id) +Create a new link between transactions + +Store a new link between two transactions. For this end point you need the journal_id from a transaction. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**transaction_link_store** | [**TransactionLinkStore**](TransactionLinkStore.md) | JSON array with the necessary link type information or key=value pairs. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::TransactionLinkSingle**](TransactionLinkSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_link_type + +> models::LinkTypeSingle update_link_type(id, link_type_update, x_trace_id) +Update existing link type. + +Used to update a single link type. All fields that are not submitted will be cleared (set to NULL). The model will tell you which fields are mandatory. You cannot update some of the system provided link types, indicated by the editable=false flag when you list it. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the link type. | [required] | +**link_type_update** | [**LinkTypeUpdate**](LinkTypeUpdate.md) | JSON array or formdata with updated link type information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::LinkTypeSingle**](LinkTypeSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_transaction_link + +> models::TransactionLinkSingle update_transaction_link(id, transaction_link_update, x_trace_id) +Update an existing link between transactions. + +Used to update a single existing link. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the transaction link. | [required] | +**transaction_link_update** | [**TransactionLinkUpdate**](TransactionLinkUpdate.md) | JSON array or formdata with updated link type information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::TransactionLinkSingle**](TransactionLinkSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/Meta.md b/firefly-iii-api/docs/Meta.md new file mode 100644 index 0000000..b8f7577 --- /dev/null +++ b/firefly-iii-api/docs/Meta.md @@ -0,0 +1,11 @@ +# Meta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | Option<[**models::MetaPagination**](Meta_pagination.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/MetaPagination.md b/firefly-iii-api/docs/MetaPagination.md new file mode 100644 index 0000000..ee87d98 --- /dev/null +++ b/firefly-iii-api/docs/MetaPagination.md @@ -0,0 +1,15 @@ +# MetaPagination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | Option<**i32**> | | [optional] +**count** | Option<**i32**> | | [optional] +**per_page** | Option<**i32**> | | [optional] +**current_page** | Option<**i32**> | | [optional] +**total_pages** | Option<**i32**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/NotFoundResponse.md b/firefly-iii-api/docs/NotFoundResponse.md new file mode 100644 index 0000000..1bc80b5 --- /dev/null +++ b/firefly-iii-api/docs/NotFoundResponse.md @@ -0,0 +1,12 @@ +# NotFoundResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | Option<**String**> | | [optional] +**exception** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/ObjectGroup.md b/firefly-iii-api/docs/ObjectGroup.md new file mode 100644 index 0000000..7bdd94a --- /dev/null +++ b/firefly-iii-api/docs/ObjectGroup.md @@ -0,0 +1,14 @@ +# ObjectGroup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**title** | **String** | | +**order** | **i32** | Order of the object group | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/ObjectGroupArray.md b/firefly-iii-api/docs/ObjectGroupArray.md new file mode 100644 index 0000000..16f194d --- /dev/null +++ b/firefly-iii-api/docs/ObjectGroupArray.md @@ -0,0 +1,12 @@ +# ObjectGroupArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](ObjectGroupRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/ObjectGroupRead.md b/firefly-iii-api/docs/ObjectGroupRead.md new file mode 100644 index 0000000..8acf7b0 --- /dev/null +++ b/firefly-iii-api/docs/ObjectGroupRead.md @@ -0,0 +1,13 @@ +# ObjectGroupRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::ObjectGroup**](ObjectGroup.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/ObjectGroupSingle.md b/firefly-iii-api/docs/ObjectGroupSingle.md new file mode 100644 index 0000000..2ff4548 --- /dev/null +++ b/firefly-iii-api/docs/ObjectGroupSingle.md @@ -0,0 +1,11 @@ +# ObjectGroupSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::ObjectGroupRead**](ObjectGroupRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/ObjectGroupUpdate.md b/firefly-iii-api/docs/ObjectGroupUpdate.md new file mode 100644 index 0000000..0d53586 --- /dev/null +++ b/firefly-iii-api/docs/ObjectGroupUpdate.md @@ -0,0 +1,12 @@ +# ObjectGroupUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **String** | | +**order** | Option<**i32**> | Order of the object group | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/ObjectGroupsApi.md b/firefly-iii-api/docs/ObjectGroupsApi.md new file mode 100644 index 0000000..4de4e69 --- /dev/null +++ b/firefly-iii-api/docs/ObjectGroupsApi.md @@ -0,0 +1,206 @@ +# \ObjectGroupsApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_object_group**](ObjectGroupsApi.md#delete_object_group) | **DELETE** /v1/object-groups/{id} | Delete a object group. +[**get_object_group**](ObjectGroupsApi.md#get_object_group) | **GET** /v1/object-groups/{id} | Get a single object group. +[**list_bill_by_object_group**](ObjectGroupsApi.md#list_bill_by_object_group) | **GET** /v1/object-groups/{id}/bills | List all bills with this object group. +[**list_object_groups**](ObjectGroupsApi.md#list_object_groups) | **GET** /v1/object-groups | List all oject groups. +[**list_piggy_bank_by_object_group**](ObjectGroupsApi.md#list_piggy_bank_by_object_group) | **GET** /v1/object-groups/{id}/piggy-banks | List all piggy banks related to the object group. +[**update_object_group**](ObjectGroupsApi.md#update_object_group) | **PUT** /v1/object-groups/{id} | Update existing object group. + + + +## delete_object_group + +> delete_object_group(id, x_trace_id) +Delete a object group. + +Delete a object group. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the object group. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_object_group + +> models::ObjectGroupSingle get_object_group(id, x_trace_id) +Get a single object group. + +Get a single object group. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the object group. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::ObjectGroupSingle**](ObjectGroupSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_bill_by_object_group + +> models::BillArray list_bill_by_object_group(id, x_trace_id, limit, page) +List all bills with this object group. + +List all bills with this object group. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the account. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::BillArray**](BillArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_object_groups + +> models::ObjectGroupArray list_object_groups(x_trace_id, limit, page) +List all oject groups. + +List all oject groups. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::ObjectGroupArray**](ObjectGroupArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_piggy_bank_by_object_group + +> models::PiggyBankArray list_piggy_bank_by_object_group(id, x_trace_id, limit, page) +List all piggy banks related to the object group. + +This endpoint returns a list of all the piggy banks connected to the object group. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the account. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::PiggyBankArray**](PiggyBankArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_object_group + +> models::ObjectGroupSingle update_object_group(id, object_group_update, x_trace_id) +Update existing object group. + +Update existing object group. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the object group | [required] | +**object_group_update** | [**ObjectGroupUpdate**](ObjectGroupUpdate.md) | JSON array with updated piggy bank information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::ObjectGroupSingle**](ObjectGroupSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/ObjectLink.md b/firefly-iii-api/docs/ObjectLink.md new file mode 100644 index 0000000..77511aa --- /dev/null +++ b/firefly-iii-api/docs/ObjectLink.md @@ -0,0 +1,12 @@ +# ObjectLink + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param_0** | Option<[**models::ObjectLink0**](ObjectLink_0.md)> | | [optional] +**param_self** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/ObjectLink0.md b/firefly-iii-api/docs/ObjectLink0.md new file mode 100644 index 0000000..8933294 --- /dev/null +++ b/firefly-iii-api/docs/ObjectLink0.md @@ -0,0 +1,12 @@ +# ObjectLink0 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rel** | Option<**String**> | | [optional] +**uri** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PageLink.md b/firefly-iii-api/docs/PageLink.md new file mode 100644 index 0000000..bc1b15c --- /dev/null +++ b/firefly-iii-api/docs/PageLink.md @@ -0,0 +1,15 @@ +# PageLink + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param_self** | Option<**String**> | | [optional] +**first** | Option<**String**> | | [optional] +**next** | Option<**String**> | | [optional] +**prev** | Option<**String**> | | [optional] +**last** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PiggyBank.md b/firefly-iii-api/docs/PiggyBank.md new file mode 100644 index 0000000..b3899b7 --- /dev/null +++ b/firefly-iii-api/docs/PiggyBank.md @@ -0,0 +1,32 @@ +# PiggyBank + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**account_id** | **String** | The ID of the asset account this piggy bank is connected to. | +**account_name** | Option<**String**> | The name of the asset account this piggy bank is connected to. | [optional][readonly] +**name** | **String** | | +**currency_id** | Option<**String**> | | [optional][readonly] +**currency_code** | Option<**String**> | | [optional][readonly] +**currency_symbol** | Option<**String**> | | [optional][readonly] +**currency_decimal_places** | Option<**i32**> | Number of decimals supported by the currency | [optional][readonly] +**target_amount** | Option<**String**> | | +**percentage** | Option<**f32**> | | [optional][readonly] +**current_amount** | Option<**String**> | | [optional] +**left_to_save** | Option<**String**> | | [optional][readonly] +**save_per_month** | Option<**String**> | | [optional][readonly] +**start_date** | Option<[**String**](string.md)> | The date you started with this piggy bank. | [optional] +**target_date** | Option<[**String**](string.md)> | The date you intend to finish saving money. | [optional] +**order** | Option<**i32**> | | [optional] +**active** | Option<**bool**> | | [optional][readonly] +**notes** | Option<**String**> | | [optional] +**object_group_id** | Option<**String**> | The group ID of the group this object is part of. NULL if no group. | [optional] +**object_group_order** | Option<**i32**> | The order of the group. At least 1, for the highest sorting. | [optional][readonly] +**object_group_title** | Option<**String**> | The name of the group. NULL if no group. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PiggyBankArray.md b/firefly-iii-api/docs/PiggyBankArray.md new file mode 100644 index 0000000..4344eef --- /dev/null +++ b/firefly-iii-api/docs/PiggyBankArray.md @@ -0,0 +1,13 @@ +# PiggyBankArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](PiggyBankRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | +**links** | [**models::PageLink**](PageLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PiggyBankEvent.md b/firefly-iii-api/docs/PiggyBankEvent.md new file mode 100644 index 0000000..d4b09b7 --- /dev/null +++ b/firefly-iii-api/docs/PiggyBankEvent.md @@ -0,0 +1,19 @@ +# PiggyBankEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional] +**updated_at** | Option<**String**> | | [optional] +**currency_id** | Option<**String**> | | [optional] +**currency_code** | Option<**String**> | | [optional] +**currency_symbol** | Option<**String**> | | [optional] +**currency_decimal_places** | Option<**i32**> | | [optional] +**amount** | Option<**String**> | | [optional] +**transaction_journal_id** | Option<**String**> | The journal associated with the event. | [optional] +**transaction_group_id** | Option<**String**> | The transaction group associated with the event. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PiggyBankEventArray.md b/firefly-iii-api/docs/PiggyBankEventArray.md new file mode 100644 index 0000000..7ab15dd --- /dev/null +++ b/firefly-iii-api/docs/PiggyBankEventArray.md @@ -0,0 +1,13 @@ +# PiggyBankEventArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](PiggyBankEventRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | +**links** | [**models::PageLink**](PageLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PiggyBankEventRead.md b/firefly-iii-api/docs/PiggyBankEventRead.md new file mode 100644 index 0000000..4621a34 --- /dev/null +++ b/firefly-iii-api/docs/PiggyBankEventRead.md @@ -0,0 +1,14 @@ +# PiggyBankEventRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::PiggyBankEvent**](PiggyBankEvent.md) | | +**links** | [**models::ObjectLink**](ObjectLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PiggyBankRead.md b/firefly-iii-api/docs/PiggyBankRead.md new file mode 100644 index 0000000..4428517 --- /dev/null +++ b/firefly-iii-api/docs/PiggyBankRead.md @@ -0,0 +1,14 @@ +# PiggyBankRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::PiggyBank**](PiggyBank.md) | | +**links** | [**models::ObjectLink**](ObjectLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PiggyBankSingle.md b/firefly-iii-api/docs/PiggyBankSingle.md new file mode 100644 index 0000000..b6436fc --- /dev/null +++ b/firefly-iii-api/docs/PiggyBankSingle.md @@ -0,0 +1,11 @@ +# PiggyBankSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::PiggyBankRead**](PiggyBankRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PiggyBankStore.md b/firefly-iii-api/docs/PiggyBankStore.md new file mode 100644 index 0000000..70c6fc1 --- /dev/null +++ b/firefly-iii-api/docs/PiggyBankStore.md @@ -0,0 +1,21 @@ +# PiggyBankStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**account_id** | **String** | The ID of the asset account this piggy bank is connected to. | +**target_amount** | Option<**String**> | | +**current_amount** | Option<**String**> | | [optional] +**start_date** | Option<[**String**](string.md)> | The date you started with this piggy bank. | [optional] +**target_date** | Option<[**String**](string.md)> | The date you intend to finish saving money. | [optional] +**order** | Option<**i32**> | | [optional] +**active** | Option<**bool**> | | [optional][readonly] +**notes** | Option<**String**> | | [optional] +**object_group_id** | Option<**String**> | The group ID of the group this object is part of. NULL if no group. | [optional] +**object_group_title** | Option<**String**> | The name of the group. NULL if no group. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PiggyBankUpdate.md b/firefly-iii-api/docs/PiggyBankUpdate.md new file mode 100644 index 0000000..9bc3147 --- /dev/null +++ b/firefly-iii-api/docs/PiggyBankUpdate.md @@ -0,0 +1,23 @@ +# PiggyBankUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | | [optional] +**account_id** | Option<**String**> | The ID of the asset account this piggy bank is connected to. | [optional] +**currency_id** | Option<**String**> | | [optional][readonly] +**currency_code** | Option<**String**> | | [optional][readonly] +**target_amount** | Option<**String**> | | [optional] +**current_amount** | Option<**String**> | | [optional] +**start_date** | Option<[**String**](string.md)> | The date you started with this piggy bank. | [optional] +**target_date** | Option<[**String**](string.md)> | The date you intend to finish saving money. | [optional] +**order** | Option<**i32**> | | [optional] +**active** | Option<**bool**> | | [optional][readonly] +**notes** | Option<**String**> | | [optional] +**object_group_id** | Option<**String**> | The group ID of the group this object is part of. NULL if no group. | [optional] +**object_group_title** | Option<**String**> | The name of the group. NULL if no group. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PiggyBanksApi.md b/firefly-iii-api/docs/PiggyBanksApi.md new file mode 100644 index 0000000..2d5affe --- /dev/null +++ b/firefly-iii-api/docs/PiggyBanksApi.md @@ -0,0 +1,238 @@ +# \PiggyBanksApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_piggy_bank**](PiggyBanksApi.md#delete_piggy_bank) | **DELETE** /v1/piggy-banks/{id} | Delete a piggy bank. +[**get_piggy_bank**](PiggyBanksApi.md#get_piggy_bank) | **GET** /v1/piggy-banks/{id} | Get a single piggy bank. +[**list_attachment_by_piggy_bank**](PiggyBanksApi.md#list_attachment_by_piggy_bank) | **GET** /v1/piggy-banks/{id}/attachments | Lists all attachments. +[**list_event_by_piggy_bank**](PiggyBanksApi.md#list_event_by_piggy_bank) | **GET** /v1/piggy-banks/{id}/events | List all events linked to a piggy bank. +[**list_piggy_bank**](PiggyBanksApi.md#list_piggy_bank) | **GET** /v1/piggy-banks | List all piggy banks. +[**store_piggy_bank**](PiggyBanksApi.md#store_piggy_bank) | **POST** /v1/piggy-banks | Store a new piggy bank +[**update_piggy_bank**](PiggyBanksApi.md#update_piggy_bank) | **PUT** /v1/piggy-banks/{id} | Update existing piggy bank. + + + +## delete_piggy_bank + +> delete_piggy_bank(id, x_trace_id) +Delete a piggy bank. + +Delete a piggy bank. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the piggy bank. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_piggy_bank + +> models::PiggyBankSingle get_piggy_bank(id, x_trace_id) +Get a single piggy bank. + +Get a single piggy bank. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the piggy bank. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::PiggyBankSingle**](PiggyBankSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_attachment_by_piggy_bank + +> models::AttachmentArray list_attachment_by_piggy_bank(id, x_trace_id, limit, page) +Lists all attachments. + +Lists all attachments. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the piggy bank. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::AttachmentArray**](AttachmentArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_event_by_piggy_bank + +> models::PiggyBankEventArray list_event_by_piggy_bank(id, x_trace_id, limit, page) +List all events linked to a piggy bank. + +List all events linked to a piggy bank (adding and removing money). + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the piggy bank | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::PiggyBankEventArray**](PiggyBankEventArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_piggy_bank + +> models::PiggyBankArray list_piggy_bank(x_trace_id, limit, page) +List all piggy banks. + +List all piggy banks. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::PiggyBankArray**](PiggyBankArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_piggy_bank + +> models::PiggyBankSingle store_piggy_bank(piggy_bank_store, x_trace_id) +Store a new piggy bank + +Creates a new piggy bank. The data required can be submitted as a JSON body or as a list of parameters. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**piggy_bank_store** | [**PiggyBankStore**](PiggyBankStore.md) | JSON array or key=value pairs with the necessary piggy bank information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::PiggyBankSingle**](PiggyBankSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_piggy_bank + +> models::PiggyBankSingle update_piggy_bank(id, piggy_bank_update, x_trace_id) +Update existing piggy bank. + +Update existing piggy bank. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the piggy bank | [required] | +**piggy_bank_update** | [**PiggyBankUpdate**](PiggyBankUpdate.md) | JSON array with updated piggy bank information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::PiggyBankSingle**](PiggyBankSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/PolymorphicProperty.md b/firefly-iii-api/docs/PolymorphicProperty.md new file mode 100644 index 0000000..375e028 --- /dev/null +++ b/firefly-iii-api/docs/PolymorphicProperty.md @@ -0,0 +1,14 @@ +# PolymorphicProperty + +## Enum Variants + +| Name | Description | +|---- | -----| +| String | | +| Vec | | +| bool | | +| serde_json::Value | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/Preference.md b/firefly-iii-api/docs/Preference.md new file mode 100644 index 0000000..2939806 --- /dev/null +++ b/firefly-iii-api/docs/Preference.md @@ -0,0 +1,14 @@ +# Preference + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**name** | **String** | | +**data** | [**models::PolymorphicProperty**](PolymorphicProperty.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PreferenceArray.md b/firefly-iii-api/docs/PreferenceArray.md new file mode 100644 index 0000000..dc363e9 --- /dev/null +++ b/firefly-iii-api/docs/PreferenceArray.md @@ -0,0 +1,13 @@ +# PreferenceArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](PreferenceRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | +**links** | [**models::PageLink**](PageLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PreferenceRead.md b/firefly-iii-api/docs/PreferenceRead.md new file mode 100644 index 0000000..ac46634 --- /dev/null +++ b/firefly-iii-api/docs/PreferenceRead.md @@ -0,0 +1,13 @@ +# PreferenceRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::Preference**](Preference.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PreferenceSingle.md b/firefly-iii-api/docs/PreferenceSingle.md new file mode 100644 index 0000000..51d892f --- /dev/null +++ b/firefly-iii-api/docs/PreferenceSingle.md @@ -0,0 +1,11 @@ +# PreferenceSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::PreferenceRead**](PreferenceRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PreferenceUpdate.md b/firefly-iii-api/docs/PreferenceUpdate.md new file mode 100644 index 0000000..ddf8784 --- /dev/null +++ b/firefly-iii-api/docs/PreferenceUpdate.md @@ -0,0 +1,11 @@ +# PreferenceUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::PolymorphicProperty**](PolymorphicProperty.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/PreferencesApi.md b/firefly-iii-api/docs/PreferencesApi.md new file mode 100644 index 0000000..c413f15 --- /dev/null +++ b/firefly-iii-api/docs/PreferencesApi.md @@ -0,0 +1,138 @@ +# \PreferencesApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_preference**](PreferencesApi.md#get_preference) | **GET** /v1/preferences/{name} | Return a single preference. +[**list_preference**](PreferencesApi.md#list_preference) | **GET** /v1/preferences | List all users preferences. +[**store_preference**](PreferencesApi.md#store_preference) | **POST** /v1/preferences | Store a new preference for this user. +[**update_preference**](PreferencesApi.md#update_preference) | **PUT** /v1/preferences/{name} | Update preference + + + +## get_preference + +> models::PreferenceSingle get_preference(name, x_trace_id) +Return a single preference. + +Return a single preference and the value. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**name** | **String** | The name of the preference. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::PreferenceSingle**](PreferenceSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_preference + +> models::PreferenceArray list_preference(x_trace_id, limit, page) +List all users preferences. + +List all of the preferences of the user. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::PreferenceArray**](PreferenceArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_preference + +> models::PreferenceSingle store_preference(preference, x_trace_id) +Store a new preference for this user. + +This endpoint creates a new preference. The name and data are free-format, and entirely up to you. If the preference is not used in Firefly III itself it may not be configurable through the user interface, but you can use this endpoint to persist custom data for your own app. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**preference** | [**Preference**](Preference.md) | JSON array with the necessary preference information or key=value pairs. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::PreferenceSingle**](PreferenceSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_preference + +> models::PreferenceSingle update_preference(name, preference_update, x_trace_id) +Update preference + +Update a user's preference. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**name** | **String** | The name of the preference. Will always overwrite. Will be created if it does not exist. | [required] | +**preference_update** | [**PreferenceUpdate**](PreferenceUpdate.md) | JSON array or key=value pairs with the necessary preference information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::PreferenceSingle**](PreferenceSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/Recurrence.md b/firefly-iii-api/docs/Recurrence.md new file mode 100644 index 0000000..9cd7b58 --- /dev/null +++ b/firefly-iii-api/docs/Recurrence.md @@ -0,0 +1,24 @@ +# Recurrence + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**r#type** | Option<[**models::RecurrenceTransactionType**](RecurrenceTransactionType.md)> | | [optional] +**title** | Option<**String**> | | [optional] +**description** | Option<**String**> | Not to be confused with the description of the actual transaction(s) being created. | [optional] +**first_date** | Option<[**String**](string.md)> | First time the recurring transaction will fire. Must be after today. | [optional] +**latest_date** | Option<[**String**](string.md)> | Last time the recurring transaction has fired. | [optional][readonly] +**repeat_until** | Option<[**String**](string.md)> | Date until the recurring transaction can fire. Use either this field or repetitions. | [optional] +**nr_of_repetitions** | Option<**i32**> | Max number of created transactions. Use either this field or repeat_until. | [optional] +**apply_rules** | Option<**bool**> | Whether or not to fire the rules after the creation of a transaction. | [optional] +**active** | Option<**bool**> | If the recurrence is even active. | [optional] +**notes** | Option<**String**> | | [optional] +**repetitions** | Option<[**Vec**](RecurrenceRepetition.md)> | | [optional] +**transactions** | Option<[**Vec**](RecurrenceTransaction.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RecurrenceArray.md b/firefly-iii-api/docs/RecurrenceArray.md new file mode 100644 index 0000000..08ba8d6 --- /dev/null +++ b/firefly-iii-api/docs/RecurrenceArray.md @@ -0,0 +1,13 @@ +# RecurrenceArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](RecurrenceRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | +**links** | [**models::PageLink**](PageLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RecurrenceRead.md b/firefly-iii-api/docs/RecurrenceRead.md new file mode 100644 index 0000000..f49f060 --- /dev/null +++ b/firefly-iii-api/docs/RecurrenceRead.md @@ -0,0 +1,14 @@ +# RecurrenceRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::Recurrence**](Recurrence.md) | | +**links** | [**models::ObjectLink**](ObjectLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RecurrenceRepetition.md b/firefly-iii-api/docs/RecurrenceRepetition.md new file mode 100644 index 0000000..0675a15 --- /dev/null +++ b/firefly-iii-api/docs/RecurrenceRepetition.md @@ -0,0 +1,19 @@ +# RecurrenceRepetition + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**String**> | | [optional][readonly] +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**r#type** | [**models::RecurrenceRepetitionType**](RecurrenceRepetitionType.md) | | +**moment** | **String** | Information that defined the type of repetition. - For 'daily', this is empty. - For 'weekly', it is day of the week between 1 and 7 (Monday - Sunday). - For 'ndom', it is '1,2' or '4,5' or something else, where the first number is the week in the month, and the second number is the day in the week (between 1 and 7). '2,3' means: the 2nd Wednesday of the month - For 'monthly' it is the day of the month (1 - 31) - For yearly, it is a full date, ie '2018-09-17'. The year you use does not matter. | +**skip** | Option<**i32**> | How many occurrences to skip. 0 means skip nothing. 1 means every other. | [optional] +**weekend** | Option<**i32**> | How to respond when the recurring transaction falls in the weekend. Possible values: 1. Do nothing, just create it 2. Create no transaction. 3. Skip to the previous Friday. 4. Skip to the next Monday. | [optional] +**description** | Option<**String**> | Auto-generated repetition description. | [optional][readonly] +**occurrences** | Option<**Vec**> | Array of future dates when the repetition will apply to. Auto generated. | [optional][readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RecurrenceRepetitionStore.md b/firefly-iii-api/docs/RecurrenceRepetitionStore.md new file mode 100644 index 0000000..cf67f90 --- /dev/null +++ b/firefly-iii-api/docs/RecurrenceRepetitionStore.md @@ -0,0 +1,14 @@ +# RecurrenceRepetitionStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | [**models::RecurrenceRepetitionType**](RecurrenceRepetitionType.md) | | +**moment** | **String** | Information that defined the type of repetition. - For 'daily', this is empty. - For 'weekly', it is day of the week between 1 and 7 (Monday - Sunday). - For 'ndom', it is '1,2' or '4,5' or something else, where the first number is the week in the month, and the second number is the day in the week (between 1 and 7). '2,3' means: the 2nd Wednesday of the month - For 'monthly' it is the day of the month (1 - 31) - For yearly, it is a full date, ie '2018-09-17'. The year you use does not matter. | +**skip** | Option<**i32**> | How many occurrences to skip. 0 means skip nothing. 1 means every other. | [optional] +**weekend** | Option<**i32**> | How to respond when the recurring transaction falls in the weekend. Possible values: 1. Do nothing, just create it 2. Create no transaction. 3. Skip to the previous Friday. 4. Skip to the next Monday. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RecurrenceRepetitionType.md b/firefly-iii-api/docs/RecurrenceRepetitionType.md new file mode 100644 index 0000000..6b61c7a --- /dev/null +++ b/firefly-iii-api/docs/RecurrenceRepetitionType.md @@ -0,0 +1,16 @@ +# RecurrenceRepetitionType + +## Enum Variants + +| Name | Value | +|---- | -----| +| Daily | daily | +| Weekly | weekly | +| Ndom | ndom | +| Monthly | monthly | +| Yearly | yearly | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RecurrenceRepetitionUpdate.md b/firefly-iii-api/docs/RecurrenceRepetitionUpdate.md new file mode 100644 index 0000000..564ed36 --- /dev/null +++ b/firefly-iii-api/docs/RecurrenceRepetitionUpdate.md @@ -0,0 +1,14 @@ +# RecurrenceRepetitionUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | Option<[**models::RecurrenceRepetitionType**](RecurrenceRepetitionType.md)> | | [optional] +**moment** | Option<**String**> | Information that defined the type of repetition. - For 'daily', this is empty. - For 'weekly', it is day of the week between 1 and 7 (Monday - Sunday). - For 'ndom', it is '1,2' or '4,5' or something else, where the first number is the week in the month, and the second number is the day in the week (between 1 and 7). '2,3' means: the 2nd Wednesday of the month - For 'monthly' it is the day of the month (1 - 31) - For yearly, it is a full date, ie '2018-09-17'. The year you use does not matter. | [optional] +**skip** | Option<**i32**> | How many occurrences to skip. 0 means skip nothing. 1 means every other. | [optional] +**weekend** | Option<**i32**> | How to respond when the recurring transaction falls in the weekend. Possible values: 1. Do nothing, just create it 2. Create no transaction. 3. Skip to the previous Friday. 4. Skip to the next Monday. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RecurrenceSingle.md b/firefly-iii-api/docs/RecurrenceSingle.md new file mode 100644 index 0000000..1455394 --- /dev/null +++ b/firefly-iii-api/docs/RecurrenceSingle.md @@ -0,0 +1,11 @@ +# RecurrenceSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::RecurrenceRead**](RecurrenceRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RecurrenceStore.md b/firefly-iii-api/docs/RecurrenceStore.md new file mode 100644 index 0000000..9869df9 --- /dev/null +++ b/firefly-iii-api/docs/RecurrenceStore.md @@ -0,0 +1,21 @@ +# RecurrenceStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | [**models::RecurrenceTransactionType**](RecurrenceTransactionType.md) | | +**title** | **String** | | +**description** | Option<**String**> | Not to be confused with the description of the actual transaction(s) being created. | [optional] +**first_date** | [**String**](string.md) | First time the recurring transaction will fire. Must be after today. | +**repeat_until** | Option<[**String**](string.md)> | Date until the recurring transaction can fire. Use either this field or repetitions. | +**nr_of_repetitions** | Option<**i32**> | Max number of created transactions. Use either this field or repeat_until. | [optional] +**apply_rules** | Option<**bool**> | Whether or not to fire the rules after the creation of a transaction. | [optional] +**active** | Option<**bool**> | If the recurrence is even active. | [optional] +**notes** | Option<**String**> | | [optional] +**repetitions** | [**Vec**](RecurrenceRepetitionStore.md) | | +**transactions** | [**Vec**](RecurrenceTransactionStore.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RecurrenceTransaction.md b/firefly-iii-api/docs/RecurrenceTransaction.md new file mode 100644 index 0000000..410331f --- /dev/null +++ b/firefly-iii-api/docs/RecurrenceTransaction.md @@ -0,0 +1,39 @@ +# RecurrenceTransaction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**String**> | | [optional] +**description** | **String** | | +**amount** | **String** | Amount of the transaction. | +**foreign_amount** | Option<**String**> | Foreign amount of the transaction. | [optional] +**currency_id** | Option<**String**> | Submit either a currency_id or a currency_code. | [optional] +**currency_code** | Option<**String**> | Submit either a currency_id or a currency_code. | [optional] +**currency_symbol** | Option<**String**> | | [optional][readonly] +**currency_decimal_places** | Option<**i32**> | Number of decimals in the currency | [optional][readonly] +**foreign_currency_id** | Option<**String**> | Submit either a foreign_currency_id or a foreign_currency_code, or neither. | [optional] +**foreign_currency_code** | Option<**String**> | Submit either a foreign_currency_id or a foreign_currency_code, or neither. | [optional] +**foreign_currency_symbol** | Option<**String**> | | [optional][readonly] +**foreign_currency_decimal_places** | Option<**i32**> | Number of decimals in the currency | [optional][readonly] +**budget_id** | Option<**String**> | The budget ID for this transaction. | [optional] +**budget_name** | Option<**String**> | 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. | [optional][readonly] +**category_id** | Option<**String**> | Category ID for this transaction. | [optional] +**category_name** | Option<**String**> | Category name for this transaction. | [optional] +**source_id** | Option<**String**> | ID of the source account. Submit either this or source_name. | [optional] +**source_name** | Option<**String**> | Name of the source account. Submit either this or source_id. | [optional] +**source_iban** | Option<**String**> | | [optional][readonly] +**source_type** | Option<[**models::AccountTypeProperty**](AccountTypeProperty.md)> | | [optional] +**destination_id** | Option<**String**> | ID of the destination account. Submit either this or destination_name. | [optional] +**destination_name** | Option<**String**> | Name of the destination account. Submit either this or destination_id. | [optional] +**destination_iban** | Option<**String**> | | [optional][readonly] +**destination_type** | Option<[**models::AccountTypeProperty**](AccountTypeProperty.md)> | | [optional] +**tags** | Option<**Vec**> | Array of tags. | [optional] +**piggy_bank_id** | Option<**String**> | Optional. Use either this or the piggy_bank_name | [optional] +**piggy_bank_name** | Option<**String**> | Optional. Use either this or the piggy_bank_id | [optional] +**bill_id** | Option<**String**> | Optional. Use either this or the bill_name | [optional] +**bill_name** | Option<**String**> | Optional. Use either this or the bill_id | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RecurrenceTransactionStore.md b/firefly-iii-api/docs/RecurrenceTransactionStore.md new file mode 100644 index 0000000..bc254b7 --- /dev/null +++ b/firefly-iii-api/docs/RecurrenceTransactionStore.md @@ -0,0 +1,24 @@ +# RecurrenceTransactionStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **String** | | +**amount** | **String** | Amount of the transaction. | +**foreign_amount** | Option<**String**> | Foreign amount of the transaction. | [optional] +**currency_id** | Option<**String**> | Submit either a currency_id or a currency_code. | [optional] +**currency_code** | Option<**String**> | Submit either a currency_id or a currency_code. | [optional] +**foreign_currency_id** | Option<**String**> | Submit either a foreign_currency_id or a foreign_currency_code, or neither. | [optional] +**foreign_currency_code** | Option<**String**> | Submit either a foreign_currency_id or a foreign_currency_code, or neither. | [optional] +**budget_id** | Option<**String**> | The budget ID for this transaction. | [optional] +**category_id** | Option<**String**> | Category ID for this transaction. | [optional] +**source_id** | **String** | ID of the source account. | +**destination_id** | **String** | ID of the destination account. | +**tags** | Option<**Vec**> | Array of tags. | [optional] +**piggy_bank_id** | Option<**String**> | Optional. | [optional] +**bill_id** | Option<**String**> | Optional. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RecurrenceTransactionType.md b/firefly-iii-api/docs/RecurrenceTransactionType.md new file mode 100644 index 0000000..8665283 --- /dev/null +++ b/firefly-iii-api/docs/RecurrenceTransactionType.md @@ -0,0 +1,14 @@ +# RecurrenceTransactionType + +## Enum Variants + +| Name | Value | +|---- | -----| +| Withdrawal | withdrawal | +| Transfer | transfer | +| Deposit | deposit | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RecurrenceTransactionUpdate.md b/firefly-iii-api/docs/RecurrenceTransactionUpdate.md new file mode 100644 index 0000000..bd6f82b --- /dev/null +++ b/firefly-iii-api/docs/RecurrenceTransactionUpdate.md @@ -0,0 +1,24 @@ +# RecurrenceTransactionUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**description** | Option<**String**> | | [optional] +**amount** | Option<**String**> | Amount of the transaction. | [optional] +**foreign_amount** | Option<**String**> | Foreign amount of the transaction. | [optional] +**currency_id** | Option<**String**> | Submit either a currency_id or a currency_code. | [optional] +**currency_code** | Option<**String**> | Submit either a currency_id or a currency_code. | [optional] +**foreign_currency_id** | Option<**String**> | Submit either a foreign_currency_id or a foreign_currency_code, or neither. | [optional] +**budget_id** | Option<**String**> | The budget ID for this transaction. | [optional] +**category_id** | Option<**String**> | Category ID for this transaction. | [optional] +**source_id** | Option<**String**> | ID of the source account. Submit either this or source_name. | [optional] +**destination_id** | Option<**String**> | ID of the destination account. Submit either this or destination_name. | [optional] +**tags** | Option<**Vec**> | Array of tags. | [optional] +**piggy_bank_id** | Option<**String**> | | [optional] +**bill_id** | Option<**String**> | Optional. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RecurrenceUpdate.md b/firefly-iii-api/docs/RecurrenceUpdate.md new file mode 100644 index 0000000..c442725 --- /dev/null +++ b/firefly-iii-api/docs/RecurrenceUpdate.md @@ -0,0 +1,20 @@ +# RecurrenceUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | Option<**String**> | | [optional] +**description** | Option<**String**> | Not to be confused with the description of the actual transaction(s) being created. | [optional] +**first_date** | Option<[**String**](string.md)> | First time the recurring transaction will fire. | [optional] +**repeat_until** | Option<[**String**](string.md)> | Date until the recurring transaction can fire. After that date, it's basically inactive. Use either this field or repetitions. | [optional] +**nr_of_repetitions** | Option<**i32**> | Max number of created transactions. Use either this field or repeat_until. | [optional] +**apply_rules** | Option<**bool**> | Whether or not to fire the rules after the creation of a transaction. | [optional] +**active** | Option<**bool**> | If the recurrence is even active. | [optional] +**notes** | Option<**String**> | | [optional] +**repetitions** | Option<[**Vec**](RecurrenceRepetitionUpdate.md)> | | [optional] +**transactions** | Option<[**Vec**](RecurrenceTransactionUpdate.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RecurrencesApi.md b/firefly-iii-api/docs/RecurrencesApi.md new file mode 100644 index 0000000..51902e7 --- /dev/null +++ b/firefly-iii-api/docs/RecurrencesApi.md @@ -0,0 +1,207 @@ +# \RecurrencesApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_recurrence**](RecurrencesApi.md#delete_recurrence) | **DELETE** /v1/recurrences/{id} | Delete a recurring transaction. +[**get_recurrence**](RecurrencesApi.md#get_recurrence) | **GET** /v1/recurrences/{id} | Get a single recurring transaction. +[**list_recurrence**](RecurrencesApi.md#list_recurrence) | **GET** /v1/recurrences | List all recurring transactions. +[**list_transaction_by_recurrence**](RecurrencesApi.md#list_transaction_by_recurrence) | **GET** /v1/recurrences/{id}/transactions | List all transactions created by a recurring transaction. +[**store_recurrence**](RecurrencesApi.md#store_recurrence) | **POST** /v1/recurrences | Store a new recurring transaction +[**update_recurrence**](RecurrencesApi.md#update_recurrence) | **PUT** /v1/recurrences/{id} | Update existing recurring transaction. + + + +## delete_recurrence + +> delete_recurrence(id, x_trace_id) +Delete a recurring transaction. + +Delete a recurring transaction. Transactions created by the recurring transaction will not be deleted. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the recurring transaction. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_recurrence + +> models::RecurrenceSingle get_recurrence(id, x_trace_id) +Get a single recurring transaction. + +Get a single recurring transaction. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the recurring transaction. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::RecurrenceSingle**](RecurrenceSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_recurrence + +> models::RecurrenceArray list_recurrence(x_trace_id, limit, page) +List all recurring transactions. + +List all recurring transactions. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::RecurrenceArray**](RecurrenceArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_transaction_by_recurrence + +> models::TransactionArray list_transaction_by_recurrence(id, x_trace_id, limit, page, start, end, r#type) +List all transactions created by a recurring transaction. + +List all transactions created by a recurring transaction, optionally limited to the date ranges specified. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the recurring transaction. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD. Both the start and end date must be present. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD. Both the start and end date must be present. | | +**r#type** | Option<[**TransactionTypeFilter**](.md)> | Optional filter on the transaction type(s) returned | | + +### Return type + +[**models::TransactionArray**](TransactionArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_recurrence + +> models::RecurrenceSingle store_recurrence(recurrence_store, x_trace_id) +Store a new recurring transaction + +Creates a new recurring transaction. The data required can be submitted as a JSON body or as a list of parameters. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**recurrence_store** | [**RecurrenceStore**](RecurrenceStore.md) | JSON array or key=value pairs with the necessary recurring transaction information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::RecurrenceSingle**](RecurrenceSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_recurrence + +> models::RecurrenceSingle update_recurrence(id, recurrence_update, x_trace_id) +Update existing recurring transaction. + +Update existing recurring transaction. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the recurring transaction. | [required] | +**recurrence_update** | [**RecurrenceUpdate**](RecurrenceUpdate.md) | JSON array with updated recurring transaction information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::RecurrenceSingle**](RecurrenceSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/Rule.md b/firefly-iii-api/docs/Rule.md new file mode 100644 index 0000000..c9fb4af --- /dev/null +++ b/firefly-iii-api/docs/Rule.md @@ -0,0 +1,23 @@ +# Rule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**title** | **String** | | +**description** | Option<**String**> | | [optional] +**rule_group_id** | **String** | ID of the rule group under which the rule must be stored. Either this field or rule_group_title is mandatory. | +**rule_group_title** | Option<**String**> | Title of the rule group under which the rule must be stored. Either this field or rule_group_id is mandatory. | [optional] +**order** | Option<**i32**> | | [optional][readonly] +**trigger** | [**models::RuleTriggerType**](RuleTriggerType.md) | | +**active** | Option<**bool**> | Whether or not the rule is even active. Default is true. | [optional][default to true] +**strict** | Option<**bool**> | If the rule is set to be strict, ALL triggers must hit in order for the rule to fire. Otherwise, just one is enough. Default value is true. | [optional] +**stop_processing** | Option<**bool**> | If this value is true and the rule is triggered, other rules after this one in the group will be skipped. Default value is false. | [optional][default to false] +**triggers** | [**Vec**](RuleTrigger.md) | | +**actions** | [**Vec**](RuleAction.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleAction.md b/firefly-iii-api/docs/RuleAction.md new file mode 100644 index 0000000..9c53f55 --- /dev/null +++ b/firefly-iii-api/docs/RuleAction.md @@ -0,0 +1,18 @@ +# RuleAction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**String**> | | [optional][readonly] +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**r#type** | [**models::RuleActionKeyword**](RuleActionKeyword.md) | | +**value** | Option<**String**> | The accompanying value the action will set, change or update. Can be empty, but for some types this value is mandatory. | +**order** | Option<**i32**> | Order of the action | [optional] +**active** | Option<**bool**> | If the action is active. Defaults to true. | [optional][default to true] +**stop_processing** | Option<**bool**> | When true, other actions will not be fired after this action has fired. Defaults to false. | [optional][default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleActionKeyword.md b/firefly-iii-api/docs/RuleActionKeyword.md new file mode 100644 index 0000000..c5dc83c --- /dev/null +++ b/firefly-iii-api/docs/RuleActionKeyword.md @@ -0,0 +1,33 @@ +# RuleActionKeyword + +## Enum Variants + +| Name | Value | +|---- | -----| +| UserAction | user_action | +| SetCategory | set_category | +| ClearCategory | clear_category | +| SetBudget | set_budget | +| ClearBudget | clear_budget | +| AddTag | add_tag | +| RemoveTag | remove_tag | +| RemoveAllTags | remove_all_tags | +| SetDescription | set_description | +| AppendDescription | append_description | +| PrependDescription | prepend_description | +| SetSourceAccount | set_source_account | +| SetDestinationAccount | set_destination_account | +| SetNotes | set_notes | +| AppendNotes | append_notes | +| PrependNotes | prepend_notes | +| ClearNotes | clear_notes | +| LinkToBill | link_to_bill | +| ConvertWithdrawal | convert_withdrawal | +| ConvertDeposit | convert_deposit | +| ConvertTransfer | convert_transfer | +| DeleteTransaction | delete_transaction | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleActionStore.md b/firefly-iii-api/docs/RuleActionStore.md new file mode 100644 index 0000000..dcd397d --- /dev/null +++ b/firefly-iii-api/docs/RuleActionStore.md @@ -0,0 +1,15 @@ +# RuleActionStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | [**models::RuleActionKeyword**](RuleActionKeyword.md) | | +**value** | Option<**String**> | The accompanying value the action will set, change or update. Can be empty, but for some types this value is mandatory. | +**order** | Option<**i32**> | Order of the action | [optional] +**active** | Option<**bool**> | If the action is active. Defaults to true. | [optional][default to true] +**stop_processing** | Option<**bool**> | When true, other actions will not be fired after this action has fired. Defaults to false. | [optional][default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleActionUpdate.md b/firefly-iii-api/docs/RuleActionUpdate.md new file mode 100644 index 0000000..771258c --- /dev/null +++ b/firefly-iii-api/docs/RuleActionUpdate.md @@ -0,0 +1,15 @@ +# RuleActionUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | Option<[**models::RuleActionKeyword**](RuleActionKeyword.md)> | | [optional] +**value** | Option<**String**> | The accompanying value the action will set, change or update. Can be empty, but for some types this value is mandatory. | [optional] +**order** | Option<**i32**> | Order of the action | [optional] +**active** | Option<**bool**> | If the action is active. | [optional] +**stop_processing** | Option<**bool**> | When true, other actions will not be fired after this action has fired. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleArray.md b/firefly-iii-api/docs/RuleArray.md new file mode 100644 index 0000000..8352b8d --- /dev/null +++ b/firefly-iii-api/docs/RuleArray.md @@ -0,0 +1,13 @@ +# RuleArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](RuleRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | +**links** | [**models::PageLink**](PageLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleGroup.md b/firefly-iii-api/docs/RuleGroup.md new file mode 100644 index 0000000..c5111d7 --- /dev/null +++ b/firefly-iii-api/docs/RuleGroup.md @@ -0,0 +1,16 @@ +# RuleGroup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**title** | **String** | | +**description** | Option<**String**> | | [optional] +**order** | Option<**i32**> | | [optional][readonly] +**active** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleGroupArray.md b/firefly-iii-api/docs/RuleGroupArray.md new file mode 100644 index 0000000..5159a89 --- /dev/null +++ b/firefly-iii-api/docs/RuleGroupArray.md @@ -0,0 +1,13 @@ +# RuleGroupArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](RuleGroupRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | +**links** | [**models::PageLink**](PageLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleGroupRead.md b/firefly-iii-api/docs/RuleGroupRead.md new file mode 100644 index 0000000..e89ead9 --- /dev/null +++ b/firefly-iii-api/docs/RuleGroupRead.md @@ -0,0 +1,14 @@ +# RuleGroupRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::RuleGroup**](RuleGroup.md) | | +**links** | [**models::ObjectLink**](ObjectLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleGroupSingle.md b/firefly-iii-api/docs/RuleGroupSingle.md new file mode 100644 index 0000000..c7711dc --- /dev/null +++ b/firefly-iii-api/docs/RuleGroupSingle.md @@ -0,0 +1,11 @@ +# RuleGroupSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::RuleGroupRead**](RuleGroupRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleGroupStore.md b/firefly-iii-api/docs/RuleGroupStore.md new file mode 100644 index 0000000..c47a37c --- /dev/null +++ b/firefly-iii-api/docs/RuleGroupStore.md @@ -0,0 +1,14 @@ +# RuleGroupStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **String** | | +**description** | Option<**String**> | | [optional] +**order** | Option<**i32**> | | [optional] +**active** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleGroupUpdate.md b/firefly-iii-api/docs/RuleGroupUpdate.md new file mode 100644 index 0000000..e2caff2 --- /dev/null +++ b/firefly-iii-api/docs/RuleGroupUpdate.md @@ -0,0 +1,14 @@ +# RuleGroupUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | Option<**String**> | | [optional] +**description** | Option<**String**> | | [optional] +**order** | Option<**i32**> | | [optional] +**active** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleGroupsApi.md b/firefly-iii-api/docs/RuleGroupsApi.md new file mode 100644 index 0000000..f05e613 --- /dev/null +++ b/firefly-iii-api/docs/RuleGroupsApi.md @@ -0,0 +1,278 @@ +# \RuleGroupsApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_rule_group**](RuleGroupsApi.md#delete_rule_group) | **DELETE** /v1/rule-groups/{id} | Delete a rule group. +[**fire_rule_group**](RuleGroupsApi.md#fire_rule_group) | **POST** /v1/rule-groups/{id}/trigger | Fire the rule group on your transactions. +[**get_rule_group**](RuleGroupsApi.md#get_rule_group) | **GET** /v1/rule-groups/{id} | Get a single rule group. +[**list_rule_by_group**](RuleGroupsApi.md#list_rule_by_group) | **GET** /v1/rule-groups/{id}/rules | List rules in this rule group. +[**list_rule_group**](RuleGroupsApi.md#list_rule_group) | **GET** /v1/rule-groups | List all rule groups. +[**store_rule_group**](RuleGroupsApi.md#store_rule_group) | **POST** /v1/rule-groups | Store a new rule group. +[**test_rule_group**](RuleGroupsApi.md#test_rule_group) | **GET** /v1/rule-groups/{id}/test | Test which transactions would be hit by the rule group. No changes will be made. +[**update_rule_group**](RuleGroupsApi.md#update_rule_group) | **PUT** /v1/rule-groups/{id} | Update existing rule group. + + + +## delete_rule_group + +> delete_rule_group(id, x_trace_id) +Delete a rule group. + +Delete a rule group. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the rule group. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## fire_rule_group + +> fire_rule_group(id, x_trace_id, start, end, accounts_left_square_bracket_right_square_bracket) +Fire the rule group on your transactions. + +Fire the rule group on your transactions. Changes will be made by the rules in the rule group! Limit the result if you want to. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the rule group. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD, to limit the transactions the actions will be applied to. Both the start date and the end date must be present. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD, to limit the transactions the actions will be applied to. Both the start date and the end date must be present. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | Limit the triggering of the rule group to these asset accounts or liabilities. Only asset accounts and liabilities will be accepted. Other types will be silently dropped. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_rule_group + +> models::RuleGroupSingle get_rule_group(id, x_trace_id) +Get a single rule group. + +Get a single rule group. This does not include the rules. For that, see below. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the rule group. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::RuleGroupSingle**](RuleGroupSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_rule_by_group + +> models::RuleArray list_rule_by_group(id, x_trace_id, limit, page) +List rules in this rule group. + +List rules in this rule group. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the rule group. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::RuleArray**](RuleArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_rule_group + +> models::RuleGroupArray list_rule_group(x_trace_id, limit, page) +List all rule groups. + +List all rule groups. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::RuleGroupArray**](RuleGroupArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_rule_group + +> models::RuleGroupSingle store_rule_group(rule_group_store, x_trace_id) +Store a new rule group. + +Creates a new rule group. The data required can be submitted as a JSON body or as a list of parameters. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**rule_group_store** | [**RuleGroupStore**](RuleGroupStore.md) | JSON array or key=value pairs with the necessary rule group information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::RuleGroupSingle**](RuleGroupSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## test_rule_group + +> models::TransactionArray test_rule_group(id, x_trace_id, limit, page, start, end, search_limit, triggered_limit, accounts_left_square_bracket_right_square_bracket) +Test which transactions would be hit by the rule group. No changes will be made. + +Test which transactions would be hit by the rule group. No changes will be made. Limit the result if you want to. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the rule group. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD, to limit the transactions the test will be applied to. Both the start date and the end date must be present. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD, to limit the transactions the test will be applied to. Both the start date and the end date must be present. | | +**search_limit** | Option<**i32**> | Maximum number of transactions Firefly III will try. Don't set this too high, or it will take Firefly III very long to run the test. I suggest a max of 200. | | +**triggered_limit** | Option<**i32**> | Maximum number of transactions the rule group can actually trigger on, before Firefly III stops. I would suggest setting this to 10 or 15. Don't go above the user's page size, because browsing to page 2 or 3 of a test result would fire the test again, making any navigation efforts very slow. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | Limit the testing of the rule group to these asset accounts or liabilities. Only asset accounts and liabilities will be accepted. Other types will be silently dropped. | | + +### Return type + +[**models::TransactionArray**](TransactionArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_rule_group + +> models::RuleGroupSingle update_rule_group(id, rule_group_update, x_trace_id) +Update existing rule group. + +Update existing rule group. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the rule group. | [required] | +**rule_group_update** | [**RuleGroupUpdate**](RuleGroupUpdate.md) | JSON array with updated rule group information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::RuleGroupSingle**](RuleGroupSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/RuleRead.md b/firefly-iii-api/docs/RuleRead.md new file mode 100644 index 0000000..151d135 --- /dev/null +++ b/firefly-iii-api/docs/RuleRead.md @@ -0,0 +1,14 @@ +# RuleRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::Rule**](Rule.md) | | +**links** | [**models::ObjectLink**](ObjectLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleSingle.md b/firefly-iii-api/docs/RuleSingle.md new file mode 100644 index 0000000..d696eb6 --- /dev/null +++ b/firefly-iii-api/docs/RuleSingle.md @@ -0,0 +1,11 @@ +# RuleSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::RuleRead**](RuleRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleStore.md b/firefly-iii-api/docs/RuleStore.md new file mode 100644 index 0000000..a5aa365 --- /dev/null +++ b/firefly-iii-api/docs/RuleStore.md @@ -0,0 +1,21 @@ +# RuleStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **String** | | +**description** | Option<**String**> | | [optional] +**rule_group_id** | **String** | ID of the rule group under which the rule must be stored. Either this field or rule_group_title is mandatory. | +**rule_group_title** | Option<**String**> | Title of the rule group under which the rule must be stored. Either this field or rule_group_id is mandatory. | [optional] +**order** | Option<**i32**> | | [optional] +**trigger** | [**models::RuleTriggerType**](RuleTriggerType.md) | | +**active** | Option<**bool**> | Whether or not the rule is even active. Default is true. | [optional][default to true] +**strict** | Option<**bool**> | If the rule is set to be strict, ALL triggers must hit in order for the rule to fire. Otherwise, just one is enough. Default value is true. | [optional][default to true] +**stop_processing** | Option<**bool**> | If this value is true and the rule is triggered, other rules after this one in the group will be skipped. Default value is false. | [optional] +**triggers** | [**Vec**](RuleTriggerStore.md) | | +**actions** | [**Vec**](RuleActionStore.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleTrigger.md b/firefly-iii-api/docs/RuleTrigger.md new file mode 100644 index 0000000..db2132e --- /dev/null +++ b/firefly-iii-api/docs/RuleTrigger.md @@ -0,0 +1,19 @@ +# RuleTrigger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**String**> | | [optional][readonly] +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**r#type** | [**models::RuleTriggerKeyword**](RuleTriggerKeyword.md) | | +**value** | **String** | The accompanying value the trigger responds to. This value is often mandatory, but this depends on the trigger. | +**prohibited** | Option<**bool**> | If 'prohibited' is true, this rule trigger will be negated. 'Description is' will become 'Description is NOT' etc. | [optional][default to false] +**order** | Option<**i32**> | Order of the trigger | [optional][readonly] +**active** | Option<**bool**> | If the trigger is active. Defaults to true. | [optional][default to true] +**stop_processing** | Option<**bool**> | When true, other triggers will not be checked if this trigger was triggered. Defaults to false. | [optional][default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleTriggerKeyword.md b/firefly-iii-api/docs/RuleTriggerKeyword.md new file mode 100644 index 0000000..5a95ffe --- /dev/null +++ b/firefly-iii-api/docs/RuleTriggerKeyword.md @@ -0,0 +1,47 @@ +# RuleTriggerKeyword + +## Enum Variants + +| Name | Value | +|---- | -----| +| FromAccountStarts | from_account_starts | +| FromAccountEnds | from_account_ends | +| FromAccountIs | from_account_is | +| FromAccountContains | from_account_contains | +| ToAccountStarts | to_account_starts | +| ToAccountEnds | to_account_ends | +| ToAccountIs | to_account_is | +| ToAccountContains | to_account_contains | +| AmountLess | amount_less | +| AmountExactly | amount_exactly | +| AmountMore | amount_more | +| DescriptionStarts | description_starts | +| DescriptionEnds | description_ends | +| DescriptionContains | description_contains | +| DescriptionIs | description_is | +| TransactionType | transaction_type | +| CategoryIs | category_is | +| BudgetIs | budget_is | +| TagIs | tag_is | +| CurrencyIs | currency_is | +| HasAttachments | has_attachments | +| HasNoCategory | has_no_category | +| HasAnyCategory | has_any_category | +| HasNoBudget | has_no_budget | +| HasAnyBudget | has_any_budget | +| HasNoTag | has_no_tag | +| HasAnyTag | has_any_tag | +| NotesContains | notes_contains | +| NotesStart | notes_start | +| NotesEnd | notes_end | +| NotesAre | notes_are | +| NoNotes | no_notes | +| AnyNotes | any_notes | +| SourceAccountIs | source_account_is | +| DestinationAccountIs | destination_account_is | +| SourceAccountStarts | source_account_starts | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleTriggerStore.md b/firefly-iii-api/docs/RuleTriggerStore.md new file mode 100644 index 0000000..b60f687 --- /dev/null +++ b/firefly-iii-api/docs/RuleTriggerStore.md @@ -0,0 +1,16 @@ +# RuleTriggerStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | [**models::RuleTriggerKeyword**](RuleTriggerKeyword.md) | | +**value** | **String** | The accompanying value the trigger responds to. This value is often mandatory, but this depends on the trigger. | +**order** | Option<**i32**> | Order of the trigger | [optional] +**active** | Option<**bool**> | If the trigger is active. Defaults to true. | [optional][default to true] +**prohibited** | Option<**bool**> | If 'prohibited' is true, this rule trigger will be negated. 'Description is' will become 'Description is NOT' etc. | [optional][default to false] +**stop_processing** | Option<**bool**> | When true, other triggers will not be checked if this trigger was triggered. Defaults to false. | [optional][default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleTriggerType.md b/firefly-iii-api/docs/RuleTriggerType.md new file mode 100644 index 0000000..bc84586 --- /dev/null +++ b/firefly-iii-api/docs/RuleTriggerType.md @@ -0,0 +1,13 @@ +# RuleTriggerType + +## Enum Variants + +| Name | Value | +|---- | -----| +| StoreJournal | store-journal | +| UpdateJournal | update-journal | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleTriggerUpdate.md b/firefly-iii-api/docs/RuleTriggerUpdate.md new file mode 100644 index 0000000..a5bea22 --- /dev/null +++ b/firefly-iii-api/docs/RuleTriggerUpdate.md @@ -0,0 +1,15 @@ +# RuleTriggerUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | Option<[**models::RuleTriggerKeyword**](RuleTriggerKeyword.md)> | | [optional] +**value** | Option<**String**> | The accompanying value the trigger responds to. This value is often mandatory, but this depends on the trigger. If the rule trigger is something like 'has any tag', submit the string 'true'. | [optional] +**order** | Option<**i32**> | Order of the trigger | [optional] +**active** | Option<**bool**> | If the trigger is active. | [optional] +**stop_processing** | Option<**bool**> | When true, other triggers will not be checked if this trigger was triggered. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RuleUpdate.md b/firefly-iii-api/docs/RuleUpdate.md new file mode 100644 index 0000000..ca680a5 --- /dev/null +++ b/firefly-iii-api/docs/RuleUpdate.md @@ -0,0 +1,20 @@ +# RuleUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | Option<**String**> | | [optional] +**description** | Option<**String**> | | [optional] +**rule_group_id** | Option<**String**> | ID of the rule group under which the rule must be stored. Either this field or rule_group_title is mandatory. | [optional] +**order** | Option<**i32**> | | [optional] +**trigger** | Option<[**models::RuleTriggerType**](RuleTriggerType.md)> | | [optional] +**active** | Option<**bool**> | Whether or not the rule is even active. Default is true. | [optional][default to true] +**strict** | Option<**bool**> | If the rule is set to be strict, ALL triggers must hit in order for the rule to fire. Otherwise, just one is enough. Default value is true. | [optional] +**stop_processing** | Option<**bool**> | If this value is true and the rule is triggered, other rules after this one in the group will be skipped. Default value is false. | [optional][default to false] +**triggers** | Option<[**Vec**](RuleTriggerUpdate.md)> | | [optional] +**actions** | Option<[**Vec**](RuleActionUpdate.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/RulesApi.md b/firefly-iii-api/docs/RulesApi.md new file mode 100644 index 0000000..a299255 --- /dev/null +++ b/firefly-iii-api/docs/RulesApi.md @@ -0,0 +1,240 @@ +# \RulesApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_rule**](RulesApi.md#delete_rule) | **DELETE** /v1/rules/{id} | Delete an rule. +[**fire_rule**](RulesApi.md#fire_rule) | **POST** /v1/rules/{id}/trigger | Fire the rule on your transactions. +[**get_rule**](RulesApi.md#get_rule) | **GET** /v1/rules/{id} | Get a single rule. +[**list_rule**](RulesApi.md#list_rule) | **GET** /v1/rules | List all rules. +[**store_rule**](RulesApi.md#store_rule) | **POST** /v1/rules | Store a new rule +[**test_rule**](RulesApi.md#test_rule) | **GET** /v1/rules/{id}/test | Test which transactions would be hit by the rule. No changes will be made. +[**update_rule**](RulesApi.md#update_rule) | **PUT** /v1/rules/{id} | Update existing rule. + + + +## delete_rule + +> delete_rule(id, x_trace_id) +Delete an rule. + +Delete an rule. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the rule. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## fire_rule + +> fire_rule(id, x_trace_id, start, end, accounts_left_square_bracket_right_square_bracket) +Fire the rule on your transactions. + +Fire the rule group on your transactions. Changes will be made by the rules in the group! Limit the result if you want to. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the rule. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD, to limit the transactions the actions will be applied to. If the start date is not present, it will be set to one year ago. If you use this field, both the start date and the end date must be present. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD, to limit the transactions the actions will be applied to. If the end date is not present, it will be set to today. If you use this field, both the start date and the end date must be present. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | Limit the triggering of the rule to these asset accounts or liabilities. Only asset accounts and liabilities will be accepted. Other types will be silently dropped. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_rule + +> models::RuleSingle get_rule(id, x_trace_id) +Get a single rule. + +Get a single rule. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the object. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::RuleSingle**](RuleSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_rule + +> models::RuleArray list_rule(x_trace_id, limit, page) +List all rules. + +List all rules. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::RuleArray**](RuleArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_rule + +> models::RuleSingle store_rule(rule_store, x_trace_id) +Store a new rule + +Creates a new rule. The data required can be submitted as a JSON body or as a list of parameters. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**rule_store** | [**RuleStore**](RuleStore.md) | JSON array or key=value pairs with the necessary rule information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::RuleSingle**](RuleSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## test_rule + +> models::TransactionArray test_rule(id, x_trace_id, start, end, accounts_left_square_bracket_right_square_bracket) +Test which transactions would be hit by the rule. No changes will be made. + +Test which transactions would be hit by the rule. No changes will be made. Limit the result if you want to. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the rule. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD, to limit the transactions the test will be applied to. Both the start date and the end date must be present. | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD, to limit the transactions the test will be applied to. Both the start date and the end date must be present. | | +**accounts_left_square_bracket_right_square_bracket** | Option<[**Vec**](i64.md)> | Limit the testing of the rule to these asset accounts or liabilities. Only asset accounts and liabilities will be accepted. Other types will be silently dropped. | | + +### Return type + +[**models::TransactionArray**](TransactionArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_rule + +> models::RuleSingle update_rule(id, rule_update, x_trace_id) +Update existing rule. + +Update existing rule. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the object. | [required] | +**rule_update** | [**RuleUpdate**](RuleUpdate.md) | JSON array with updated rule information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::RuleSingle**](RuleSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/SearchApi.md b/firefly-iii-api/docs/SearchApi.md new file mode 100644 index 0000000..dc10115 --- /dev/null +++ b/firefly-iii-api/docs/SearchApi.md @@ -0,0 +1,78 @@ +# \SearchApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**search_accounts**](SearchApi.md#search_accounts) | **GET** /v1/search/accounts | Search for accounts +[**search_transactions**](SearchApi.md#search_transactions) | **GET** /v1/search/transactions | Search for transactions + + + +## search_accounts + +> models::AccountArray search_accounts(query, field, x_trace_id, limit, page, r#type) +Search for accounts + +Search for accounts + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**query** | **String** | The query you wish to search for. | [required] | +**field** | [**AccountSearchFieldFilter**](.md) | The account field(s) you want to search in. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**r#type** | Option<[**AccountTypeFilter**](.md)> | The type of accounts you wish to limit the search to. | | + +### Return type + +[**models::AccountArray**](AccountArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## search_transactions + +> models::TransactionArray search_transactions(query, x_trace_id, limit, page) +Search for transactions + +Searches through the users transactions. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**query** | **String** | The query you wish to search for. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::TransactionArray**](TransactionArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/ShortAccountTypeProperty.md b/firefly-iii-api/docs/ShortAccountTypeProperty.md new file mode 100644 index 0000000..2c61509 --- /dev/null +++ b/firefly-iii-api/docs/ShortAccountTypeProperty.md @@ -0,0 +1,20 @@ +# ShortAccountTypeProperty + +## Enum Variants + +| Name | Value | +|---- | -----| +| Asset | asset | +| Expense | expense | +| Import | import | +| Revenue | revenue | +| Cash | cash | +| Liability | liability | +| Liabilities | liabilities | +| InitialBalance | initial-balance | +| Reconciliation | reconciliation | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/SummaryApi.md b/firefly-iii-api/docs/SummaryApi.md new file mode 100644 index 0000000..95f32f5 --- /dev/null +++ b/firefly-iii-api/docs/SummaryApi.md @@ -0,0 +1,42 @@ +# \SummaryApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_basic_summary**](SummaryApi.md#get_basic_summary) | **GET** /v1/summary/basic | Returns basic sums of the users data. + + + +## get_basic_summary + +> std::collections::HashMap get_basic_summary(start, end, x_trace_id, currency_code) +Returns basic sums of the users data. + +Returns basic sums of the users data, like the net worth, spent and earned amounts. It is multi-currency, and is used in Firefly III to populate the dashboard. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**start** | **String** | A date formatted YYYY-MM-DD. | [required] | +**end** | **String** | A date formatted YYYY-MM-DD. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**currency_code** | Option<**String**> | A currency code like EUR or USD, to filter the result. | | + +### Return type + +[**std::collections::HashMap**](BasicSummaryEntry.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/SystemInfo.md b/firefly-iii-api/docs/SystemInfo.md new file mode 100644 index 0000000..0ae1a76 --- /dev/null +++ b/firefly-iii-api/docs/SystemInfo.md @@ -0,0 +1,11 @@ +# SystemInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | Option<[**models::SystemInfoData**](SystemInfo_data.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/SystemInfoData.md b/firefly-iii-api/docs/SystemInfoData.md new file mode 100644 index 0000000..06ec1d9 --- /dev/null +++ b/firefly-iii-api/docs/SystemInfoData.md @@ -0,0 +1,15 @@ +# SystemInfoData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version** | Option<**String**> | | [optional] +**api_version** | Option<**String**> | | [optional] +**php_version** | Option<**String**> | | [optional] +**os** | Option<**String**> | | [optional] +**driver** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TagArray.md b/firefly-iii-api/docs/TagArray.md new file mode 100644 index 0000000..501684a --- /dev/null +++ b/firefly-iii-api/docs/TagArray.md @@ -0,0 +1,13 @@ +# TagArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](TagRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | +**links** | [**models::PageLink**](PageLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TagModel.md b/firefly-iii-api/docs/TagModel.md new file mode 100644 index 0000000..d279db5 --- /dev/null +++ b/firefly-iii-api/docs/TagModel.md @@ -0,0 +1,18 @@ +# TagModel + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**tag** | **String** | The tag | +**date** | Option<[**String**](string.md)> | The date to which the tag is applicable. | [optional] +**description** | Option<**String**> | | [optional] +**latitude** | Option<**f64**> | Latitude of the tag's location, if applicable. Can be used to draw a map. | [optional] +**longitude** | Option<**f64**> | Latitude of the tag's location, if applicable. Can be used to draw a map. | [optional] +**zoom_level** | Option<**i32**> | Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TagModelStore.md b/firefly-iii-api/docs/TagModelStore.md new file mode 100644 index 0000000..c48366b --- /dev/null +++ b/firefly-iii-api/docs/TagModelStore.md @@ -0,0 +1,16 @@ +# TagModelStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tag** | **String** | The tag | +**date** | Option<[**String**](string.md)> | The date to which the tag is applicable. | [optional] +**description** | Option<**String**> | | [optional] +**latitude** | Option<**f64**> | Latitude of the tag's location, if applicable. Can be used to draw a map. | [optional] +**longitude** | Option<**f64**> | Latitude of the tag's location, if applicable. Can be used to draw a map. | [optional] +**zoom_level** | Option<**i32**> | Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TagModelUpdate.md b/firefly-iii-api/docs/TagModelUpdate.md new file mode 100644 index 0000000..eda80d7 --- /dev/null +++ b/firefly-iii-api/docs/TagModelUpdate.md @@ -0,0 +1,16 @@ +# TagModelUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tag** | Option<**String**> | The tag | [optional] +**date** | Option<[**String**](string.md)> | The date to which the tag is applicable. | [optional] +**description** | Option<**String**> | | [optional] +**latitude** | Option<**f64**> | Latitude of the tag's location, if applicable. Can be used to draw a map. | [optional] +**longitude** | Option<**f64**> | Latitude of the tag's location, if applicable. Can be used to draw a map. | [optional] +**zoom_level** | Option<**i32**> | Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TagRead.md b/firefly-iii-api/docs/TagRead.md new file mode 100644 index 0000000..902a8d6 --- /dev/null +++ b/firefly-iii-api/docs/TagRead.md @@ -0,0 +1,14 @@ +# TagRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::TagModel**](TagModel.md) | | +**links** | [**models::ObjectLink**](ObjectLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TagSingle.md b/firefly-iii-api/docs/TagSingle.md new file mode 100644 index 0000000..dea4135 --- /dev/null +++ b/firefly-iii-api/docs/TagSingle.md @@ -0,0 +1,11 @@ +# TagSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::TagRead**](TagRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TagsApi.md b/firefly-iii-api/docs/TagsApi.md new file mode 100644 index 0000000..394ec8f --- /dev/null +++ b/firefly-iii-api/docs/TagsApi.md @@ -0,0 +1,243 @@ +# \TagsApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_tag**](TagsApi.md#delete_tag) | **DELETE** /v1/tags/{tag} | Delete an tag. +[**get_tag**](TagsApi.md#get_tag) | **GET** /v1/tags/{tag} | Get a single tag. +[**list_attachment_by_tag**](TagsApi.md#list_attachment_by_tag) | **GET** /v1/tags/{tag}/attachments | Lists all attachments. +[**list_tag**](TagsApi.md#list_tag) | **GET** /v1/tags | List all tags. +[**list_transaction_by_tag**](TagsApi.md#list_transaction_by_tag) | **GET** /v1/tags/{tag}/transactions | List all transactions with this tag. +[**store_tag**](TagsApi.md#store_tag) | **POST** /v1/tags | Store a new tag +[**update_tag**](TagsApi.md#update_tag) | **PUT** /v1/tags/{tag} | Update existing tag. + + + +## delete_tag + +> delete_tag(tag, x_trace_id) +Delete an tag. + +Delete an tag. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**tag** | **String** | Either the tag itself or the tag ID. If you use the tag itself, and it contains international (non-ASCII) characters, your milage may vary. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_tag + +> models::TagSingle get_tag(tag, x_trace_id, limit, page) +Get a single tag. + +Get a single tag. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**tag** | **String** | Either the tag itself or the tag ID. If you use the tag itself, and it contains international (non-ASCII) characters, your milage may vary. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::TagSingle**](TagSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_attachment_by_tag + +> models::AttachmentArray list_attachment_by_tag(tag, x_trace_id, limit, page) +Lists all attachments. + +Lists all attachments. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**tag** | **String** | Either the tag itself or the tag ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::AttachmentArray**](AttachmentArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_tag + +> models::TagArray list_tag(x_trace_id, limit, page) +List all tags. + +List all of the user's tags. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::TagArray**](TagArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_transaction_by_tag + +> models::TransactionArray list_transaction_by_tag(tag, x_trace_id, limit, page, start, end, r#type) +List all transactions with this tag. + +List all transactions with this tag. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**tag** | **String** | Either the tag itself or the tag ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD. This is the start date of the selected range (inclusive). | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD. This is the end date of the selected range (inclusive). | | +**r#type** | Option<[**TransactionTypeFilter**](.md)> | Optional filter on the transaction type(s) returned. | | + +### Return type + +[**models::TransactionArray**](TransactionArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_tag + +> models::TagSingle store_tag(tag_model_store, x_trace_id) +Store a new tag + +Creates a new tag. The data required can be submitted as a JSON body or as a list of parameters. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**tag_model_store** | [**TagModelStore**](TagModelStore.md) | JSON array or key=value pairs with the necessary tag information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::TagSingle**](TagSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_tag + +> models::TagSingle update_tag(tag, tag_model_update, x_trace_id) +Update existing tag. + +Update existing tag. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**tag** | **String** | Either the tag itself or the tag ID. If you use the tag itself, and it contains international (non-ASCII) characters, your milage may vary. | [required] | +**tag_model_update** | [**TagModelUpdate**](TagModelUpdate.md) | JSON array with updated tag information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::TagSingle**](TagSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/Transaction.md b/firefly-iii-api/docs/Transaction.md new file mode 100644 index 0000000..ad3d57a --- /dev/null +++ b/firefly-iii-api/docs/Transaction.md @@ -0,0 +1,15 @@ +# Transaction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**user** | Option<**String**> | User ID | [optional][readonly] +**group_title** | Option<**String**> | Title of the transaction if it has been split in more than one piece. Empty otherwise. | [optional] +**transactions** | [**Vec**](TransactionSplit.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionArray.md b/firefly-iii-api/docs/TransactionArray.md new file mode 100644 index 0000000..d4d6ef7 --- /dev/null +++ b/firefly-iii-api/docs/TransactionArray.md @@ -0,0 +1,13 @@ +# TransactionArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](TransactionRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | +**links** | [**models::PageLink**](PageLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionLink.md b/firefly-iii-api/docs/TransactionLink.md new file mode 100644 index 0000000..89c3e1b --- /dev/null +++ b/firefly-iii-api/docs/TransactionLink.md @@ -0,0 +1,17 @@ +# TransactionLink + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**link_type_id** | **String** | The link type ID to use. You can also use the link_type_name field. | +**link_type_name** | Option<**String**> | The link type name to use. You can also use the link_type_id field. | [optional] +**inward_id** | **String** | The inward transaction transaction_journal_id for the link. This becomes the 'is paid by' transaction of the set. | +**outward_id** | **String** | The outward transaction transaction_journal_id for the link. This becomes the 'pays for' transaction of the set. | +**notes** | Option<**String**> | Optional. Some notes. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionLinkArray.md b/firefly-iii-api/docs/TransactionLinkArray.md new file mode 100644 index 0000000..b9fe5a0 --- /dev/null +++ b/firefly-iii-api/docs/TransactionLinkArray.md @@ -0,0 +1,13 @@ +# TransactionLinkArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](TransactionLinkRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | +**links** | [**models::PageLink**](PageLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionLinkRead.md b/firefly-iii-api/docs/TransactionLinkRead.md new file mode 100644 index 0000000..d7eaa2b --- /dev/null +++ b/firefly-iii-api/docs/TransactionLinkRead.md @@ -0,0 +1,14 @@ +# TransactionLinkRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::TransactionLink**](TransactionLink.md) | | +**links** | [**models::ObjectLink**](ObjectLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionLinkSingle.md b/firefly-iii-api/docs/TransactionLinkSingle.md new file mode 100644 index 0000000..e531047 --- /dev/null +++ b/firefly-iii-api/docs/TransactionLinkSingle.md @@ -0,0 +1,11 @@ +# TransactionLinkSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::TransactionLinkRead**](TransactionLinkRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionLinkStore.md b/firefly-iii-api/docs/TransactionLinkStore.md new file mode 100644 index 0000000..e60bc0e --- /dev/null +++ b/firefly-iii-api/docs/TransactionLinkStore.md @@ -0,0 +1,15 @@ +# TransactionLinkStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**link_type_id** | **String** | The link type ID to use. You can also use the link_type_name field. | +**link_type_name** | Option<**String**> | The link type name to use. You can also use the link_type_id field. | [optional] +**inward_id** | **String** | The inward transaction transaction_journal_id for the link. This becomes the 'is paid by' transaction of the set. | +**outward_id** | **String** | The outward transaction transaction_journal_id for the link. This becomes the 'pays for' transaction of the set. | +**notes** | Option<**String**> | Optional. Some notes. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionLinkUpdate.md b/firefly-iii-api/docs/TransactionLinkUpdate.md new file mode 100644 index 0000000..adb5eaa --- /dev/null +++ b/firefly-iii-api/docs/TransactionLinkUpdate.md @@ -0,0 +1,15 @@ +# TransactionLinkUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**link_type_id** | Option<**String**> | The link type ID to use. Use this field OR use the link_type_name field. | [optional] +**link_type_name** | Option<**String**> | The link type name to use. Use this field OR use the link_type_id field. | [optional] +**inward_id** | Option<**String**> | The inward transaction transaction_journal_id for the link. This becomes the 'is paid by' transaction of the set. | [optional] +**outward_id** | Option<**String**> | The outward transaction transaction_journal_id for the link. This becomes the 'pays for' transaction of the set. | [optional] +**notes** | Option<**String**> | Optional. Some notes. If you submit an empty string the current notes will be removed | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionRead.md b/firefly-iii-api/docs/TransactionRead.md new file mode 100644 index 0000000..c051d38 --- /dev/null +++ b/firefly-iii-api/docs/TransactionRead.md @@ -0,0 +1,14 @@ +# TransactionRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::Transaction**](Transaction.md) | | +**links** | [**models::ObjectLink**](ObjectLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionSingle.md b/firefly-iii-api/docs/TransactionSingle.md new file mode 100644 index 0000000..f3fdff9 --- /dev/null +++ b/firefly-iii-api/docs/TransactionSingle.md @@ -0,0 +1,11 @@ +# TransactionSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::TransactionRead**](TransactionRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionSplit.md b/firefly-iii-api/docs/TransactionSplit.md new file mode 100644 index 0000000..dc59a6f --- /dev/null +++ b/firefly-iii-api/docs/TransactionSplit.md @@ -0,0 +1,71 @@ +# TransactionSplit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | Option<**String**> | User ID | [optional][readonly] +**transaction_journal_id** | Option<**String**> | 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. | [optional][readonly] +**r#type** | [**models::TransactionTypeProperty**](TransactionTypeProperty.md) | | +**date** | **String** | Date of the transaction | +**order** | Option<**i32**> | Order of this entry in the list of transactions. | [optional] +**currency_id** | Option<**String**> | Currency ID. Default is the source account's currency, or the user's default currency. Can be used instead of currency_code. | [optional] +**currency_code** | Option<**String**> | Currency code. Default is the source account's currency, or the user's default currency. Can be used instead of currency_id. | [optional] +**currency_symbol** | Option<**String**> | | [optional][readonly] +**currency_name** | Option<**String**> | | [optional][readonly] +**currency_decimal_places** | Option<**i32**> | Number of decimals used in this currency. | [optional][readonly] +**foreign_currency_id** | Option<**String**> | Currency ID of the foreign currency. Default is null. Is required when you submit a foreign amount. | [optional] +**foreign_currency_code** | Option<**String**> | Currency code of the foreign currency. Default is NULL. Can be used instead of the foreign_currency_id, but this or the ID is required when submitting a foreign amount. | [optional] +**foreign_currency_symbol** | Option<**String**> | | [optional][readonly] +**foreign_currency_decimal_places** | Option<**i32**> | Number of decimals in the currency | [optional][readonly] +**amount** | **String** | Amount of the transaction. | +**foreign_amount** | Option<**String**> | The amount in a foreign currency. | [optional] +**description** | **String** | Description of the transaction. | +**source_id** | Option<**String**> | 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. | +**source_name** | Option<**String**> | 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. | [optional] +**source_iban** | Option<**String**> | | [optional][readonly] +**source_type** | Option<[**models::AccountTypeProperty**](AccountTypeProperty.md)> | | [optional] +**destination_id** | Option<**String**> | 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. | +**destination_name** | Option<**String**> | 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. | [optional] +**destination_iban** | Option<**String**> | | [optional][readonly] +**destination_type** | Option<[**models::AccountTypeProperty**](AccountTypeProperty.md)> | | [optional] +**budget_id** | Option<**String**> | The budget ID for this transaction. | [optional] +**budget_name** | Option<**String**> | 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. | [optional][readonly] +**category_id** | Option<**String**> | The category ID for this transaction. | [optional] +**category_name** | Option<**String**> | 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. | [optional] +**bill_id** | Option<**String**> | Optional. Use either this or the bill_name | [optional] +**bill_name** | Option<**String**> | Optional. Use either this or the bill_id | [optional] +**reconciled** | Option<**bool**> | If the transaction has been reconciled already. When you set this, the amount can no longer be edited by the user. | [optional] +**notes** | Option<**String**> | | [optional] +**tags** | Option<**Vec**> | Array of tags. | [optional] +**internal_reference** | Option<**String**> | Reference to internal reference of other systems. | [optional] +**external_id** | Option<**String**> | Reference to external ID in other systems. | [optional] +**external_url** | Option<**String**> | External, custom URL for this transaction. | [optional] +**original_source** | Option<**String**> | System generated identifier for original creator of transaction. | [optional][readonly] +**recurrence_id** | Option<**String**> | Reference to recurrence that made the transaction. | [optional][readonly] +**recurrence_total** | Option<**i32**> | Total number of transactions expected to be created by this recurrence repetition. Will be 0 if infinite. | [optional][readonly] +**recurrence_count** | Option<**i32**> | The # of the current transaction created under this recurrence. | [optional][readonly] +**bunq_payment_id** | Option<**String**> | Internal ID of bunq transaction. DEPRECATED | [optional] +**import_hash_v2** | Option<**String**> | Hash value of original import transaction (for duplicate detection). | [optional][readonly] +**sepa_cc** | Option<**String**> | SEPA Clearing Code | [optional] +**sepa_ct_op** | Option<**String**> | SEPA Opposing Account Identifier | [optional] +**sepa_ct_id** | Option<**String**> | SEPA end-to-end Identifier | [optional] +**sepa_db** | Option<**String**> | SEPA mandate identifier | [optional] +**sepa_country** | Option<**String**> | SEPA Country | [optional] +**sepa_ep** | Option<**String**> | SEPA External Purpose indicator | [optional] +**sepa_ci** | Option<**String**> | SEPA Creditor Identifier | [optional] +**sepa_batch_id** | Option<**String**> | SEPA Batch ID | [optional] +**interest_date** | Option<**String**> | | [optional] +**book_date** | Option<**String**> | | [optional] +**process_date** | Option<**String**> | | [optional] +**due_date** | Option<**String**> | | [optional] +**payment_date** | Option<**String**> | | [optional] +**invoice_date** | Option<**String**> | | [optional] +**latitude** | Option<**f64**> | Latitude of the transaction's location, if applicable. Can be used to draw a map. | [optional] +**longitude** | Option<**f64**> | Latitude of the transaction's location, if applicable. Can be used to draw a map. | [optional] +**zoom_level** | Option<**i32**> | Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. | [optional] +**has_attachments** | Option<**bool**> | If the transaction has attachments. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionSplitStore.md b/firefly-iii-api/docs/TransactionSplitStore.md new file mode 100644 index 0000000..6f80659 --- /dev/null +++ b/firefly-iii-api/docs/TransactionSplitStore.md @@ -0,0 +1,53 @@ +# TransactionSplitStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | [**models::TransactionTypeProperty**](TransactionTypeProperty.md) | | +**date** | **String** | Date of the transaction | +**amount** | **String** | Amount of the transaction. | +**description** | **String** | Description of the transaction. | +**order** | Option<**i32**> | Order of this entry in the list of transactions. | [optional] +**currency_id** | Option<**String**> | Currency ID. Default is the source account's currency, or the user's default currency. The value you submit may be overruled by the source or destination account. | [optional] +**currency_code** | Option<**String**> | Currency code. Default is the source account's currency, or the user's default currency. The value you submit may be overruled by the source or destination account. | [optional] +**foreign_amount** | Option<**String**> | The amount in a foreign currency. | [optional] +**foreign_currency_id** | Option<**String**> | Currency ID of the foreign currency. Default is null. Is required when you submit a foreign amount. | [optional] +**foreign_currency_code** | Option<**String**> | Currency code of the foreign currency. Default is NULL. Can be used instead of the foreign_currency_id, but this or the ID is required when submitting a foreign amount. | [optional] +**budget_id** | Option<**String**> | The budget ID for this transaction. | [optional] +**budget_name** | Option<**String**> | 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. | [optional][readonly] +**category_id** | Option<**String**> | The category ID for this transaction. | [optional] +**category_name** | Option<**String**> | 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. | [optional] +**source_id** | Option<**String**> | 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. | [optional] +**source_name** | Option<**String**> | 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. | [optional] +**destination_id** | Option<**String**> | 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. | [optional] +**destination_name** | Option<**String**> | 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. | [optional] +**reconciled** | Option<**bool**> | If the transaction has been reconciled already. When you set this, the amount can no longer be edited by the user. | [optional] +**piggy_bank_id** | Option<**i32**> | Optional. Use either this or the piggy_bank_name | [optional] +**piggy_bank_name** | Option<**String**> | Optional. Use either this or the piggy_bank_id | [optional] +**bill_id** | Option<**String**> | Optional. Use either this or the bill_name | [optional] +**bill_name** | Option<**String**> | Optional. Use either this or the bill_id | [optional] +**tags** | Option<**Vec**> | Array of tags. | [optional] +**notes** | Option<**String**> | | [optional] +**internal_reference** | Option<**String**> | Reference to internal reference of other systems. | [optional] +**external_id** | Option<**String**> | Reference to external ID in other systems. | [optional] +**external_url** | Option<**String**> | External, custom URL for this transaction. | [optional] +**bunq_payment_id** | Option<**String**> | Internal ID of bunq transaction. Field is no longer used but still works. | [optional] +**sepa_cc** | Option<**String**> | SEPA Clearing Code | [optional] +**sepa_ct_op** | Option<**String**> | SEPA Opposing Account Identifier | [optional] +**sepa_ct_id** | Option<**String**> | SEPA end-to-end Identifier | [optional] +**sepa_db** | Option<**String**> | SEPA mandate identifier | [optional] +**sepa_country** | Option<**String**> | SEPA Country | [optional] +**sepa_ep** | Option<**String**> | SEPA External Purpose indicator | [optional] +**sepa_ci** | Option<**String**> | SEPA Creditor Identifier | [optional] +**sepa_batch_id** | Option<**String**> | SEPA Batch ID | [optional] +**interest_date** | Option<**String**> | | [optional] +**book_date** | Option<**String**> | | [optional] +**process_date** | Option<**String**> | | [optional] +**due_date** | Option<**String**> | | [optional] +**payment_date** | Option<**String**> | | [optional] +**invoice_date** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionSplitUpdate.md b/firefly-iii-api/docs/TransactionSplitUpdate.md new file mode 100644 index 0000000..dc81f49 --- /dev/null +++ b/firefly-iii-api/docs/TransactionSplitUpdate.md @@ -0,0 +1,59 @@ +# TransactionSplitUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transaction_journal_id** | Option<**String**> | Transaction journal ID of current transaction (split). | [optional] +**r#type** | Option<[**models::TransactionTypeProperty**](TransactionTypeProperty.md)> | | [optional] +**date** | Option<**String**> | Date of the transaction | [optional] +**amount** | Option<**String**> | Amount of the transaction. | [optional] +**description** | Option<**String**> | Description of the transaction. | [optional] +**order** | Option<**i32**> | Order of this entry in the list of transactions. | [optional] +**currency_id** | Option<**String**> | Currency ID. Default is the source account's currency, or the user's default currency. Can be used instead of currency_code. | [optional] +**currency_code** | Option<**String**> | Currency code. Default is the source account's currency, or the user's default currency. Can be used instead of currency_id. | [optional] +**currency_symbol** | Option<**String**> | | [optional][readonly] +**currency_name** | Option<**String**> | | [optional][readonly] +**currency_decimal_places** | Option<**i32**> | Number of decimals used in this currency. | [optional][readonly] +**foreign_amount** | Option<**String**> | The amount in a foreign currency. | [optional] +**foreign_currency_id** | Option<**String**> | Currency ID of the foreign currency. Default is null. Is required when you submit a foreign amount. | [optional] +**foreign_currency_code** | Option<**String**> | Currency code of the foreign currency. Default is NULL. Can be used instead of the foreign_currency_id, but this or the ID is required when submitting a foreign amount. | [optional] +**foreign_currency_symbol** | Option<**String**> | | [optional][readonly] +**foreign_currency_decimal_places** | Option<**i32**> | Number of decimals in the currency | [optional][readonly] +**budget_id** | Option<**String**> | The budget ID for this transaction. | [optional] +**budget_name** | Option<**String**> | 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. | [optional][readonly] +**category_id** | Option<**String**> | The category ID for this transaction. | [optional] +**category_name** | Option<**String**> | 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. | [optional] +**source_id** | Option<**String**> | 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. | [optional] +**source_name** | Option<**String**> | 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. | [optional] +**source_iban** | Option<**String**> | | [optional] +**destination_id** | Option<**String**> | 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. | [optional] +**destination_name** | Option<**String**> | 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. | [optional] +**destination_iban** | Option<**String**> | | [optional] +**reconciled** | Option<**bool**> | If the transaction has been reconciled already. When you set this, the amount can no longer be edited by the user. | [optional] +**bill_id** | Option<**String**> | Optional. Use either this or the bill_name | [optional] +**bill_name** | Option<**String**> | Optional. Use either this or the bill_id | [optional] +**tags** | Option<**Vec**> | Array of tags. | [optional] +**notes** | Option<**String**> | | [optional] +**internal_reference** | Option<**String**> | Reference to internal reference of other systems. | [optional] +**external_id** | Option<**String**> | Reference to external ID in other systems. | [optional] +**external_url** | Option<**String**> | External, custom URL for this transaction. | [optional] +**bunq_payment_id** | Option<**String**> | Internal ID of bunq transaction. | [optional] +**sepa_cc** | Option<**String**> | SEPA Clearing Code | [optional] +**sepa_ct_op** | Option<**String**> | SEPA Opposing Account Identifier | [optional] +**sepa_ct_id** | Option<**String**> | SEPA end-to-end Identifier | [optional] +**sepa_db** | Option<**String**> | SEPA mandate identifier | [optional] +**sepa_country** | Option<**String**> | SEPA Country | [optional] +**sepa_ep** | Option<**String**> | SEPA External Purpose indicator | [optional] +**sepa_ci** | Option<**String**> | SEPA Creditor Identifier | [optional] +**sepa_batch_id** | Option<**String**> | SEPA Batch ID | [optional] +**interest_date** | Option<**String**> | | [optional] +**book_date** | Option<**String**> | | [optional] +**process_date** | Option<**String**> | | [optional] +**due_date** | Option<**String**> | | [optional] +**payment_date** | Option<**String**> | | [optional] +**invoice_date** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionStore.md b/firefly-iii-api/docs/TransactionStore.md new file mode 100644 index 0000000..a723495 --- /dev/null +++ b/firefly-iii-api/docs/TransactionStore.md @@ -0,0 +1,15 @@ +# TransactionStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_if_duplicate_hash** | Option<**bool**> | Break if the submitted transaction exists already. | [optional] +**apply_rules** | Option<**bool**> | Whether or not to apply rules when submitting transaction. | [optional] +**fire_webhooks** | Option<**bool**> | Whether or not to fire the webhooks that are related to this event. | [optional][default to true] +**group_title** | Option<**String**> | Title of the transaction if it has been split in more than one piece. Empty otherwise. | [optional] +**transactions** | [**Vec**](TransactionSplitStore.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionTypeFilter.md b/firefly-iii-api/docs/TransactionTypeFilter.md new file mode 100644 index 0000000..571618e --- /dev/null +++ b/firefly-iii-api/docs/TransactionTypeFilter.md @@ -0,0 +1,25 @@ +# TransactionTypeFilter + +## Enum Variants + +| Name | Value | +|---- | -----| +| All | all | +| Withdrawal | withdrawal | +| Withdrawals | withdrawals | +| Expense | expense | +| Deposit | deposit | +| Deposits | deposits | +| Income | income | +| Transfer | transfer | +| Transfers | transfers | +| OpeningBalance | opening_balance | +| Reconciliation | reconciliation | +| Special | special | +| Specials | specials | +| Default | default | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionTypeProperty.md b/firefly-iii-api/docs/TransactionTypeProperty.md new file mode 100644 index 0000000..018b03a --- /dev/null +++ b/firefly-iii-api/docs/TransactionTypeProperty.md @@ -0,0 +1,16 @@ +# TransactionTypeProperty + +## Enum Variants + +| Name | Value | +|---- | -----| +| Withdrawal | withdrawal | +| Deposit | deposit | +| Transfer | transfer | +| Reconciliation | reconciliation | +| OpeningBalance | opening balance | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionUpdate.md b/firefly-iii-api/docs/TransactionUpdate.md new file mode 100644 index 0000000..be0682f --- /dev/null +++ b/firefly-iii-api/docs/TransactionUpdate.md @@ -0,0 +1,14 @@ +# TransactionUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**apply_rules** | Option<**bool**> | Whether or not to apply rules when submitting transaction. | [optional] +**fire_webhooks** | Option<**bool**> | Whether or not to fire the webhooks that are related to this event. | [optional][default to true] +**group_title** | Option<**String**> | Title of the transaction if it has been split in more than one piece. Empty otherwise. | [optional] +**transactions** | Option<[**Vec**](TransactionSplitUpdate.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/TransactionsApi.md b/firefly-iii-api/docs/TransactionsApi.md new file mode 100644 index 0000000..d6f482d --- /dev/null +++ b/firefly-iii-api/docs/TransactionsApi.md @@ -0,0 +1,339 @@ +# \TransactionsApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_transaction**](TransactionsApi.md#delete_transaction) | **DELETE** /v1/transactions/{id} | Delete a transaction. +[**delete_transaction_journal**](TransactionsApi.md#delete_transaction_journal) | **DELETE** /v1/transaction-journals/{id} | Delete split from transaction +[**get_transaction**](TransactionsApi.md#get_transaction) | **GET** /v1/transactions/{id} | Get a single transaction. +[**get_transaction_by_journal**](TransactionsApi.md#get_transaction_by_journal) | **GET** /v1/transaction-journals/{id} | Get a single transaction, based on one of the underlying transaction journals (transaction splits). +[**list_attachment_by_transaction**](TransactionsApi.md#list_attachment_by_transaction) | **GET** /v1/transactions/{id}/attachments | Lists all attachments. +[**list_event_by_transaction**](TransactionsApi.md#list_event_by_transaction) | **GET** /v1/transactions/{id}/piggy-bank-events | Lists all piggy bank events. +[**list_links_by_journal**](TransactionsApi.md#list_links_by_journal) | **GET** /v1/transaction-journals/{id}/links | Lists all the transaction links for an individual journal (individual split). +[**list_transaction**](TransactionsApi.md#list_transaction) | **GET** /v1/transactions | List all the user's transactions. +[**store_transaction**](TransactionsApi.md#store_transaction) | **POST** /v1/transactions | Store a new transaction +[**update_transaction**](TransactionsApi.md#update_transaction) | **PUT** /v1/transactions/{id} | Update existing transaction. For more information, see https://docs.firefly-iii.org/references/firefly-iii/api/specials/ + + + +## delete_transaction + +> delete_transaction(id, x_trace_id) +Delete a transaction. + +Delete a transaction. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the transaction. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_transaction_journal + +> delete_transaction_journal(id, x_trace_id) +Delete split from transaction + +Delete an individual journal (split) from a transaction. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the transaction journal (the split) you wish to delete. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_transaction + +> models::TransactionSingle get_transaction(id, x_trace_id) +Get a single transaction. + +Get a single transaction. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the transaction. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::TransactionSingle**](TransactionSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_transaction_by_journal + +> models::TransactionSingle get_transaction_by_journal(id, x_trace_id) +Get a single transaction, based on one of the underlying transaction journals (transaction splits). + +Get a single transaction by underlying journal (split). + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the transaction journal (split). | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::TransactionSingle**](TransactionSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_attachment_by_transaction + +> models::AttachmentArray list_attachment_by_transaction(id, x_trace_id, limit, page) +Lists all attachments. + +Lists all attachments. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the transaction. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::AttachmentArray**](AttachmentArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_event_by_transaction + +> models::PiggyBankEventArray list_event_by_transaction(id, x_trace_id, limit, page) +Lists all piggy bank events. + +Lists all piggy bank events. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the transaction. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::PiggyBankEventArray**](PiggyBankEventArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_links_by_journal + +> models::TransactionLinkArray list_links_by_journal(id, x_trace_id, limit, page) +Lists all the transaction links for an individual journal (individual split). + +Lists all the transaction links for an individual journal (a split). Don't use the group ID, you need the actual underlying journal (the split). + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the transaction journal / the split. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::TransactionLinkArray**](TransactionLinkArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_transaction + +> models::TransactionArray list_transaction(x_trace_id, limit, page, start, end, r#type) +List all the user's transactions. + +List all the user's transactions. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | +**start** | Option<**String**> | A date formatted YYYY-MM-DD. This is the start date of the selected range (inclusive). | | +**end** | Option<**String**> | A date formatted YYYY-MM-DD. This is the end date of the selected range (inclusive). | | +**r#type** | Option<[**TransactionTypeFilter**](.md)> | Optional filter on the transaction type(s) returned. | | + +### Return type + +[**models::TransactionArray**](TransactionArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_transaction + +> models::TransactionSingle store_transaction(transaction_store, x_trace_id) +Store a new transaction + +Creates a new transaction. The data required can be submitted as a JSON body or as a list of parameters. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**transaction_store** | [**TransactionStore**](TransactionStore.md) | JSON array or key=value pairs with the necessary transaction information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::TransactionSingle**](TransactionSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_transaction + +> models::TransactionSingle update_transaction(id, transaction_update, x_trace_id) +Update existing transaction. For more information, see https://docs.firefly-iii.org/references/firefly-iii/api/specials/ + +Update an existing transaction. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The ID of the transaction. | [required] | +**transaction_update** | [**TransactionUpdate**](TransactionUpdate.md) | JSON array with updated transaction information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::TransactionSingle**](TransactionSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/UnauthenticatedResponse.md b/firefly-iii-api/docs/UnauthenticatedResponse.md new file mode 100644 index 0000000..2f2b9f2 --- /dev/null +++ b/firefly-iii-api/docs/UnauthenticatedResponse.md @@ -0,0 +1,12 @@ +# UnauthenticatedResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | Option<**String**> | | [optional] +**exception** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/User.md b/firefly-iii-api/docs/User.md new file mode 100644 index 0000000..e4f46c2 --- /dev/null +++ b/firefly-iii-api/docs/User.md @@ -0,0 +1,16 @@ +# User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**email** | **String** | The new users email address. | +**blocked** | Option<**bool**> | Boolean to indicate if the user is blocked. | [optional] +**blocked_code** | Option<[**models::UserBlockedCodeProperty**](UserBlockedCodeProperty.md)> | | [optional] +**role** | Option<[**models::UserRoleProperty**](UserRoleProperty.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/UserArray.md b/firefly-iii-api/docs/UserArray.md new file mode 100644 index 0000000..5f18619 --- /dev/null +++ b/firefly-iii-api/docs/UserArray.md @@ -0,0 +1,13 @@ +# UserArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](UserRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | +**links** | [**models::PageLink**](PageLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/UserBlockedCodeProperty.md b/firefly-iii-api/docs/UserBlockedCodeProperty.md new file mode 100644 index 0000000..0235ca8 --- /dev/null +++ b/firefly-iii-api/docs/UserBlockedCodeProperty.md @@ -0,0 +1,13 @@ +# UserBlockedCodeProperty + +## Enum Variants + +| Name | Value | +|---- | -----| +| EmailChanged | email_changed | +| Null | null | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/UserRead.md b/firefly-iii-api/docs/UserRead.md new file mode 100644 index 0000000..211f3fe --- /dev/null +++ b/firefly-iii-api/docs/UserRead.md @@ -0,0 +1,14 @@ +# UserRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::User**](User.md) | | +**links** | [**models::ObjectLink**](ObjectLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/UserRoleProperty.md b/firefly-iii-api/docs/UserRoleProperty.md new file mode 100644 index 0000000..15a730b --- /dev/null +++ b/firefly-iii-api/docs/UserRoleProperty.md @@ -0,0 +1,14 @@ +# UserRoleProperty + +## Enum Variants + +| Name | Value | +|---- | -----| +| Owner | owner | +| Demo | demo | +| Null | null | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/UserSingle.md b/firefly-iii-api/docs/UserSingle.md new file mode 100644 index 0000000..1a2994f --- /dev/null +++ b/firefly-iii-api/docs/UserSingle.md @@ -0,0 +1,11 @@ +# UserSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::UserRead**](UserRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/UsersApi.md b/firefly-iii-api/docs/UsersApi.md new file mode 100644 index 0000000..4bca061 --- /dev/null +++ b/firefly-iii-api/docs/UsersApi.md @@ -0,0 +1,170 @@ +# \UsersApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_user**](UsersApi.md#delete_user) | **DELETE** /v1/users/{id} | Delete a user. +[**get_user**](UsersApi.md#get_user) | **GET** /v1/users/{id} | Get a single user. +[**list_user**](UsersApi.md#list_user) | **GET** /v1/users | List all users. +[**store_user**](UsersApi.md#store_user) | **POST** /v1/users | Store a new user +[**update_user**](UsersApi.md#update_user) | **PUT** /v1/users/{id} | Update an existing user's information. + + + +## delete_user + +> delete_user(id, x_trace_id) +Delete a user. + +Delete a user. You cannot delete the user you're authenticated with. This cannot be undone. Be careful! + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The user ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_user + +> models::UserSingle get_user(id, x_trace_id) +Get a single user. + +Gets all info of a single user. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The user ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::UserSingle**](UserSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_user + +> models::UserArray list_user(x_trace_id, limit, page) +List all users. + +List all the users in this instance of Firefly III. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::UserArray**](UserArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_user + +> models::UserSingle store_user(user, x_trace_id) +Store a new user + +Creates a new user. The data required can be submitted as a JSON body or as a list of parameters. The user will be given a random password, which they can reset using the \"forgot password\" function. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user** | [**User**](User.md) | JSON array or key=value pairs with the necessary user information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::UserSingle**](UserSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/json, application/vnd.api+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_user + +> models::UserSingle update_user(id, user, x_trace_id) +Update an existing user's information. + +Update existing user. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The user ID. | [required] | +**user** | [**User**](User.md) | JSON array with updated user information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::UserSingle**](UserSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/docs/ValidationErrorResponse.md b/firefly-iii-api/docs/ValidationErrorResponse.md new file mode 100644 index 0000000..efb8f1d --- /dev/null +++ b/firefly-iii-api/docs/ValidationErrorResponse.md @@ -0,0 +1,12 @@ +# ValidationErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | Option<**String**> | | [optional] +**errors** | Option<[**models::ValidationErrorResponseErrors**](ValidationErrorResponse_errors.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/ValidationErrorResponseErrors.md b/firefly-iii-api/docs/ValidationErrorResponseErrors.md new file mode 100644 index 0000000..b64185e --- /dev/null +++ b/firefly-iii-api/docs/ValidationErrorResponseErrors.md @@ -0,0 +1,20 @@ +# ValidationErrorResponseErrors + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | Option<**Vec**> | | [optional] +**blocked** | Option<**Vec**> | | [optional] +**role** | Option<**Vec**> | | [optional] +**blocked_code** | Option<**Vec**> | | [optional] +**name** | Option<**Vec**> | | [optional] +**r#type** | Option<**Vec**> | | [optional] +**iban** | Option<**Vec**> | | [optional] +**start** | Option<**Vec**> | | [optional] +**end** | Option<**Vec**> | | [optional] +**date** | Option<**Vec**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/Webhook.md b/firefly-iii-api/docs/Webhook.md new file mode 100644 index 0000000..c0dcdf6 --- /dev/null +++ b/firefly-iii-api/docs/Webhook.md @@ -0,0 +1,19 @@ +# Webhook + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**active** | Option<**bool**> | Boolean to indicate if the webhook is active | [optional] +**title** | **String** | A title for the webhook for easy recognition. | +**secret** | Option<**String**> | A 24-character secret for the webhook. It's generated by Firefly III when saving a new webhook. If you submit a new secret through the PUT endpoint it will generate a new secret for the selected webhook, a new secret bearing no relation to whatever you just submitted. | [optional][readonly] +**trigger** | [**models::WebhookTrigger**](WebhookTrigger.md) | | +**response** | [**models::WebhookResponse**](WebhookResponse.md) | | +**delivery** | [**models::WebhookDelivery**](WebhookDelivery.md) | | +**url** | **String** | The URL of the webhook. Has to start with `https`. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookArray.md b/firefly-iii-api/docs/WebhookArray.md new file mode 100644 index 0000000..d779881 --- /dev/null +++ b/firefly-iii-api/docs/WebhookArray.md @@ -0,0 +1,13 @@ +# WebhookArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](WebhookRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | +**links** | [**models::PageLink**](PageLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookAttempt.md b/firefly-iii-api/docs/WebhookAttempt.md new file mode 100644 index 0000000..82545cb --- /dev/null +++ b/firefly-iii-api/docs/WebhookAttempt.md @@ -0,0 +1,16 @@ +# WebhookAttempt + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**webhook_message_id** | Option<**String**> | The ID of the webhook message this attempt belongs to. | [optional] +**status_code** | Option<**i32**> | The HTTP status code of the error, if any. | [optional] +**logs** | Option<**String**> | Internal log for this attempt. May contain sensitive user data. | [optional] +**response** | Option<**String**> | Webhook receiver response for this attempt, if any. May contain sensitive user data. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookAttemptArray.md b/firefly-iii-api/docs/WebhookAttemptArray.md new file mode 100644 index 0000000..563058e --- /dev/null +++ b/firefly-iii-api/docs/WebhookAttemptArray.md @@ -0,0 +1,12 @@ +# WebhookAttemptArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](WebhookAttemptRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookAttemptRead.md b/firefly-iii-api/docs/WebhookAttemptRead.md new file mode 100644 index 0000000..3cd235f --- /dev/null +++ b/firefly-iii-api/docs/WebhookAttemptRead.md @@ -0,0 +1,13 @@ +# WebhookAttemptRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::WebhookAttempt**](WebhookAttempt.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookAttemptSingle.md b/firefly-iii-api/docs/WebhookAttemptSingle.md new file mode 100644 index 0000000..725f2e1 --- /dev/null +++ b/firefly-iii-api/docs/WebhookAttemptSingle.md @@ -0,0 +1,11 @@ +# WebhookAttemptSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::WebhookAttemptRead**](WebhookAttemptRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookDelivery.md b/firefly-iii-api/docs/WebhookDelivery.md new file mode 100644 index 0000000..2b4a2f0 --- /dev/null +++ b/firefly-iii-api/docs/WebhookDelivery.md @@ -0,0 +1,12 @@ +# WebhookDelivery + +## Enum Variants + +| Name | Value | +|---- | -----| +| Json | JSON | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookMessage.md b/firefly-iii-api/docs/WebhookMessage.md new file mode 100644 index 0000000..0c82219 --- /dev/null +++ b/firefly-iii-api/docs/WebhookMessage.md @@ -0,0 +1,17 @@ +# WebhookMessage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional][readonly] +**updated_at** | Option<**String**> | | [optional][readonly] +**sent** | Option<**bool**> | If this message is sent yet. | [optional] +**errored** | Option<**bool**> | If this message has errored out. | [optional] +**webhook_id** | Option<**String**> | The ID of the webhook this message belongs to. | [optional] +**uuid** | Option<**String**> | Long UUID string for identification of this webhook message. | [optional] +**message** | Option<**String**> | The actual message that is sent or will be sent as JSON string. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookMessageArray.md b/firefly-iii-api/docs/WebhookMessageArray.md new file mode 100644 index 0000000..b510fca --- /dev/null +++ b/firefly-iii-api/docs/WebhookMessageArray.md @@ -0,0 +1,12 @@ +# WebhookMessageArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](WebhookMessageRead.md) | | +**meta** | [**models::Meta**](Meta.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookMessageRead.md b/firefly-iii-api/docs/WebhookMessageRead.md new file mode 100644 index 0000000..71874c0 --- /dev/null +++ b/firefly-iii-api/docs/WebhookMessageRead.md @@ -0,0 +1,13 @@ +# WebhookMessageRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::WebhookMessage**](WebhookMessage.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookMessageSingle.md b/firefly-iii-api/docs/WebhookMessageSingle.md new file mode 100644 index 0000000..31cf4c4 --- /dev/null +++ b/firefly-iii-api/docs/WebhookMessageSingle.md @@ -0,0 +1,11 @@ +# WebhookMessageSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::WebhookMessageRead**](WebhookMessageRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookRead.md b/firefly-iii-api/docs/WebhookRead.md new file mode 100644 index 0000000..d83fe4b --- /dev/null +++ b/firefly-iii-api/docs/WebhookRead.md @@ -0,0 +1,14 @@ +# WebhookRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#type** | **String** | Immutable value | +**id** | **String** | | +**attributes** | [**models::Webhook**](Webhook.md) | | +**links** | [**models::ObjectLink**](ObjectLink.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookResponse.md b/firefly-iii-api/docs/WebhookResponse.md new file mode 100644 index 0000000..3e88bef --- /dev/null +++ b/firefly-iii-api/docs/WebhookResponse.md @@ -0,0 +1,14 @@ +# WebhookResponse + +## Enum Variants + +| Name | Value | +|---- | -----| +| Transactions | TRANSACTIONS | +| Accounts | ACCOUNTS | +| None | NONE | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookSingle.md b/firefly-iii-api/docs/WebhookSingle.md new file mode 100644 index 0000000..f3fe174 --- /dev/null +++ b/firefly-iii-api/docs/WebhookSingle.md @@ -0,0 +1,11 @@ +# WebhookSingle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**models::WebhookRead**](WebhookRead.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookStore.md b/firefly-iii-api/docs/WebhookStore.md new file mode 100644 index 0000000..11531bf --- /dev/null +++ b/firefly-iii-api/docs/WebhookStore.md @@ -0,0 +1,16 @@ +# WebhookStore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | Option<**bool**> | Boolean to indicate if the webhook is active | [optional] +**title** | **String** | A title for the webhook for easy recognition. | +**trigger** | [**models::WebhookTrigger**](WebhookTrigger.md) | | +**response** | [**models::WebhookResponse**](WebhookResponse.md) | | +**delivery** | [**models::WebhookDelivery**](WebhookDelivery.md) | | +**url** | **String** | The URL of the webhook. Has to start with `https`. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookTrigger.md b/firefly-iii-api/docs/WebhookTrigger.md new file mode 100644 index 0000000..1b23a46 --- /dev/null +++ b/firefly-iii-api/docs/WebhookTrigger.md @@ -0,0 +1,14 @@ +# WebhookTrigger + +## Enum Variants + +| Name | Value | +|---- | -----| +| StoreTransaction | STORE_TRANSACTION | +| UpdateTransaction | UPDATE_TRANSACTION | +| DestroyTransaction | DESTROY_TRANSACTION | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhookUpdate.md b/firefly-iii-api/docs/WebhookUpdate.md new file mode 100644 index 0000000..6e37daa --- /dev/null +++ b/firefly-iii-api/docs/WebhookUpdate.md @@ -0,0 +1,17 @@ +# WebhookUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | Option<**bool**> | Boolean to indicate if the webhook is active | [optional] +**title** | Option<**String**> | A title for the webhook for easy recognition. | [optional] +**secret** | Option<**String**> | A 24-character secret for the webhook. It's generated by Firefly III when saving a new webhook. If you submit a new secret through the PUT endpoint it will generate a new secret for the selected webhook, a new secret bearing no relation to whatever you just submitted. | [optional] +**trigger** | Option<[**models::WebhookTrigger**](WebhookTrigger.md)> | | [optional] +**response** | Option<[**models::WebhookResponse**](WebhookResponse.md)> | | [optional] +**delivery** | Option<[**models::WebhookDelivery**](WebhookDelivery.md)> | | [optional] +**url** | Option<**String**> | The URL of the webhook. Has to start with `https`. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/firefly-iii-api/docs/WebhooksApi.md b/firefly-iii-api/docs/WebhooksApi.md new file mode 100644 index 0000000..2c1ed74 --- /dev/null +++ b/firefly-iii-api/docs/WebhooksApi.md @@ -0,0 +1,436 @@ +# \WebhooksApi + +All URIs are relative to *https://demo.firefly-iii.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_webhook**](WebhooksApi.md#delete_webhook) | **DELETE** /v1/webhooks/{id} | Delete a webhook. +[**delete_webhook_message**](WebhooksApi.md#delete_webhook_message) | **DELETE** /v1/webhooks/{id}/messages/{messageId} | Delete a webhook message. +[**delete_webhook_message_attempt**](WebhooksApi.md#delete_webhook_message_attempt) | **DELETE** /v1/webhooks/{id}/messages/{messageId}/attempts/{attemptId} | Delete a webhook attempt. +[**get_single_webhook_message**](WebhooksApi.md#get_single_webhook_message) | **GET** /v1/webhooks/{id}/messages/{messageId} | Get a single message from a webhook. +[**get_single_webhook_message_attempt**](WebhooksApi.md#get_single_webhook_message_attempt) | **GET** /v1/webhooks/{id}/messages/{messageId}/attempts/{attemptId} | Get a single failed attempt from a single webhook message. +[**get_webhook**](WebhooksApi.md#get_webhook) | **GET** /v1/webhooks/{id} | Get a single webhook. +[**get_webhook_message_attempts**](WebhooksApi.md#get_webhook_message_attempts) | **GET** /v1/webhooks/{id}/messages/{messageId}/attempts | Get all the failed attempts of a single webhook message. +[**get_webhook_messages**](WebhooksApi.md#get_webhook_messages) | **GET** /v1/webhooks/{id}/messages | Get all the messages of a single webhook. +[**list_webhook**](WebhooksApi.md#list_webhook) | **GET** /v1/webhooks | List all webhooks. +[**store_webhook**](WebhooksApi.md#store_webhook) | **POST** /v1/webhooks | Store a new webhook +[**submit_webook**](WebhooksApi.md#submit_webook) | **POST** /v1/webhooks/{id}/submit | Submit messages for a webhook. +[**trigger_transaction_webhook**](WebhooksApi.md#trigger_transaction_webhook) | **POST** /v1/webhooks/{id}/trigger-transaction/{transactionId} | Trigger webhook for a given transaction. +[**update_webhook**](WebhooksApi.md#update_webhook) | **PUT** /v1/webhooks/{id} | Update existing webhook. + + + +## delete_webhook + +> delete_webhook(id, x_trace_id) +Delete a webhook. + +Delete a webhook. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The webhook ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_webhook_message + +> delete_webhook_message(id, message_id, x_trace_id) +Delete a webhook message. + +Delete a webhook message. Any time a webhook is triggered the message is stored before it's sent. You can delete them before or after sending. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The webhook ID. | [required] | +**message_id** | **i32** | The webhook message ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_webhook_message_attempt + +> delete_webhook_message_attempt(id, message_id, attempt_id, x_trace_id) +Delete a webhook attempt. + +Delete a webhook message attempt. If you delete all attempts for a webhook message, Firefly III will (once again) assume all is well with the webhook message and will try to send it again. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The webhook ID. | [required] | +**message_id** | **i32** | The webhook message ID. | [required] | +**attempt_id** | **i32** | The webhook message attempt ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_single_webhook_message + +> models::WebhookMessageSingle get_single_webhook_message(id, message_id, x_trace_id) +Get a single message from a webhook. + +When a webhook is triggered it will store the actual content of the webhook in a webhook message. You can view and analyse a single one using this endpoint. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The webhook ID. | [required] | +**message_id** | **i32** | The webhook message ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::WebhookMessageSingle**](WebhookMessageSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_single_webhook_message_attempt + +> models::WebhookAttemptSingle get_single_webhook_message_attempt(id, message_id, attempt_id, x_trace_id) +Get a single failed attempt from a single webhook message. + +When a webhook message fails to send it will store the failure in an \"attempt\". You can view and analyse these. Webhooks messages that receive too many attempts (failures) will not be fired. You must first clear out old attempts and try again. This endpoint shows you the details of a single attempt. The ID of the attempt must match the corresponding webhook and webhook message. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The webhook ID. | [required] | +**message_id** | **i32** | The webhook message ID. | [required] | +**attempt_id** | **i32** | The webhook attempt ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::WebhookAttemptSingle**](WebhookAttemptSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_webhook + +> models::WebhookSingle get_webhook(id, x_trace_id) +Get a single webhook. + +Gets all info of a single webhook. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The webhook ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::WebhookSingle**](WebhookSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_webhook_message_attempts + +> models::WebhookAttemptArray get_webhook_message_attempts(id, message_id, x_trace_id, limit, page) +Get all the failed attempts of a single webhook message. + +When a webhook message fails to send it will store the failure in an \"attempt\". You can view and analyse these. Webhook messages that receive too many attempts (failures) will not be sent again. You must first clear out old attempts before the message can go out again. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The webhook ID. | [required] | +**message_id** | **i32** | The webhook message ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::WebhookAttemptArray**](WebhookAttemptArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_webhook_messages + +> models::WebhookMessageArray get_webhook_messages(id, x_trace_id) +Get all the messages of a single webhook. + +When a webhook is triggered the actual message that will be send is stored in a \"message\". You can view and analyse these messages. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The webhook ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::WebhookMessageArray**](WebhookMessageArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_webhook + +> models::WebhookArray list_webhook(x_trace_id, limit, page) +List all webhooks. + +List all the user's webhooks. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | +**limit** | Option<**i32**> | Number of items per page. The default pagination is per 50 items. | | +**page** | Option<**i32**> | Page number. The default pagination is per 50 items. | | + +### Return type + +[**models::WebhookArray**](WebhookArray.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## store_webhook + +> models::WebhookSingle store_webhook(webhook_store, x_trace_id) +Store a new webhook + +Creates a new webhook. The data required can be submitted as a JSON body or as a list of parameters. The webhook will be given a random secret. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**webhook_store** | [**WebhookStore**](WebhookStore.md) | JSON array or key=value pairs with the necessary webhook information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::WebhookSingle**](WebhookSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## submit_webook + +> submit_webook(id, x_trace_id) +Submit messages for a webhook. + +This endpoint will submit any open messages for this webhook. This is an asynchronous operation, so you can't see the result. Refresh the webhook message and/or the webhook message attempts to see the results. This may take some time if the webhook receiver is slow. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The webhook ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## trigger_transaction_webhook + +> trigger_transaction_webhook(id, transaction_id, x_trace_id) +Trigger webhook for a given transaction. + +This endpoint will execute this webhook for a given transaction ID. This is an asynchronous operation, so you can't see the result. Refresh the webhook message and/or the webhook message attempts to see the results. This may take some time if the webhook receiver is slow. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The webhook ID. | [required] | +**transaction_id** | **String** | The transaction ID. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + + (empty response body) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_webhook + +> models::WebhookSingle update_webhook(id, webhook_update, x_trace_id) +Update existing webhook. + +Update an existing webhook's information. If you wish to reset the secret, submit any value as the \"secret\". Firefly III will take this as a hint and reset the secret of the webhook. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | The webhook ID. | [required] | +**webhook_update** | [**WebhookUpdate**](WebhookUpdate.md) | JSON array with updated webhook information. See the model for the exact specifications. | [required] | +**x_trace_id** | Option<**uuid::Uuid**> | Unique identifier associated with this request. | | + +### Return type + +[**models::WebhookSingle**](WebhookSingle.md) + +### Authorization + +[firefly_iii_auth](../README.md#firefly_iii_auth), [local_bearer_auth](../README.md#local_bearer_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded +- **Accept**: application/vnd.api+json, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/firefly-iii-api/git_push.sh b/firefly-iii-api/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/firefly-iii-api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/firefly-iii-api/src/apis/about_api.rs b/firefly-iii-api/src/apis/about_api.rs new file mode 100644 index 0000000..c6e739c --- /dev/null +++ b/firefly-iii-api/src/apis/about_api.rs @@ -0,0 +1,168 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_about`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetAboutError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_cron`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetCronError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_current_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetCurrentUserError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Returns general system information and versions of the (supporting) software. +pub async fn get_about(configuration: &configuration::Configuration, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/about", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Firefly III has one endpoint for its various cron related tasks. Send a GET to this endpoint to run the cron. The cron requires the CLI token to be present. The cron job will fire for all users. +pub async fn get_cron(configuration: &configuration::Configuration, cli_token: &str, x_trace_id: Option<&str>, date: Option, force: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/cron/{cliToken}", local_var_configuration.base_path, cliToken=crate::apis::urlencode(cli_token)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = date { + local_var_req_builder = local_var_req_builder.query(&[("date", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = force { + local_var_req_builder = local_var_req_builder.query(&[("force", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Returns the currently authenticated user. +pub async fn get_current_user(configuration: &configuration::Configuration, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/about/user", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/accounts_api.rs b/firefly-iii-api/src/apis/accounts_api.rs new file mode 100644 index 0000000..c996f90 --- /dev/null +++ b/firefly-iii-api/src/apis/accounts_api.rs @@ -0,0 +1,448 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_account`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteAccountError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_account`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetAccountError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_account`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAccountError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_attachment_by_account`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAttachmentByAccountError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_piggy_bank_by_account`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListPiggyBankByAccountError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_transaction_by_account`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListTransactionByAccountError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_account`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreAccountError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + Status422(models::ValidationErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_account`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateAccountError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + Status422(models::ValidationErrorResponse), + UnknownValue(serde_json::Value), +} + + +/// Will permanently delete an account. Any associated transactions and piggy banks are ALSO deleted. Cannot be recovered from. +pub async fn delete_account(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/accounts/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Returns a single account by its ID. +pub async fn get_account(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, date: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/accounts/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = date { + local_var_req_builder = local_var_req_builder.query(&[("date", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint returns a list of all the accounts owned by the authenticated user. +pub async fn list_account(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option, date: Option, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/accounts", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = date { + local_var_req_builder = local_var_req_builder.query(&[("date", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists all attachments. +pub async fn list_attachment_by_account(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/accounts/{id}/attachments", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint returns a list of all the piggy banks connected to the account. +pub async fn list_piggy_bank_by_account(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/accounts/{id}/piggy-banks", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint returns a list of all the transactions connected to the account. +pub async fn list_transaction_by_account(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option, start: Option, end: Option, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/accounts/{id}/transactions", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a new account. The data required can be submitted as a JSON body or as a list of parameters (in key=value pairs, like a webform). +pub async fn store_account(configuration: &configuration::Configuration, account_store: models::AccountStore, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/accounts", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&account_store); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Used to update a single account. All fields that are not submitted will be cleared (set to NULL). The model will tell you which fields are mandatory. +pub async fn update_account(configuration: &configuration::Configuration, id: &str, account_update: models::AccountUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/accounts/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&account_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/attachments_api.rs b/firefly-iii-api/src/apis/attachments_api.rs new file mode 100644 index 0000000..b3dd01f --- /dev/null +++ b/firefly-iii-api/src/apis/attachments_api.rs @@ -0,0 +1,366 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_attachment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteAttachmentError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`download_attachment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DownloadAttachmentError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_attachment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetAttachmentError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_attachment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAttachmentError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_attachment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreAttachmentError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + Status422(models::ValidationErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_attachment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateAttachmentError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + Status422(models::ValidationErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`upload_attachment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UploadAttachmentError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + Status422(models::ValidationErrorResponse), + UnknownValue(serde_json::Value), +} + + +/// With this endpoint you delete an attachment, including any stored file data. +pub async fn delete_attachment(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/attachments/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint allows you to download the binary content of a transaction. It will be sent to you as a download, using the content type \"application/octet-stream\" and content disposition \"attachment; filename=example.pdf\". +pub async fn download_attachment(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/attachments/{id}/download", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get a single attachment. This endpoint only returns the available metadata for the attachment. Actual file data is handled in two other endpoints (see below). +pub async fn get_attachment(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/attachments/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint lists all attachments. +pub async fn list_attachment(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/attachments", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a new attachment. The data required can be submitted as a JSON body or as a list of parameters. You cannot use this endpoint to upload the actual file data (see below). This endpoint only creates the attachment object. +pub async fn store_attachment(configuration: &configuration::Configuration, attachment_store: models::AttachmentStore, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/attachments", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&attachment_store); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update the meta data for an existing attachment. This endpoint does not allow you to upload or download data. For that, see below. +pub async fn update_attachment(configuration: &configuration::Configuration, id: &str, attachment_update: models::AttachmentUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/attachments/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&attachment_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Use this endpoint to upload (and possible overwrite) the file contents of an attachment. Simply put the entire file in the body as binary data. +pub async fn upload_attachment(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, body: Option) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/attachments/{id}/upload", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/autocomplete_api.rs b/firefly-iii-api/src/apis/autocomplete_api.rs new file mode 100644 index 0000000..0000e0a --- /dev/null +++ b/firefly-iii-api/src/apis/autocomplete_api.rs @@ -0,0 +1,875 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_accounts_ac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetAccountsAcError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_bills_ac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetBillsAcError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_budgets_ac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetBudgetsAcError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_categories_ac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetCategoriesAcError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_currencies_ac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetCurrenciesAcError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_currencies_code_ac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetCurrenciesCodeAcError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_object_groups_ac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetObjectGroupsAcError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_piggies_ac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetPiggiesAcError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_piggies_balance_ac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetPiggiesBalanceAcError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_recurring_ac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetRecurringAcError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_rule_groups_ac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetRuleGroupsAcError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_rules_ac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetRulesAcError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_tag_ac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetTagAcError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_transaction_types_ac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetTransactionTypesAcError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_transactions_ac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetTransactionsAcError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_transactions_idac`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetTransactionsIdacError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +pub async fn get_accounts_ac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option, date: Option<&str>, types: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/accounts", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = date { + local_var_req_builder = local_var_req_builder.query(&[("date", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = types { + local_var_req_builder = match "csv" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("types".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("types", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_bills_ac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/bills", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_budgets_ac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/budgets", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_categories_ac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/categories", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_currencies_ac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/currencies", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_currencies_code_ac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/currencies-with-code", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_object_groups_ac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/object-groups", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_piggies_ac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/piggy-banks", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_piggies_balance_ac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/piggy-banks-with-balance", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_recurring_ac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/recurring", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_rule_groups_ac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/rule-groups", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_rules_ac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/rules", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_tag_ac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/tags", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_transaction_types_ac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/transaction-types", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_transactions_ac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/transactions", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_transactions_idac(configuration: &configuration::Configuration, x_trace_id: Option<&str>, query: Option<&str>, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/autocomplete/transactions-with-id", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = query { + local_var_req_builder = local_var_req_builder.query(&[("query", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/available_budgets_api.rs b/firefly-iii-api/src/apis/available_budgets_api.rs new file mode 100644 index 0000000..d271f22 --- /dev/null +++ b/firefly-iii-api/src/apis/available_budgets_api.rs @@ -0,0 +1,126 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_available_budget`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetAvailableBudgetError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_available_budget`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAvailableBudgetError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Get a single available budget, by ID. +pub async fn get_available_budget(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/available-budgets/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Firefly III allows users to set the amount that is available to be budgeted in so-called \"available budgets\". For example, the user could have 1200,- available to be divided during the coming month. This amount is used on the /budgets page. This endpoint returns all of these amounts and the periods for which they are set. +pub async fn list_available_budget(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option, start: Option, end: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/available-budgets", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/bills_api.rs b/firefly-iii-api/src/apis/bills_api.rs new file mode 100644 index 0000000..2697c0d --- /dev/null +++ b/firefly-iii-api/src/apis/bills_api.rs @@ -0,0 +1,445 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_bill`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteBillError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_bill`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetBillError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_attachment_by_bill`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAttachmentByBillError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_bill`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListBillError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_rule_by_bill`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListRuleByBillError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_transaction_by_bill`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListTransactionByBillError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_bill`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreBillError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + Status422(models::ValidationErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_bill`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateBillError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + Status422(models::ValidationErrorResponse), + UnknownValue(serde_json::Value), +} + + +/// Delete a bill. This will not delete any associated rules. Will not remove associated transactions. WILL remove all associated attachments. +pub async fn delete_bill(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/bills/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get a single bill. +pub async fn get_bill(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, start: Option, end: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/bills/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint will list all attachments linked to the bill. +pub async fn list_attachment_by_bill(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/bills/{id}/attachments", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint will list all the user's bills. +pub async fn list_bill(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option, start: Option, end: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/bills", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint will list all rules that have an action to set the bill to this bill. +pub async fn list_rule_by_bill(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/bills/{id}/rules", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint will list all transactions linked to this bill. +pub async fn list_transaction_by_bill(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option, start: Option, end: Option, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/bills/{id}/transactions", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a new bill. The data required can be submitted as a JSON body or as a list of parameters. +pub async fn store_bill(configuration: &configuration::Configuration, bill_store: models::BillStore, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/bills", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&bill_store); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update existing bill. +pub async fn update_bill(configuration: &configuration::Configuration, id: &str, bill_update: models::BillUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/bills/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&bill_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/budgets_api.rs b/firefly-iii-api/src/apis/budgets_api.rs new file mode 100644 index 0000000..67b3ce6 --- /dev/null +++ b/firefly-iii-api/src/apis/budgets_api.rs @@ -0,0 +1,753 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_budget`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteBudgetError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_budget_limit`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteBudgetLimitError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_budget`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetBudgetError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_budget_limit`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetBudgetLimitError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_attachment_by_budget`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAttachmentByBudgetError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_budget`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListBudgetError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_budget_limit`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListBudgetLimitError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_budget_limit_by_budget`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListBudgetLimitByBudgetError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_transaction_by_budget`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListTransactionByBudgetError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_transaction_by_budget_limit`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListTransactionByBudgetLimitError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_budget`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreBudgetError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_budget_limit`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreBudgetLimitError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_budget`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateBudgetError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_budget_limit`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateBudgetLimitError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Delete a budget. Transactions will not be deleted. +pub async fn delete_budget(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/budgets/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete a budget limit. +pub async fn delete_budget_limit(configuration: &configuration::Configuration, id: &str, limit_id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/budgets/{id}/limits/{limitId}", local_var_configuration.base_path, id=crate::apis::urlencode(id), limitId=crate::apis::urlencode(limit_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get a single budget. If the start date and end date are submitted as well, the \"spent\" array will be updated accordingly. +pub async fn get_budget(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, start: Option, end: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/budgets/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_budget_limit(configuration: &configuration::Configuration, id: &str, limit_id: i32, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/budgets/{id}/limits/{limitId}", local_var_configuration.base_path, id=crate::apis::urlencode(id), limitId=limit_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists all attachments. +pub async fn list_attachment_by_budget(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/budgets/{id}/attachments", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all the budgets the user has made. If the start date and end date are submitted as well, the \"spent\" array will be updated accordingly. +pub async fn list_budget(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option, start: Option, end: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/budgets", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get all budget limits for for this date range. +pub async fn list_budget_limit(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/budget-limits", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get all budget limits for this budget and the money spent, and money left. You can limit the list by submitting a date range as well. The \"spent\" array for each budget limit is NOT influenced by the start and end date of your query, but by the start and end date of the budget limit itself. +pub async fn list_budget_limit_by_budget(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, start: Option, end: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/budgets/{id}/limits", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get all transactions linked to a budget, possibly limited by start and end +pub async fn list_transaction_by_budget(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option, start: Option, end: Option, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/budgets/{id}/transactions", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all the transactions within one budget limit. The start and end date are dictated by the budget limit. +pub async fn list_transaction_by_budget_limit(configuration: &configuration::Configuration, id: &str, limit_id: &str, x_trace_id: Option<&str>, limit: Option, page: Option, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/budgets/{id}/limits/{limitId}/transactions", local_var_configuration.base_path, id=crate::apis::urlencode(id), limitId=crate::apis::urlencode(limit_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a new budget. The data required can be submitted as a JSON body or as a list of parameters. +pub async fn store_budget(configuration: &configuration::Configuration, budget_store: models::BudgetStore, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/budgets", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&budget_store); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Store a new budget limit under this budget. +pub async fn store_budget_limit(configuration: &configuration::Configuration, id: &str, budget_limit_store: models::BudgetLimitStore, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/budgets/{id}/limits", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&budget_limit_store); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update existing budget. This endpoint cannot be used to set budget amount limits. +pub async fn update_budget(configuration: &configuration::Configuration, id: &str, budget_update: models::BudgetUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/budgets/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&budget_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update existing budget limit. +pub async fn update_budget_limit(configuration: &configuration::Configuration, id: &str, limit_id: &str, budget_limit: models::BudgetLimit, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/budgets/{id}/limits/{limitId}", local_var_configuration.base_path, id=crate::apis::urlencode(id), limitId=crate::apis::urlencode(limit_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&budget_limit); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/categories_api.rs b/firefly-iii-api/src/apis/categories_api.rs new file mode 100644 index 0000000..21b7da3 --- /dev/null +++ b/firefly-iii-api/src/apis/categories_api.rs @@ -0,0 +1,391 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_category`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteCategoryError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_category`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetCategoryError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_attachment_by_category`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAttachmentByCategoryError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_category`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListCategoryError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_transaction_by_category`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListTransactionByCategoryError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_category`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreCategoryError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_category`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateCategoryError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Delete a category. Transactions will not be removed. +pub async fn delete_category(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/categories/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get a single category. +pub async fn get_category(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, start: Option, end: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/categories/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists all attachments. +pub async fn list_attachment_by_category(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/categories/{id}/attachments", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all categories. +pub async fn list_category(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/categories", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all transactions in a category, optionally limited to the date ranges specified. +pub async fn list_transaction_by_category(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option, start: Option, end: Option, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/categories/{id}/transactions", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a new category. The data required can be submitted as a JSON body or as a list of parameters. +pub async fn store_category(configuration: &configuration::Configuration, category: models::Category, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/categories", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&category); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update existing category. +pub async fn update_category(configuration: &configuration::Configuration, id: &str, category_update: models::CategoryUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/categories/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&category_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/charts_api.rs b/firefly-iii-api/src/apis/charts_api.rs new file mode 100644 index 0000000..5cdd72e --- /dev/null +++ b/firefly-iii-api/src/apis/charts_api.rs @@ -0,0 +1,68 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_chart_account_overview`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetChartAccountOverviewError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// This endpoint returns the data required to generate a chart with basic asset account balance information. +pub async fn get_chart_account_overview(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/chart/account/overview", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/configuration.rs b/firefly-iii-api/src/apis/configuration.rs new file mode 100644 index 0000000..80f9e18 --- /dev/null +++ b/firefly-iii-api/src/apis/configuration.rs @@ -0,0 +1,53 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "https://demo.firefly-iii.org/api".to_owned(), + user_agent: Some("OpenAPI-Generator/2.1.0/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + + } + } +} diff --git a/firefly-iii-api/src/apis/configuration_api.rs b/firefly-iii-api/src/apis/configuration_api.rs new file mode 100644 index 0000000..6e7a8fc --- /dev/null +++ b/firefly-iii-api/src/apis/configuration_api.rs @@ -0,0 +1,168 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_configuration`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetConfigurationError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_single_configuration`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetSingleConfigurationError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`set_configuration`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SetConfigurationError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Returns all editable and not-editable configuration values for this Firefly III installation +pub async fn get_configuration(configuration: &configuration::Configuration, x_trace_id: Option<&str>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/configuration", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Returns one configuration variable for this Firefly III installation +pub async fn get_single_configuration(configuration: &configuration::Configuration, name: models::ConfigValueFilter, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/configuration/{name}", local_var_configuration.base_path, name=name.to_string()); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Set a single configuration value. Not all configuration values can be updated so the list of accepted configuration variables is small. +pub async fn set_configuration(configuration: &configuration::Configuration, name: models::ConfigValueUpdateFilter, value: models::PolymorphicProperty, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/configuration/{name}", local_var_configuration.base_path, name=name.to_string()); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + // + //let mut local_var_form_params = std::collections::HashMap::new(); + //local_var_form_params.insert("value", value.to_string()); + //local_var_req_builder = local_var_req_builder.form(&local_var_form_params); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/currencies_api.rs b/firefly-iii-api/src/apis/currencies_api.rs new file mode 100644 index 0000000..b7520bf --- /dev/null +++ b/firefly-iii-api/src/apis/currencies_api.rs @@ -0,0 +1,860 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`default_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DefaultCurrencyError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteCurrencyError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`disable_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DisableCurrencyError { + Status409(), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enable_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnableCurrencyError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetCurrencyError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_default_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetDefaultCurrencyError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_account_by_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAccountByCurrencyError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_available_budget_by_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAvailableBudgetByCurrencyError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_bill_by_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListBillByCurrencyError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_budget_limit_by_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListBudgetLimitByCurrencyError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListCurrencyError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_recurrence_by_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListRecurrenceByCurrencyError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_rule_by_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListRuleByCurrencyError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_transaction_by_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListTransactionByCurrencyError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreCurrencyError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_currency`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateCurrencyError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Make this currency the default currency for the user. If the currency is not enabled, it will be enabled as well. +pub async fn default_currency(configuration: &configuration::Configuration, code: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies/{code}/default", local_var_configuration.base_path, code=crate::apis::urlencode(code)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete a currency. +pub async fn delete_currency(configuration: &configuration::Configuration, code: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies/{code}", local_var_configuration.base_path, code=crate::apis::urlencode(code)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Disable a currency. +pub async fn disable_currency(configuration: &configuration::Configuration, code: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies/{code}/disable", local_var_configuration.base_path, code=crate::apis::urlencode(code)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Enable a single currency. +pub async fn enable_currency(configuration: &configuration::Configuration, code: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies/{code}/enable", local_var_configuration.base_path, code=crate::apis::urlencode(code)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get a single currency. +pub async fn get_currency(configuration: &configuration::Configuration, code: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies/{code}", local_var_configuration.base_path, code=crate::apis::urlencode(code)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get the user's default currency. +pub async fn get_default_currency(configuration: &configuration::Configuration, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies/default", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all accounts with this currency. +pub async fn list_account_by_currency(configuration: &configuration::Configuration, code: &str, x_trace_id: Option<&str>, limit: Option, page: Option, date: Option, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies/{code}/accounts", local_var_configuration.base_path, code=crate::apis::urlencode(code)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = date { + local_var_req_builder = local_var_req_builder.query(&[("date", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all available budgets with this currency. +pub async fn list_available_budget_by_currency(configuration: &configuration::Configuration, code: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies/{code}/available-budgets", local_var_configuration.base_path, code=crate::apis::urlencode(code)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all bills with this currency. +pub async fn list_bill_by_currency(configuration: &configuration::Configuration, code: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies/{code}/bills", local_var_configuration.base_path, code=crate::apis::urlencode(code)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all budget limits with this currency +pub async fn list_budget_limit_by_currency(configuration: &configuration::Configuration, code: &str, x_trace_id: Option<&str>, limit: Option, page: Option, start: Option, end: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies/{code}/budget_limits", local_var_configuration.base_path, code=crate::apis::urlencode(code)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all currencies. +pub async fn list_currency(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all recurring transactions with this currency. +pub async fn list_recurrence_by_currency(configuration: &configuration::Configuration, code: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies/{code}/recurrences", local_var_configuration.base_path, code=crate::apis::urlencode(code)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all rules with this currency. +pub async fn list_rule_by_currency(configuration: &configuration::Configuration, code: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies/{code}/rules", local_var_configuration.base_path, code=crate::apis::urlencode(code)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all transactions with this currency. +pub async fn list_transaction_by_currency(configuration: &configuration::Configuration, code: &str, x_trace_id: Option<&str>, limit: Option, page: Option, start: Option, end: Option, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies/{code}/transactions", local_var_configuration.base_path, code=crate::apis::urlencode(code)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a new currency. The data required can be submitted as a JSON body or as a list of parameters. +pub async fn store_currency(configuration: &configuration::Configuration, currency_store: models::CurrencyStore, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(¤cy_store); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update existing currency. +pub async fn update_currency(configuration: &configuration::Configuration, code: &str, currency_update: models::CurrencyUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/currencies/{code}", local_var_configuration.base_path, code=crate::apis::urlencode(code)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(¤cy_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/data_api.rs b/firefly-iii-api/src/apis/data_api.rs new file mode 100644 index 0000000..f22a990 --- /dev/null +++ b/firefly-iii-api/src/apis/data_api.rs @@ -0,0 +1,624 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`bulk_update_transactions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum BulkUpdateTransactionsError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`destroy_data`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DestroyDataError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`export_accounts`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ExportAccountsError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`export_bills`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ExportBillsError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`export_budgets`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ExportBudgetsError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`export_categories`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ExportCategoriesError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`export_piggies`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ExportPiggiesError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`export_recurring`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ExportRecurringError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`export_rules`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ExportRulesError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`export_tags`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ExportTagsError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`export_transactions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ExportTransactionsError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`purge_data`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PurgeDataError { + Status401(models::UnauthenticatedResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Allows you to update transactions in bulk. +pub async fn bulk_update_transactions(configuration: &configuration::Configuration, query: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/data/bulk/transactions", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("query", &query.to_string())]); + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// A call to this endpoint deletes the requested data type. Use it with care and always with user permission. The demo user is incapable of using this endpoint. +pub async fn destroy_data(configuration: &configuration::Configuration, objects: models::DataDestroyObject, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/data/destroy", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("objects", &objects.to_string())]); + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint allows you to export your accounts from Firefly III into a file. Currently supports CSV exports only. +pub async fn export_accounts(configuration: &configuration::Configuration, x_trace_id: Option<&str>, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/data/export/accounts", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint allows you to export your bills from Firefly III into a file. Currently supports CSV exports only. +pub async fn export_bills(configuration: &configuration::Configuration, x_trace_id: Option<&str>, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/data/export/bills", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint allows you to export your budgets and associated budget data from Firefly III into a file. Currently supports CSV exports only. +pub async fn export_budgets(configuration: &configuration::Configuration, x_trace_id: Option<&str>, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/data/export/budgets", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint allows you to export your categories from Firefly III into a file. Currently supports CSV exports only. +pub async fn export_categories(configuration: &configuration::Configuration, x_trace_id: Option<&str>, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/data/export/categories", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint allows you to export your piggy banks from Firefly III into a file. Currently supports CSV exports only. +pub async fn export_piggies(configuration: &configuration::Configuration, x_trace_id: Option<&str>, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/data/export/piggy-banks", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint allows you to export your recurring transactions from Firefly III into a file. Currently supports CSV exports only. +pub async fn export_recurring(configuration: &configuration::Configuration, x_trace_id: Option<&str>, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/data/export/recurring", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint allows you to export your rules and rule groups from Firefly III into a file. Currently supports CSV exports only. +pub async fn export_rules(configuration: &configuration::Configuration, x_trace_id: Option<&str>, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/data/export/rules", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint allows you to export your tags from Firefly III into a file. Currently supports CSV exports only. +pub async fn export_tags(configuration: &configuration::Configuration, x_trace_id: Option<&str>, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/data/export/tags", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint allows you to export transactions from Firefly III into a file. Currently supports CSV exports only. +pub async fn export_transactions(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts: Option<&str>, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/data/export/transactions", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts { + local_var_req_builder = local_var_req_builder.query(&[("accounts", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// A call to this endpoint purges all previously deleted data. Use it with care and always with user permission. The demo user is incapable of using this endpoint. +pub async fn purge_data(configuration: &configuration::Configuration, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/data/purge", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/insight_api.rs b/firefly-iii-api/src/apis/insight_api.rs new file mode 100644 index 0000000..b07531c --- /dev/null +++ b/firefly-iii-api/src/apis/insight_api.rs @@ -0,0 +1,1410 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`insight_expense_asset`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightExpenseAssetError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_expense_bill`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightExpenseBillError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_expense_budget`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightExpenseBudgetError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_expense_category`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightExpenseCategoryError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_expense_expense`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightExpenseExpenseError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_expense_no_bill`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightExpenseNoBillError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_expense_no_budget`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightExpenseNoBudgetError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_expense_no_category`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightExpenseNoCategoryError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_expense_no_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightExpenseNoTagError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_expense_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightExpenseTagError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_expense_total`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightExpenseTotalError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_income_asset`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightIncomeAssetError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_income_category`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightIncomeCategoryError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_income_no_category`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightIncomeNoCategoryError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_income_no_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightIncomeNoTagError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_income_revenue`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightIncomeRevenueError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_income_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightIncomeTagError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_income_total`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightIncomeTotalError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_transfer_category`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightTransferCategoryError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_transfer_no_category`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightTransferNoCategoryError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_transfer_no_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightTransferNoTagError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_transfer_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightTransferTagError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_transfer_total`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightTransferTotalError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`insight_transfers`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InsightTransfersError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// This endpoint gives a summary of the expenses made by the user, grouped by asset account. +pub async fn insight_expense_asset(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/expense/asset", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the expenses made by the user, grouped by (any) bill. +pub async fn insight_expense_bill(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, bills_left_square_bracket_right_square_bracket: Option>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/expense/bill", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = bills_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("bills[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("bills[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the expenses made by the user, grouped by (any) budget. +pub async fn insight_expense_budget(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, budgets_left_square_bracket_right_square_bracket: Option>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/expense/budget", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = budgets_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("budgets[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("budgets[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the expenses made by the user, grouped by (any) category. +pub async fn insight_expense_category(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, categories_left_square_bracket_right_square_bracket: Option>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/expense/category", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = categories_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("categories[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("categories[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the expenses made by the user, grouped by expense account. +pub async fn insight_expense_expense(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/expense/expense", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the expenses made by the user, including only expenses with no bill. +pub async fn insight_expense_no_bill(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/expense/no-bill", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the expenses made by the user, including only expenses with no budget. +pub async fn insight_expense_no_budget(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/expense/no-budget", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the expenses made by the user, including only expenses with no category. +pub async fn insight_expense_no_category(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/expense/no-category", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the expenses made by the user, including only expenses with no tag. +pub async fn insight_expense_no_tag(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/expense/no-tag", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the expenses made by the user, grouped by (any) tag. +pub async fn insight_expense_tag(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, tags_left_square_bracket_right_square_bracket: Option>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/expense/tag", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = tags_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("tags[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a sum of the total expenses made by the user. +pub async fn insight_expense_total(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/expense/total", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the income received by the user, grouped by asset account. +pub async fn insight_income_asset(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/income/asset", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the income received by the user, grouped by (any) category. +pub async fn insight_income_category(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, categories_left_square_bracket_right_square_bracket: Option>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/income/category", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = categories_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("categories[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("categories[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the income received by the user, including only income with no category. +pub async fn insight_income_no_category(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/income/no-category", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the income received by the user, including only income with no tag. +pub async fn insight_income_no_tag(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/income/no-tag", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the income received by the user, grouped by revenue account. +pub async fn insight_income_revenue(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/income/revenue", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the income received by the user, grouped by (any) tag. +pub async fn insight_income_tag(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, tags_left_square_bracket_right_square_bracket: Option>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/income/tag", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = tags_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("tags[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a sum of the total income received by the user. +pub async fn insight_income_total(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/income/total", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the transfers made by the user, grouped by (any) category. +pub async fn insight_transfer_category(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, categories_left_square_bracket_right_square_bracket: Option>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/transfer/category", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = categories_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("categories[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("categories[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the transfers made by the user, including only transfers with no category. +pub async fn insight_transfer_no_category(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/transfer/no-category", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the transfers made by the user, including only transfers with no tag. +pub async fn insight_transfer_no_tag(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/transfer/no-tag", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the transfers created by the user, grouped by (any) tag. +pub async fn insight_transfer_tag(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, tags_left_square_bracket_right_square_bracket: Option>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/transfer/tag", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = tags_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tags[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("tags[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a sum of the total amount transfers made by the user. +pub async fn insight_transfer_total(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/transfer/total", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint gives a summary of the transfers made by the user, grouped by asset account or lability. +pub async fn insight_transfers(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, accounts_left_square_bracket_right_square_bracket: Option>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/insight/transfer/asset", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/links_api.rs b/firefly-iii-api/src/apis/links_api.rs new file mode 100644 index 0000000..f10068b --- /dev/null +++ b/firefly-iii-api/src/apis/links_api.rs @@ -0,0 +1,581 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_link_type`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteLinkTypeError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_transaction_link`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteTransactionLinkError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_link_type`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetLinkTypeError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_transaction_link`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetTransactionLinkError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_link_type`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListLinkTypeError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_transaction_by_link_type`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListTransactionByLinkTypeError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_transaction_link`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListTransactionLinkError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_link_type`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreLinkTypeError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_transaction_link`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreTransactionLinkError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_link_type`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateLinkTypeError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_transaction_link`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateTransactionLinkError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Will permanently delete a link type. The links between transactions will be removed. The transactions themselves remain. You cannot delete some of the system provided link types, indicated by the editable=false flag when you list it. +pub async fn delete_link_type(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/link-types/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Will permanently delete link. Transactions remain. +pub async fn delete_transaction_link(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/transaction-links/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Returns a single link type by its ID. +pub async fn get_link_type(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/link-types/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Returns a single link by its ID. +pub async fn get_transaction_link(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/transaction-links/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all the link types the system has. These include the default ones as well as any new ones. +pub async fn list_link_type(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/link-types", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all transactions under this link type, both the inward and outward transactions. +pub async fn list_transaction_by_link_type(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option, start: Option, end: Option, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/link-types/{id}/transactions", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all the transaction links. +pub async fn list_transaction_link(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/transaction-links", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a new link type. The data required can be submitted as a JSON body or as a list of parameters (in key=value pairs, like a webform). +pub async fn store_link_type(configuration: &configuration::Configuration, link_type: models::LinkType, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/link-types", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&link_type); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Store a new link between two transactions. For this end point you need the journal_id from a transaction. +pub async fn store_transaction_link(configuration: &configuration::Configuration, transaction_link_store: models::TransactionLinkStore, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/transaction-links", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&transaction_link_store); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Used to update a single link type. All fields that are not submitted will be cleared (set to NULL). The model will tell you which fields are mandatory. You cannot update some of the system provided link types, indicated by the editable=false flag when you list it. +pub async fn update_link_type(configuration: &configuration::Configuration, id: &str, link_type_update: models::LinkTypeUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/link-types/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&link_type_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Used to update a single existing link. +pub async fn update_transaction_link(configuration: &configuration::Configuration, id: &str, transaction_link_update: models::TransactionLinkUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/transaction-links/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&transaction_link_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/mod.rs b/firefly-iii-api/src/apis/mod.rs new file mode 100644 index 0000000..6219dc9 --- /dev/null +++ b/firefly-iii-api/src/apis/mod.rs @@ -0,0 +1,120 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod about_api; +pub mod accounts_api; +pub mod attachments_api; +pub mod autocomplete_api; +pub mod available_budgets_api; +pub mod bills_api; +pub mod budgets_api; +pub mod categories_api; +pub mod charts_api; +pub mod configuration_api; +pub mod currencies_api; +pub mod data_api; +pub mod insight_api; +pub mod links_api; +pub mod object_groups_api; +pub mod piggy_banks_api; +pub mod preferences_api; +pub mod recurrences_api; +pub mod rule_groups_api; +pub mod rules_api; +pub mod search_api; +pub mod summary_api; +pub mod tags_api; +pub mod transactions_api; +pub mod users_api; +pub mod webhooks_api; + +pub mod configuration; diff --git a/firefly-iii-api/src/apis/object_groups_api.rs b/firefly-iii-api/src/apis/object_groups_api.rs new file mode 100644 index 0000000..8d6eecd --- /dev/null +++ b/firefly-iii-api/src/apis/object_groups_api.rs @@ -0,0 +1,326 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_object_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteObjectGroupError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_object_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetObjectGroupError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_bill_by_object_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListBillByObjectGroupError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_object_groups`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListObjectGroupsError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_piggy_bank_by_object_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListPiggyBankByObjectGroupError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_object_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateObjectGroupError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Delete a object group. +pub async fn delete_object_group(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/object-groups/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get a single object group. +pub async fn get_object_group(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/object-groups/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all bills with this object group. +pub async fn list_bill_by_object_group(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/object-groups/{id}/bills", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all oject groups. +pub async fn list_object_groups(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/object-groups", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint returns a list of all the piggy banks connected to the object group. +pub async fn list_piggy_bank_by_object_group(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/object-groups/{id}/piggy-banks", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update existing object group. +pub async fn update_object_group(configuration: &configuration::Configuration, id: &str, object_group_update: models::ObjectGroupUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/object-groups/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&object_group_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/piggy_banks_api.rs b/firefly-iii-api/src/apis/piggy_banks_api.rs new file mode 100644 index 0000000..8458304 --- /dev/null +++ b/firefly-iii-api/src/apis/piggy_banks_api.rs @@ -0,0 +1,376 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_piggy_bank`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeletePiggyBankError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_piggy_bank`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetPiggyBankError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_attachment_by_piggy_bank`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAttachmentByPiggyBankError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_event_by_piggy_bank`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListEventByPiggyBankError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_piggy_bank`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListPiggyBankError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_piggy_bank`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StorePiggyBankError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_piggy_bank`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdatePiggyBankError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Delete a piggy bank. +pub async fn delete_piggy_bank(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/piggy-banks/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get a single piggy bank. +pub async fn get_piggy_bank(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/piggy-banks/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists all attachments. +pub async fn list_attachment_by_piggy_bank(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/piggy-banks/{id}/attachments", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all events linked to a piggy bank (adding and removing money). +pub async fn list_event_by_piggy_bank(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/piggy-banks/{id}/events", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all piggy banks. +pub async fn list_piggy_bank(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/piggy-banks", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a new piggy bank. The data required can be submitted as a JSON body or as a list of parameters. +pub async fn store_piggy_bank(configuration: &configuration::Configuration, piggy_bank_store: models::PiggyBankStore, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/piggy-banks", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&piggy_bank_store); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update existing piggy bank. +pub async fn update_piggy_bank(configuration: &configuration::Configuration, id: &str, piggy_bank_update: models::PiggyBankUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/piggy-banks/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&piggy_bank_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/preferences_api.rs b/firefly-iii-api/src/apis/preferences_api.rs new file mode 100644 index 0000000..84e2cae --- /dev/null +++ b/firefly-iii-api/src/apis/preferences_api.rs @@ -0,0 +1,220 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_preference`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetPreferenceError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_preference`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListPreferenceError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_preference`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StorePreferenceError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_preference`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdatePreferenceError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Return a single preference and the value. +pub async fn get_preference(configuration: &configuration::Configuration, name: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/preferences/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all of the preferences of the user. +pub async fn list_preference(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/preferences", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint creates a new preference. The name and data are free-format, and entirely up to you. If the preference is not used in Firefly III itself it may not be configurable through the user interface, but you can use this endpoint to persist custom data for your own app. +pub async fn store_preference(configuration: &configuration::Configuration, preference: models::Preference, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/preferences", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&preference); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update a user's preference. +pub async fn update_preference(configuration: &configuration::Configuration, name: &str, preference_update: models::PreferenceUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/preferences/{name}", local_var_configuration.base_path, name=crate::apis::urlencode(name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&preference_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/recurrences_api.rs b/firefly-iii-api/src/apis/recurrences_api.rs new file mode 100644 index 0000000..b4510f3 --- /dev/null +++ b/firefly-iii-api/src/apis/recurrences_api.rs @@ -0,0 +1,331 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_recurrence`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteRecurrenceError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_recurrence`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetRecurrenceError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_recurrence`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListRecurrenceError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_transaction_by_recurrence`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListTransactionByRecurrenceError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_recurrence`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreRecurrenceError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_recurrence`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateRecurrenceError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Delete a recurring transaction. Transactions created by the recurring transaction will not be deleted. +pub async fn delete_recurrence(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/recurrences/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get a single recurring transaction. +pub async fn get_recurrence(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/recurrences/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all recurring transactions. +pub async fn list_recurrence(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/recurrences", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all transactions created by a recurring transaction, optionally limited to the date ranges specified. +pub async fn list_transaction_by_recurrence(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option, start: Option, end: Option, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/recurrences/{id}/transactions", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a new recurring transaction. The data required can be submitted as a JSON body or as a list of parameters. +pub async fn store_recurrence(configuration: &configuration::Configuration, recurrence_store: models::RecurrenceStore, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/recurrences", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&recurrence_store); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update existing recurring transaction. +pub async fn update_recurrence(configuration: &configuration::Configuration, id: &str, recurrence_update: models::RecurrenceUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/recurrences/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&recurrence_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/rule_groups_api.rs b/firefly-iii-api/src/apis/rule_groups_api.rs new file mode 100644 index 0000000..957c3ca --- /dev/null +++ b/firefly-iii-api/src/apis/rule_groups_api.rs @@ -0,0 +1,454 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_rule_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteRuleGroupError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`fire_rule_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FireRuleGroupError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_rule_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetRuleGroupError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_rule_by_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListRuleByGroupError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_rule_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListRuleGroupError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_rule_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreRuleGroupError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`test_rule_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestRuleGroupError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_rule_group`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateRuleGroupError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Delete a rule group. +pub async fn delete_rule_group(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/rule-groups/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Fire the rule group on your transactions. Changes will be made by the rules in the rule group! Limit the result if you want to. +pub async fn fire_rule_group(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, start: Option, end: Option, accounts_left_square_bracket_right_square_bracket: Option>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/rule-groups/{id}/trigger", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get a single rule group. This does not include the rules. For that, see below. +pub async fn get_rule_group(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/rule-groups/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List rules in this rule group. +pub async fn list_rule_by_group(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/rule-groups/{id}/rules", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all rule groups. +pub async fn list_rule_group(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/rule-groups", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a new rule group. The data required can be submitted as a JSON body or as a list of parameters. +pub async fn store_rule_group(configuration: &configuration::Configuration, rule_group_store: models::RuleGroupStore, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/rule-groups", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&rule_group_store); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Test which transactions would be hit by the rule group. No changes will be made. Limit the result if you want to. +pub async fn test_rule_group(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option, start: Option, end: Option, search_limit: Option, triggered_limit: Option, accounts_left_square_bracket_right_square_bracket: Option>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/rule-groups/{id}/test", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = search_limit { + local_var_req_builder = local_var_req_builder.query(&[("search_limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = triggered_limit { + local_var_req_builder = local_var_req_builder.query(&[("triggered_limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update existing rule group. +pub async fn update_rule_group(configuration: &configuration::Configuration, id: &str, rule_group_update: models::RuleGroupUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/rule-groups/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&rule_group_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/rules_api.rs b/firefly-iii-api/src/apis/rules_api.rs new file mode 100644 index 0000000..be3dd2a --- /dev/null +++ b/firefly-iii-api/src/apis/rules_api.rs @@ -0,0 +1,388 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_rule`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteRuleError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`fire_rule`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FireRuleError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_rule`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetRuleError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_rule`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListRuleError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_rule`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreRuleError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`test_rule`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TestRuleError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_rule`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateRuleError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Delete an rule. +pub async fn delete_rule(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/rules/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Fire the rule group on your transactions. Changes will be made by the rules in the group! Limit the result if you want to. +pub async fn fire_rule(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, start: Option, end: Option, accounts_left_square_bracket_right_square_bracket: Option>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/rules/{id}/trigger", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get a single rule. +pub async fn get_rule(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/rules/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all rules. +pub async fn list_rule(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/rules", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a new rule. The data required can be submitted as a JSON body or as a list of parameters. +pub async fn store_rule(configuration: &configuration::Configuration, rule_store: models::RuleStore, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/rules", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&rule_store); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Test which transactions would be hit by the rule. No changes will be made. Limit the result if you want to. +pub async fn test_rule(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, start: Option, end: Option, accounts_left_square_bracket_right_square_bracket: Option>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/rules/{id}/test", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = accounts_left_square_bracket_right_square_bracket { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("accounts[]".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("accounts[]", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update existing rule. +pub async fn update_rule(configuration: &configuration::Configuration, id: &str, rule_update: models::RuleUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/rules/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&rule_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/search_api.rs b/firefly-iii-api/src/apis/search_api.rs new file mode 100644 index 0000000..108d2ca --- /dev/null +++ b/firefly-iii-api/src/apis/search_api.rs @@ -0,0 +1,132 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`search_accounts`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SearchAccountsError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`search_transactions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SearchTransactionsError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Search for accounts +pub async fn search_accounts(configuration: &configuration::Configuration, query: &str, field: models::AccountSearchFieldFilter, x_trace_id: Option<&str>, limit: Option, page: Option, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/search/accounts", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + local_var_req_builder = local_var_req_builder.query(&[("query", &query.to_string())]); + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + local_var_req_builder = local_var_req_builder.query(&[("field", &field.to_string())]); + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Searches through the users transactions. +pub async fn search_transactions(configuration: &configuration::Configuration, query: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/search/transactions", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + local_var_req_builder = local_var_req_builder.query(&[("query", &query.to_string())]); + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/summary_api.rs b/firefly-iii-api/src/apis/summary_api.rs new file mode 100644 index 0000000..0ed9b33 --- /dev/null +++ b/firefly-iii-api/src/apis/summary_api.rs @@ -0,0 +1,71 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_basic_summary`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetBasicSummaryError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Returns basic sums of the users data, like the net worth, spent and earned amounts. It is multi-currency, and is used in Firefly III to populate the dashboard. +pub async fn get_basic_summary(configuration: &configuration::Configuration, start: String, end: String, x_trace_id: Option<&str>, currency_code: Option<&str>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/summary/basic", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("start", &start.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("end", &end.to_string())]); + if let Some(ref local_var_str) = currency_code { + local_var_req_builder = local_var_req_builder.query(&[("currency_code", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/tags_api.rs b/firefly-iii-api/src/apis/tags_api.rs new file mode 100644 index 0000000..5766906 --- /dev/null +++ b/firefly-iii-api/src/apis/tags_api.rs @@ -0,0 +1,391 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteTagError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetTagError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_attachment_by_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAttachmentByTagError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListTagError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_transaction_by_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListTransactionByTagError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreTagError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateTagError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Delete an tag. +pub async fn delete_tag(configuration: &configuration::Configuration, tag: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/tags/{tag}", local_var_configuration.base_path, tag=crate::apis::urlencode(tag)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get a single tag. +pub async fn get_tag(configuration: &configuration::Configuration, tag: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/tags/{tag}", local_var_configuration.base_path, tag=crate::apis::urlencode(tag)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists all attachments. +pub async fn list_attachment_by_tag(configuration: &configuration::Configuration, tag: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/tags/{tag}/attachments", local_var_configuration.base_path, tag=crate::apis::urlencode(tag)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all of the user's tags. +pub async fn list_tag(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/tags", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all transactions with this tag. +pub async fn list_transaction_by_tag(configuration: &configuration::Configuration, tag: &str, x_trace_id: Option<&str>, limit: Option, page: Option, start: Option, end: Option, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/tags/{tag}/transactions", local_var_configuration.base_path, tag=crate::apis::urlencode(tag)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a new tag. The data required can be submitted as a JSON body or as a list of parameters. +pub async fn store_tag(configuration: &configuration::Configuration, tag_model_store: models::TagModelStore, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/tags", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&tag_model_store); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update existing tag. +pub async fn update_tag(configuration: &configuration::Configuration, tag: &str, tag_model_update: models::TagModelUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/tags/{tag}", local_var_configuration.base_path, tag=crate::apis::urlencode(tag)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&tag_model_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/transactions_api.rs b/firefly-iii-api/src/apis/transactions_api.rs new file mode 100644 index 0000000..d978099 --- /dev/null +++ b/firefly-iii-api/src/apis/transactions_api.rs @@ -0,0 +1,535 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_transaction`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteTransactionError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_transaction_journal`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteTransactionJournalError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_transaction`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetTransactionError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_transaction_by_journal`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetTransactionByJournalError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_attachment_by_transaction`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListAttachmentByTransactionError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_event_by_transaction`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListEventByTransactionError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_links_by_journal`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListLinksByJournalError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_transaction`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListTransactionError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_transaction`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreTransactionError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_transaction`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateTransactionError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Delete a transaction. +pub async fn delete_transaction(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/transactions/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete an individual journal (split) from a transaction. +pub async fn delete_transaction_journal(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/transaction-journals/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get a single transaction. +pub async fn get_transaction(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/transactions/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get a single transaction by underlying journal (split). +pub async fn get_transaction_by_journal(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/transaction-journals/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists all attachments. +pub async fn list_attachment_by_transaction(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/transactions/{id}/attachments", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists all piggy bank events. +pub async fn list_event_by_transaction(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/transactions/{id}/piggy-bank-events", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lists all the transaction links for an individual journal (a split). Don't use the group ID, you need the actual underlying journal (the split). +pub async fn list_links_by_journal(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/transaction-journals/{id}/links", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all the user's transactions. +pub async fn list_transaction(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option, start: Option, end: Option, r#type: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/transactions", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = start { + local_var_req_builder = local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a new transaction. The data required can be submitted as a JSON body or as a list of parameters. +pub async fn store_transaction(configuration: &configuration::Configuration, transaction_store: models::TransactionStore, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/transactions", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&transaction_store); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update an existing transaction. +pub async fn update_transaction(configuration: &configuration::Configuration, id: &str, transaction_update: models::TransactionUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/transactions/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&transaction_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/users_api.rs b/firefly-iii-api/src/apis/users_api.rs new file mode 100644 index 0000000..7c20997 --- /dev/null +++ b/firefly-iii-api/src/apis/users_api.rs @@ -0,0 +1,268 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteUserError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListUserError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreUserError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + Status422(models::ValidationErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateUserError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Delete a user. You cannot delete the user you're authenticated with. This cannot be undone. Be careful! +pub async fn delete_user(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/users/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Gets all info of a single user. +pub async fn get_user(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/users/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all the users in this instance of Firefly III. +pub async fn list_user(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/users", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a new user. The data required can be submitted as a JSON body or as a list of parameters. The user will be given a random password, which they can reset using the \"forgot password\" function. +pub async fn store_user(configuration: &configuration::Configuration, user: models::User, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/users", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&user); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update existing user. +pub async fn update_user(configuration: &configuration::Configuration, id: &str, user: models::User, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/users/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&user); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/apis/webhooks_api.rs b/firefly-iii-api/src/apis/webhooks_api.rs new file mode 100644 index 0000000..afff019 --- /dev/null +++ b/firefly-iii-api/src/apis/webhooks_api.rs @@ -0,0 +1,654 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_webhook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteWebhookError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_webhook_message`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteWebhookMessageError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_webhook_message_attempt`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteWebhookMessageAttemptError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_single_webhook_message`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetSingleWebhookMessageError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_single_webhook_message_attempt`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetSingleWebhookMessageAttemptError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_webhook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetWebhookError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_webhook_message_attempts`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetWebhookMessageAttemptsError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_webhook_messages`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetWebhookMessagesError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_webhook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListWebhookError { + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`store_webhook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StoreWebhookError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`submit_webook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SubmitWebookError { + Status404(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`trigger_transaction_webhook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TriggerTransactionWebhookError { + Status404(), + Status500(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_webhook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateWebhookError { + Status422(models::ValidationErrorResponse), + Status401(models::UnauthenticatedResponse), + Status404(models::NotFoundResponse), + Status400(models::BadRequestResponse), + Status500(models::InternalExceptionResponse), + UnknownValue(serde_json::Value), +} + + +/// Delete a webhook. +pub async fn delete_webhook(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/webhooks/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete a webhook message. Any time a webhook is triggered the message is stored before it's sent. You can delete them before or after sending. +pub async fn delete_webhook_message(configuration: &configuration::Configuration, id: &str, message_id: i32, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/webhooks/{id}/messages/{messageId}", local_var_configuration.base_path, id=crate::apis::urlencode(id), messageId=message_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete a webhook message attempt. If you delete all attempts for a webhook message, Firefly III will (once again) assume all is well with the webhook message and will try to send it again. +pub async fn delete_webhook_message_attempt(configuration: &configuration::Configuration, id: &str, message_id: i32, attempt_id: i32, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/webhooks/{id}/messages/{messageId}/attempts/{attemptId}", local_var_configuration.base_path, id=crate::apis::urlencode(id), messageId=message_id, attemptId=attempt_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// When a webhook is triggered it will store the actual content of the webhook in a webhook message. You can view and analyse a single one using this endpoint. +pub async fn get_single_webhook_message(configuration: &configuration::Configuration, id: &str, message_id: i32, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/webhooks/{id}/messages/{messageId}", local_var_configuration.base_path, id=crate::apis::urlencode(id), messageId=message_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// When a webhook message fails to send it will store the failure in an \"attempt\". You can view and analyse these. Webhooks messages that receive too many attempts (failures) will not be fired. You must first clear out old attempts and try again. This endpoint shows you the details of a single attempt. The ID of the attempt must match the corresponding webhook and webhook message. +pub async fn get_single_webhook_message_attempt(configuration: &configuration::Configuration, id: &str, message_id: i32, attempt_id: i32, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/webhooks/{id}/messages/{messageId}/attempts/{attemptId}", local_var_configuration.base_path, id=crate::apis::urlencode(id), messageId=message_id, attemptId=attempt_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Gets all info of a single webhook. +pub async fn get_webhook(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/webhooks/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// When a webhook message fails to send it will store the failure in an \"attempt\". You can view and analyse these. Webhook messages that receive too many attempts (failures) will not be sent again. You must first clear out old attempts before the message can go out again. +pub async fn get_webhook_message_attempts(configuration: &configuration::Configuration, id: &str, message_id: i32, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/webhooks/{id}/messages/{messageId}/attempts", local_var_configuration.base_path, id=crate::apis::urlencode(id), messageId=message_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// When a webhook is triggered the actual message that will be send is stored in a \"message\". You can view and analyse these messages. +pub async fn get_webhook_messages(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/webhooks/{id}/messages", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all the user's webhooks. +pub async fn list_webhook(configuration: &configuration::Configuration, x_trace_id: Option<&str>, limit: Option, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/webhooks", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Creates a new webhook. The data required can be submitted as a JSON body or as a list of parameters. The webhook will be given a random secret. +pub async fn store_webhook(configuration: &configuration::Configuration, webhook_store: models::WebhookStore, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/webhooks", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&webhook_store); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint will submit any open messages for this webhook. This is an asynchronous operation, so you can't see the result. Refresh the webhook message and/or the webhook message attempts to see the results. This may take some time if the webhook receiver is slow. +pub async fn submit_webook(configuration: &configuration::Configuration, id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/webhooks/{id}/submit", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This endpoint will execute this webhook for a given transaction ID. This is an asynchronous operation, so you can't see the result. Refresh the webhook message and/or the webhook message attempts to see the results. This may take some time if the webhook receiver is slow. +pub async fn trigger_transaction_webhook(configuration: &configuration::Configuration, id: &str, transaction_id: &str, x_trace_id: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/webhooks/{id}/trigger-transaction/{transactionId}", local_var_configuration.base_path, id=crate::apis::urlencode(id), transactionId=crate::apis::urlencode(transaction_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update an existing webhook's information. If you wish to reset the secret, submit any value as the \"secret\". Firefly III will take this as a hint and reset the secret of the webhook. +pub async fn update_webhook(configuration: &configuration::Configuration, id: &str, webhook_update: models::WebhookUpdate, x_trace_id: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/v1/webhooks/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(local_var_param_value) = x_trace_id { + local_var_req_builder = local_var_req_builder.header("X-Trace-Id", local_var_param_value.to_string()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&webhook_update); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/firefly-iii-api/src/lib.rs b/firefly-iii-api/src/lib.rs new file mode 100644 index 0000000..e152062 --- /dev/null +++ b/firefly-iii-api/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/firefly-iii-api/src/models/account.rs b/firefly-iii-api/src/models/account.rs new file mode 100644 index 0000000..cc94c1b --- /dev/null +++ b/firefly-iii-api/src/models/account.rs @@ -0,0 +1,131 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Account { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// If omitted, defaults to true. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Order of the account. Is NULL if account is not asset or liability. + #[serde(rename = "order", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub order: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "type")] + pub r#type: models::ShortAccountTypeProperty, + #[serde(rename = "account_role", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub account_role: Option>, + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, + #[serde(rename = "current_balance", skip_serializing_if = "Option::is_none")] + pub current_balance: Option, + /// The timestamp for this date is always 23:59:59, to indicate it's the balance at the very END of that particular day. + #[serde(rename = "current_balance_date", skip_serializing_if = "Option::is_none")] + pub current_balance_date: Option, + #[serde(rename = "iban", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub iban: Option>, + #[serde(rename = "bic", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bic: Option>, + #[serde(rename = "account_number", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub account_number: Option>, + /// Represents the opening balance, the initial amount this account holds. + #[serde(rename = "opening_balance", skip_serializing_if = "Option::is_none")] + pub opening_balance: Option, + /// Represents the current debt for liabilities. + #[serde(rename = "current_debt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub current_debt: Option>, + /// Represents the date of the opening balance. + #[serde(rename = "opening_balance_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub opening_balance_date: Option>, + #[serde(rename = "virtual_balance", skip_serializing_if = "Option::is_none")] + pub virtual_balance: Option, + /// If omitted, defaults to true. + #[serde(rename = "include_net_worth", skip_serializing_if = "Option::is_none")] + pub include_net_worth: Option, + #[serde(rename = "credit_card_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub credit_card_type: Option>, + /// Mandatory when the account_role is ccAsset. Moment at which CC payment installments are asked for by the bank. + #[serde(rename = "monthly_payment_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub monthly_payment_date: Option>, + #[serde(rename = "liability_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub liability_type: Option>, + #[serde(rename = "liability_direction", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub liability_direction: Option>, + /// Mandatory when type is liability. Interest percentage. + #[serde(rename = "interest", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub interest: Option>, + #[serde(rename = "interest_period", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub interest_period: Option>, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + /// Latitude of the accounts's location, if applicable. Can be used to draw a map. + #[serde(rename = "latitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub latitude: Option>, + /// Latitude of the accounts's location, if applicable. Can be used to draw a map. + #[serde(rename = "longitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub longitude: Option>, + /// Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. + #[serde(rename = "zoom_level", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub zoom_level: Option>, +} + +impl Account { + pub fn new(name: String, r#type: models::ShortAccountTypeProperty) -> Account { + Account { + created_at: None, + updated_at: None, + active: None, + order: None, + name, + r#type, + account_role: None, + currency_id: None, + currency_code: None, + currency_symbol: None, + currency_decimal_places: None, + current_balance: None, + current_balance_date: None, + iban: None, + bic: None, + account_number: None, + opening_balance: None, + current_debt: None, + opening_balance_date: None, + virtual_balance: None, + include_net_worth: None, + credit_card_type: None, + monthly_payment_date: None, + liability_type: None, + liability_direction: None, + interest: None, + interest_period: None, + notes: None, + latitude: None, + longitude: None, + zoom_level: None, + } + } +} + diff --git a/firefly-iii-api/src/models/account_array.rs b/firefly-iii-api/src/models/account_array.rs new file mode 100644 index 0000000..7bce4f9 --- /dev/null +++ b/firefly-iii-api/src/models/account_array.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AccountArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, +} + +impl AccountArray { + pub fn new(data: Vec, meta: models::Meta) -> AccountArray { + AccountArray { + data, + meta: Box::new(meta), + } + } +} + diff --git a/firefly-iii-api/src/models/account_read.rs b/firefly-iii-api/src/models/account_read.rs new file mode 100644 index 0000000..6a9a973 --- /dev/null +++ b/firefly-iii-api/src/models/account_read.rs @@ -0,0 +1,34 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AccountRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, +} + +impl AccountRead { + pub fn new(r#type: String, id: String, attributes: models::Account) -> AccountRead { + AccountRead { + r#type, + id, + attributes: Box::new(attributes), + } + } +} + diff --git a/firefly-iii-api/src/models/account_role_property.rs b/firefly-iii-api/src/models/account_role_property.rs new file mode 100644 index 0000000..a7f26ed --- /dev/null +++ b/firefly-iii-api/src/models/account_role_property.rs @@ -0,0 +1,51 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// AccountRoleProperty : Is only mandatory when the type is asset. +/// Is only mandatory when the type is asset. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AccountRoleProperty { + #[serde(rename = "defaultAsset")] + DefaultAsset, + #[serde(rename = "sharedAsset")] + SharedAsset, + #[serde(rename = "savingAsset")] + SavingAsset, + #[serde(rename = "ccAsset")] + CcAsset, + #[serde(rename = "cashWalletAsset")] + CashWalletAsset, + #[serde(rename = "null")] + Null, + +} + +impl std::fmt::Display for AccountRoleProperty { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::DefaultAsset => write!(f, "defaultAsset"), + Self::SharedAsset => write!(f, "sharedAsset"), + Self::SavingAsset => write!(f, "savingAsset"), + Self::CcAsset => write!(f, "ccAsset"), + Self::CashWalletAsset => write!(f, "cashWalletAsset"), + Self::Null => write!(f, "null"), + } + } +} + +impl Default for AccountRoleProperty { + fn default() -> AccountRoleProperty { + Self::DefaultAsset + } +} + diff --git a/firefly-iii-api/src/models/account_search_field_filter.rs b/firefly-iii-api/src/models/account_search_field_filter.rs new file mode 100644 index 0000000..36adbec --- /dev/null +++ b/firefly-iii-api/src/models/account_search_field_filter.rs @@ -0,0 +1,47 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AccountSearchFieldFilter { + #[serde(rename = "all")] + All, + #[serde(rename = "iban")] + Iban, + #[serde(rename = "name")] + Name, + #[serde(rename = "number")] + Number, + #[serde(rename = "id")] + Id, + +} + +impl std::fmt::Display for AccountSearchFieldFilter { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::All => write!(f, "all"), + Self::Iban => write!(f, "iban"), + Self::Name => write!(f, "name"), + Self::Number => write!(f, "number"), + Self::Id => write!(f, "id"), + } + } +} + +impl Default for AccountSearchFieldFilter { + fn default() -> AccountSearchFieldFilter { + Self::All + } +} + diff --git a/firefly-iii-api/src/models/account_single.rs b/firefly-iii-api/src/models/account_single.rs new file mode 100644 index 0000000..39a302f --- /dev/null +++ b/firefly-iii-api/src/models/account_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AccountSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl AccountSingle { + pub fn new(data: models::AccountRead) -> AccountSingle { + AccountSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/account_store.rs b/firefly-iii-api/src/models/account_store.rs new file mode 100644 index 0000000..e5b6e5f --- /dev/null +++ b/firefly-iii-api/src/models/account_store.rs @@ -0,0 +1,108 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AccountStore { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "type")] + pub r#type: models::ShortAccountTypeProperty, + #[serde(rename = "iban", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub iban: Option>, + #[serde(rename = "bic", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bic: Option>, + #[serde(rename = "account_number", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub account_number: Option>, + /// Represents the opening balance, the initial amount this account holds. + #[serde(rename = "opening_balance", skip_serializing_if = "Option::is_none")] + pub opening_balance: Option, + /// Represents the date of the opening balance. + #[serde(rename = "opening_balance_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub opening_balance_date: Option>, + #[serde(rename = "virtual_balance", skip_serializing_if = "Option::is_none")] + pub virtual_balance: Option, + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + /// If omitted, defaults to true. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Order of the account + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + /// If omitted, defaults to true. + #[serde(rename = "include_net_worth", skip_serializing_if = "Option::is_none")] + pub include_net_worth: Option, + #[serde(rename = "account_role", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub account_role: Option>, + #[serde(rename = "credit_card_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub credit_card_type: Option>, + /// Mandatory when the account_role is ccAsset. Moment at which CC payment installments are asked for by the bank. + #[serde(rename = "monthly_payment_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub monthly_payment_date: Option>, + #[serde(rename = "liability_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub liability_type: Option>, + #[serde(rename = "liability_direction", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub liability_direction: Option>, + /// Mandatory when type is liability. Interest percentage. + #[serde(rename = "interest", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub interest: Option>, + #[serde(rename = "interest_period", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub interest_period: Option>, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + /// Latitude of the accounts's location, if applicable. Can be used to draw a map. + #[serde(rename = "latitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub latitude: Option>, + /// Latitude of the accounts's location, if applicable. Can be used to draw a map. + #[serde(rename = "longitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub longitude: Option>, + /// Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. + #[serde(rename = "zoom_level", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub zoom_level: Option>, +} + +impl AccountStore { + pub fn new(name: String, r#type: models::ShortAccountTypeProperty) -> AccountStore { + AccountStore { + name, + r#type, + iban: None, + bic: None, + account_number: None, + opening_balance: None, + opening_balance_date: None, + virtual_balance: None, + currency_id: None, + currency_code: None, + active: None, + order: None, + include_net_worth: None, + account_role: None, + credit_card_type: None, + monthly_payment_date: None, + liability_type: None, + liability_direction: None, + interest: None, + interest_period: None, + notes: None, + latitude: None, + longitude: None, + zoom_level: None, + } + } +} + diff --git a/firefly-iii-api/src/models/account_type_filter.rs b/firefly-iii-api/src/models/account_type_filter.rs new file mode 100644 index 0000000..47f7ba2 --- /dev/null +++ b/firefly-iii-api/src/models/account_type_filter.rs @@ -0,0 +1,95 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AccountTypeFilter { + #[serde(rename = "all")] + All, + #[serde(rename = "asset")] + Asset, + #[serde(rename = "cash")] + Cash, + #[serde(rename = "expense")] + Expense, + #[serde(rename = "revenue")] + Revenue, + #[serde(rename = "special")] + Special, + #[serde(rename = "hidden")] + Hidden, + #[serde(rename = "liability")] + Liability, + #[serde(rename = "liabilities")] + Liabilities, + #[serde(rename = "Default account")] + DefaultAccount, + #[serde(rename = "Cash account")] + CashAccount, + #[serde(rename = "Asset account")] + AssetAccount, + #[serde(rename = "Expense account")] + ExpenseAccount, + #[serde(rename = "Revenue account")] + RevenueAccount, + #[serde(rename = "Initial balance account")] + InitialBalanceAccount, + #[serde(rename = "Beneficiary account")] + BeneficiaryAccount, + #[serde(rename = "Import account")] + ImportAccount, + #[serde(rename = "Reconciliation account")] + ReconciliationAccount, + #[serde(rename = "Loan")] + Loan, + #[serde(rename = "Debt")] + Debt, + #[serde(rename = "Mortgage")] + Mortgage, + +} + +impl std::fmt::Display for AccountTypeFilter { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::All => write!(f, "all"), + Self::Asset => write!(f, "asset"), + Self::Cash => write!(f, "cash"), + Self::Expense => write!(f, "expense"), + Self::Revenue => write!(f, "revenue"), + Self::Special => write!(f, "special"), + Self::Hidden => write!(f, "hidden"), + Self::Liability => write!(f, "liability"), + Self::Liabilities => write!(f, "liabilities"), + Self::DefaultAccount => write!(f, "Default account"), + Self::CashAccount => write!(f, "Cash account"), + Self::AssetAccount => write!(f, "Asset account"), + Self::ExpenseAccount => write!(f, "Expense account"), + Self::RevenueAccount => write!(f, "Revenue account"), + Self::InitialBalanceAccount => write!(f, "Initial balance account"), + Self::BeneficiaryAccount => write!(f, "Beneficiary account"), + Self::ImportAccount => write!(f, "Import account"), + Self::ReconciliationAccount => write!(f, "Reconciliation account"), + Self::Loan => write!(f, "Loan"), + Self::Debt => write!(f, "Debt"), + Self::Mortgage => write!(f, "Mortgage"), + } + } +} + +impl Default for AccountTypeFilter { + fn default() -> AccountTypeFilter { + Self::All + } +} + diff --git a/firefly-iii-api/src/models/account_type_property.rs b/firefly-iii-api/src/models/account_type_property.rs new file mode 100644 index 0000000..b579e6f --- /dev/null +++ b/firefly-iii-api/src/models/account_type_property.rs @@ -0,0 +1,68 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AccountTypeProperty { + #[serde(rename = "Default account")] + DefaultAccount, + #[serde(rename = "Cash account")] + CashAccount, + #[serde(rename = "Asset account")] + AssetAccount, + #[serde(rename = "Expense account")] + ExpenseAccount, + #[serde(rename = "Revenue account")] + RevenueAccount, + #[serde(rename = "Initial balance account")] + InitialBalanceAccount, + #[serde(rename = "Beneficiary account")] + BeneficiaryAccount, + #[serde(rename = "Import account")] + ImportAccount, + #[serde(rename = "Reconciliation account")] + ReconciliationAccount, + #[serde(rename = "Loan")] + Loan, + #[serde(rename = "Debt")] + Debt, + #[serde(rename = "Mortgage")] + Mortgage, + +} + +impl std::fmt::Display for AccountTypeProperty { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::DefaultAccount => write!(f, "Default account"), + Self::CashAccount => write!(f, "Cash account"), + Self::AssetAccount => write!(f, "Asset account"), + Self::ExpenseAccount => write!(f, "Expense account"), + Self::RevenueAccount => write!(f, "Revenue account"), + Self::InitialBalanceAccount => write!(f, "Initial balance account"), + Self::BeneficiaryAccount => write!(f, "Beneficiary account"), + Self::ImportAccount => write!(f, "Import account"), + Self::ReconciliationAccount => write!(f, "Reconciliation account"), + Self::Loan => write!(f, "Loan"), + Self::Debt => write!(f, "Debt"), + Self::Mortgage => write!(f, "Mortgage"), + } + } +} + +impl Default for AccountTypeProperty { + fn default() -> AccountTypeProperty { + Self::DefaultAccount + } +} + diff --git a/firefly-iii-api/src/models/account_update.rs b/firefly-iii-api/src/models/account_update.rs new file mode 100644 index 0000000..e9231e9 --- /dev/null +++ b/firefly-iii-api/src/models/account_update.rs @@ -0,0 +1,100 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AccountUpdate { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "iban", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub iban: Option>, + #[serde(rename = "bic", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bic: Option>, + #[serde(rename = "account_number", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub account_number: Option>, + #[serde(rename = "opening_balance", skip_serializing_if = "Option::is_none")] + pub opening_balance: Option, + #[serde(rename = "opening_balance_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub opening_balance_date: Option>, + #[serde(rename = "virtual_balance", skip_serializing_if = "Option::is_none")] + pub virtual_balance: Option, + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + /// If omitted, defaults to true. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Order of the account + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + /// If omitted, defaults to true. + #[serde(rename = "include_net_worth", skip_serializing_if = "Option::is_none")] + pub include_net_worth: Option, + #[serde(rename = "account_role", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub account_role: Option>, + #[serde(rename = "credit_card_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub credit_card_type: Option>, + /// Mandatory when the account_role is ccAsset. Moment at which CC payment installments are asked for by the bank. + #[serde(rename = "monthly_payment_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub monthly_payment_date: Option>, + #[serde(rename = "liability_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub liability_type: Option>, + /// Mandatory when type is liability. Interest percentage. + #[serde(rename = "interest", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub interest: Option>, + #[serde(rename = "interest_period", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub interest_period: Option>, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + /// Latitude of the account's location, if applicable. Can be used to draw a map. If omitted, the existing location will be kept. If submitted as NULL, the current location will be removed. + #[serde(rename = "latitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub latitude: Option>, + /// Latitude of the account's location, if applicable. Can be used to draw a map. If omitted, the existing location will be kept. If submitted as NULL, the current location will be removed. + #[serde(rename = "longitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub longitude: Option>, + /// Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. If omitted, the existing location will be kept. If submitted as NULL, the current location will be removed. + #[serde(rename = "zoom_level", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub zoom_level: Option>, +} + +impl AccountUpdate { + pub fn new(name: String) -> AccountUpdate { + AccountUpdate { + name, + iban: None, + bic: None, + account_number: None, + opening_balance: None, + opening_balance_date: None, + virtual_balance: None, + currency_id: None, + currency_code: None, + active: None, + order: None, + include_net_worth: None, + account_role: None, + credit_card_type: None, + monthly_payment_date: None, + liability_type: None, + interest: None, + interest_period: None, + notes: None, + latitude: None, + longitude: None, + zoom_level: None, + } + } +} + diff --git a/firefly-iii-api/src/models/attachable_type.rs b/firefly-iii-api/src/models/attachable_type.rs new file mode 100644 index 0000000..eb29301 --- /dev/null +++ b/firefly-iii-api/src/models/attachable_type.rs @@ -0,0 +1,51 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// AttachableType : The object class to which the attachment must be linked. +/// The object class to which the attachment must be linked. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AttachableType { + #[serde(rename = "Account")] + Account, + #[serde(rename = "Budget")] + Budget, + #[serde(rename = "Bill")] + Bill, + #[serde(rename = "TransactionJournal")] + TransactionJournal, + #[serde(rename = "PiggyBank")] + PiggyBank, + #[serde(rename = "Tag")] + Tag, + +} + +impl std::fmt::Display for AttachableType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Account => write!(f, "Account"), + Self::Budget => write!(f, "Budget"), + Self::Bill => write!(f, "Bill"), + Self::TransactionJournal => write!(f, "TransactionJournal"), + Self::PiggyBank => write!(f, "PiggyBank"), + Self::Tag => write!(f, "Tag"), + } + } +} + +impl Default for AttachableType { + fn default() -> AttachableType { + Self::Account + } +} + diff --git a/firefly-iii-api/src/models/attachment.rs b/firefly-iii-api/src/models/attachment.rs new file mode 100644 index 0000000..cb74714 --- /dev/null +++ b/firefly-iii-api/src/models/attachment.rs @@ -0,0 +1,62 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Attachment { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "attachable_type")] + pub attachable_type: models::AttachableType, + /// ID of the model this attachment is linked to. + #[serde(rename = "attachable_id")] + pub attachable_id: String, + /// MD5 hash of the file for basic duplicate detection. + #[serde(rename = "md5", skip_serializing_if = "Option::is_none")] + pub md5: Option, + #[serde(rename = "filename")] + pub filename: String, + #[serde(rename = "download_url", skip_serializing_if = "Option::is_none")] + pub download_url: Option, + #[serde(rename = "upload_url", skip_serializing_if = "Option::is_none")] + pub upload_url: Option, + #[serde(rename = "title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub title: Option>, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + #[serde(rename = "mime", skip_serializing_if = "Option::is_none")] + pub mime: Option, + #[serde(rename = "size", skip_serializing_if = "Option::is_none")] + pub size: Option, +} + +impl Attachment { + pub fn new(attachable_type: models::AttachableType, attachable_id: String, filename: String) -> Attachment { + Attachment { + created_at: None, + updated_at: None, + attachable_type, + attachable_id, + md5: None, + filename, + download_url: None, + upload_url: None, + title: None, + notes: None, + mime: None, + size: None, + } + } +} + diff --git a/firefly-iii-api/src/models/attachment_array.rs b/firefly-iii-api/src/models/attachment_array.rs new file mode 100644 index 0000000..e64d7ff --- /dev/null +++ b/firefly-iii-api/src/models/attachment_array.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AttachmentArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, +} + +impl AttachmentArray { + pub fn new(data: Vec, meta: models::Meta) -> AttachmentArray { + AttachmentArray { + data, + meta: Box::new(meta), + } + } +} + diff --git a/firefly-iii-api/src/models/attachment_read.rs b/firefly-iii-api/src/models/attachment_read.rs new file mode 100644 index 0000000..f042c86 --- /dev/null +++ b/firefly-iii-api/src/models/attachment_read.rs @@ -0,0 +1,37 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AttachmentRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl AttachmentRead { + pub fn new(r#type: String, id: String, attributes: models::Attachment, links: models::ObjectLink) -> AttachmentRead { + AttachmentRead { + r#type, + id, + attributes: Box::new(attributes), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/attachment_single.rs b/firefly-iii-api/src/models/attachment_single.rs new file mode 100644 index 0000000..1a59460 --- /dev/null +++ b/firefly-iii-api/src/models/attachment_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AttachmentSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl AttachmentSingle { + pub fn new(data: models::AttachmentRead) -> AttachmentSingle { + AttachmentSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/attachment_store.rs b/firefly-iii-api/src/models/attachment_store.rs new file mode 100644 index 0000000..07107f7 --- /dev/null +++ b/firefly-iii-api/src/models/attachment_store.rs @@ -0,0 +1,40 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AttachmentStore { + #[serde(rename = "filename")] + pub filename: String, + #[serde(rename = "attachable_type")] + pub attachable_type: models::AttachableType, + /// ID of the model this attachment is linked to. + #[serde(rename = "attachable_id")] + pub attachable_id: String, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, +} + +impl AttachmentStore { + pub fn new(filename: String, attachable_type: models::AttachableType, attachable_id: String) -> AttachmentStore { + AttachmentStore { + filename, + attachable_type, + attachable_id, + title: None, + notes: None, + } + } +} + diff --git a/firefly-iii-api/src/models/attachment_update.rs b/firefly-iii-api/src/models/attachment_update.rs new file mode 100644 index 0000000..e0ce901 --- /dev/null +++ b/firefly-iii-api/src/models/attachment_update.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AttachmentUpdate { + #[serde(rename = "filename", skip_serializing_if = "Option::is_none")] + pub filename: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, +} + +impl AttachmentUpdate { + pub fn new() -> AttachmentUpdate { + AttachmentUpdate { + filename: None, + title: None, + notes: None, + } + } +} + diff --git a/firefly-iii-api/src/models/auto_budget_period.rs b/firefly-iii-api/src/models/auto_budget_period.rs new file mode 100644 index 0000000..0921ac8 --- /dev/null +++ b/firefly-iii-api/src/models/auto_budget_period.rs @@ -0,0 +1,54 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// AutoBudgetPeriod : Period for the auto budget +/// Period for the auto budget +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AutoBudgetPeriod { + #[serde(rename = "daily")] + Daily, + #[serde(rename = "weekly")] + Weekly, + #[serde(rename = "monthly")] + Monthly, + #[serde(rename = "quarterly")] + Quarterly, + #[serde(rename = "half-year")] + HalfYear, + #[serde(rename = "yearly")] + Yearly, + #[serde(rename = "null")] + Null, + +} + +impl std::fmt::Display for AutoBudgetPeriod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Daily => write!(f, "daily"), + Self::Weekly => write!(f, "weekly"), + Self::Monthly => write!(f, "monthly"), + Self::Quarterly => write!(f, "quarterly"), + Self::HalfYear => write!(f, "half-year"), + Self::Yearly => write!(f, "yearly"), + Self::Null => write!(f, "null"), + } + } +} + +impl Default for AutoBudgetPeriod { + fn default() -> AutoBudgetPeriod { + Self::Daily + } +} + diff --git a/firefly-iii-api/src/models/auto_budget_type.rs b/firefly-iii-api/src/models/auto_budget_type.rs new file mode 100644 index 0000000..c792aee --- /dev/null +++ b/firefly-iii-api/src/models/auto_budget_type.rs @@ -0,0 +1,45 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// AutoBudgetType : The type of auto-budget that Firefly III must create. +/// The type of auto-budget that Firefly III must create. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AutoBudgetType { + #[serde(rename = "reset")] + Reset, + #[serde(rename = "rollover")] + Rollover, + #[serde(rename = "none")] + None, + #[serde(rename = "null")] + Null, + +} + +impl std::fmt::Display for AutoBudgetType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Reset => write!(f, "reset"), + Self::Rollover => write!(f, "rollover"), + Self::None => write!(f, "none"), + Self::Null => write!(f, "null"), + } + } +} + +impl Default for AutoBudgetType { + fn default() -> AutoBudgetType { + Self::Reset + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_account.rs b/firefly-iii-api/src/models/autocomplete_account.rs new file mode 100644 index 0000000..2b85f7f --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_account.rs @@ -0,0 +1,59 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompleteAccount { + #[serde(rename = "id")] + pub id: String, + /// Name of the account found by an auto-complete search. + #[serde(rename = "name")] + pub name: String, + /// Asset accounts and liabilities have a second field with the given date's account balance. + #[serde(rename = "name_with_balance")] + pub name_with_balance: String, + /// Account type of the account found by the auto-complete search. + #[serde(rename = "type")] + pub r#type: String, + /// ID for the currency used by this account. + #[serde(rename = "currency_id")] + pub currency_id: String, + /// Currency name for the currency used by this account. + #[serde(rename = "currency_name")] + pub currency_name: String, + /// Currency code for the currency used by this account. + #[serde(rename = "currency_code")] + pub currency_code: String, + /// Currency symbol for the currency used by this account. + #[serde(rename = "currency_symbol")] + pub currency_symbol: String, + /// Number of decimal places for the currency used by this account. + #[serde(rename = "currency_decimal_places")] + pub currency_decimal_places: i32, +} + +impl AutocompleteAccount { + pub fn new(id: String, name: String, name_with_balance: String, r#type: String, currency_id: String, currency_name: String, currency_code: String, currency_symbol: String, currency_decimal_places: i32) -> AutocompleteAccount { + AutocompleteAccount { + id, + name, + name_with_balance, + r#type, + currency_id, + currency_name, + currency_code, + currency_symbol, + currency_decimal_places, + } + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_bill.rs b/firefly-iii-api/src/models/autocomplete_bill.rs new file mode 100644 index 0000000..343aabd --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_bill.rs @@ -0,0 +1,35 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompleteBill { + #[serde(rename = "id")] + pub id: String, + /// Name of the bill found by an auto-complete search. + #[serde(rename = "name")] + pub name: String, + /// Is the bill active or not? + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, +} + +impl AutocompleteBill { + pub fn new(id: String, name: String) -> AutocompleteBill { + AutocompleteBill { + id, + name, + active: None, + } + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_budget.rs b/firefly-iii-api/src/models/autocomplete_budget.rs new file mode 100644 index 0000000..e1d419b --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_budget.rs @@ -0,0 +1,31 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompleteBudget { + #[serde(rename = "id")] + pub id: String, + /// Name of the budget found by an auto-complete search. + #[serde(rename = "name")] + pub name: String, +} + +impl AutocompleteBudget { + pub fn new(id: String, name: String) -> AutocompleteBudget { + AutocompleteBudget { + id, + name, + } + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_category.rs b/firefly-iii-api/src/models/autocomplete_category.rs new file mode 100644 index 0000000..386d551 --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_category.rs @@ -0,0 +1,31 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompleteCategory { + #[serde(rename = "id")] + pub id: String, + /// Name of the category found by an auto-complete search. + #[serde(rename = "name")] + pub name: String, +} + +impl AutocompleteCategory { + pub fn new(id: String, name: String) -> AutocompleteCategory { + AutocompleteCategory { + id, + name, + } + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_currency.rs b/firefly-iii-api/src/models/autocomplete_currency.rs new file mode 100644 index 0000000..1e1325e --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_currency.rs @@ -0,0 +1,41 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompleteCurrency { + #[serde(rename = "id")] + pub id: String, + /// Currency name. + #[serde(rename = "name")] + pub name: String, + /// Currency code. + #[serde(rename = "code")] + pub code: String, + #[serde(rename = "symbol")] + pub symbol: String, + #[serde(rename = "decimal_places")] + pub decimal_places: i32, +} + +impl AutocompleteCurrency { + pub fn new(id: String, name: String, code: String, symbol: String, decimal_places: i32) -> AutocompleteCurrency { + AutocompleteCurrency { + id, + name, + code, + symbol, + decimal_places, + } + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_currency_code.rs b/firefly-iii-api/src/models/autocomplete_currency_code.rs new file mode 100644 index 0000000..c34bbfc --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_currency_code.rs @@ -0,0 +1,41 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompleteCurrencyCode { + #[serde(rename = "id")] + pub id: String, + /// Currency name with the code between brackets. + #[serde(rename = "name")] + pub name: String, + /// Currency code. + #[serde(rename = "code")] + pub code: String, + #[serde(rename = "symbol")] + pub symbol: String, + #[serde(rename = "decimal_places")] + pub decimal_places: i32, +} + +impl AutocompleteCurrencyCode { + pub fn new(id: String, name: String, code: String, symbol: String, decimal_places: i32) -> AutocompleteCurrencyCode { + AutocompleteCurrencyCode { + id, + name, + code, + symbol, + decimal_places, + } + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_object_group.rs b/firefly-iii-api/src/models/autocomplete_object_group.rs new file mode 100644 index 0000000..01a0996 --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_object_group.rs @@ -0,0 +1,35 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompleteObjectGroup { + #[serde(rename = "id")] + pub id: String, + /// Title of the object group found by an auto-complete search. + #[serde(rename = "title")] + pub title: String, + /// Title of the object group found by an auto-complete search. + #[serde(rename = "name")] + pub name: String, +} + +impl AutocompleteObjectGroup { + pub fn new(id: String, title: String, name: String) -> AutocompleteObjectGroup { + AutocompleteObjectGroup { + id, + title, + name, + } + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_piggy.rs b/firefly-iii-api/src/models/autocomplete_piggy.rs new file mode 100644 index 0000000..dd676f5 --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_piggy.rs @@ -0,0 +1,57 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompletePiggy { + #[serde(rename = "id")] + pub id: String, + /// Name of the piggy bank found by an auto-complete search. + #[serde(rename = "name")] + pub name: String, + /// Currency ID for this piggy bank. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// Currency code for this piggy bank. + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + /// Currency name for the currency used by this account. + #[serde(rename = "currency_name", skip_serializing_if = "Option::is_none")] + pub currency_name: Option, + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, + /// The group ID of the group this object is part of. NULL if no group. + #[serde(rename = "object_group_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_id: Option>, + /// The name of the group. NULL if no group. + #[serde(rename = "object_group_title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_title: Option>, +} + +impl AutocompletePiggy { + pub fn new(id: String, name: String) -> AutocompletePiggy { + AutocompletePiggy { + id, + name, + currency_id: None, + currency_code: None, + currency_symbol: None, + currency_name: None, + currency_decimal_places: None, + object_group_id: None, + object_group_title: None, + } + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_piggy_balance.rs b/firefly-iii-api/src/models/autocomplete_piggy_balance.rs new file mode 100644 index 0000000..71d65a2 --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_piggy_balance.rs @@ -0,0 +1,57 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompletePiggyBalance { + #[serde(rename = "id")] + pub id: String, + /// Name of the piggy bank found by an auto-complete search. + #[serde(rename = "name")] + pub name: String, + /// Name of the piggy bank found by an auto-complete search with the current balance formatted nicely. + #[serde(rename = "name_with_balance", skip_serializing_if = "Option::is_none")] + pub name_with_balance: Option, + /// Currency ID for this piggy bank. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// Currency code for this piggy bank. + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, + /// The group ID of the group this object is part of. NULL if no group. + #[serde(rename = "object_group_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_id: Option>, + /// The name of the group. NULL if no group. + #[serde(rename = "object_group_title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_title: Option>, +} + +impl AutocompletePiggyBalance { + pub fn new(id: String, name: String) -> AutocompletePiggyBalance { + AutocompletePiggyBalance { + id, + name, + name_with_balance: None, + currency_id: None, + currency_code: None, + currency_symbol: None, + currency_decimal_places: None, + object_group_id: None, + object_group_title: None, + } + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_recurrence.rs b/firefly-iii-api/src/models/autocomplete_recurrence.rs new file mode 100644 index 0000000..f6ccfc9 --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_recurrence.rs @@ -0,0 +1,35 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompleteRecurrence { + #[serde(rename = "id")] + pub id: String, + /// Name of the recurrence found by an auto-complete search. + #[serde(rename = "name")] + pub name: String, + /// Description of the recurrence found by auto-complete. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, +} + +impl AutocompleteRecurrence { + pub fn new(id: String, name: String) -> AutocompleteRecurrence { + AutocompleteRecurrence { + id, + name, + description: None, + } + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_rule.rs b/firefly-iii-api/src/models/autocomplete_rule.rs new file mode 100644 index 0000000..ec5562b --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_rule.rs @@ -0,0 +1,35 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompleteRule { + #[serde(rename = "id")] + pub id: String, + /// Name of the rule found by an auto-complete search. + #[serde(rename = "name")] + pub name: String, + /// Description of the rule found by auto-complete. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, +} + +impl AutocompleteRule { + pub fn new(id: String, name: String) -> AutocompleteRule { + AutocompleteRule { + id, + name, + description: None, + } + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_rule_group.rs b/firefly-iii-api/src/models/autocomplete_rule_group.rs new file mode 100644 index 0000000..abb3330 --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_rule_group.rs @@ -0,0 +1,35 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompleteRuleGroup { + #[serde(rename = "id")] + pub id: String, + /// Name of the rule group found by an auto-complete search. + #[serde(rename = "name")] + pub name: String, + /// Description of the rule group found by auto-complete. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, +} + +impl AutocompleteRuleGroup { + pub fn new(id: String, name: String) -> AutocompleteRuleGroup { + AutocompleteRuleGroup { + id, + name, + description: None, + } + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_tag.rs b/firefly-iii-api/src/models/autocomplete_tag.rs new file mode 100644 index 0000000..15391fd --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_tag.rs @@ -0,0 +1,35 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompleteTag { + #[serde(rename = "id")] + pub id: String, + /// Name of the tag found by an auto-complete search. + #[serde(rename = "name")] + pub name: String, + /// Name of the tag found by an auto-complete search. + #[serde(rename = "tag")] + pub tag: String, +} + +impl AutocompleteTag { + pub fn new(id: String, name: String, tag: String) -> AutocompleteTag { + AutocompleteTag { + id, + name, + tag, + } + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_transaction.rs b/firefly-iii-api/src/models/autocomplete_transaction.rs new file mode 100644 index 0000000..8641d4e --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_transaction.rs @@ -0,0 +1,40 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompleteTransaction { + /// The ID of a transaction journal (basically a single split). + #[serde(rename = "id")] + pub id: String, + /// The ID of the underlying transaction group. + #[serde(rename = "transaction_group_id", skip_serializing_if = "Option::is_none")] + pub transaction_group_id: Option, + /// Transaction description + #[serde(rename = "name")] + pub name: String, + /// Transaction description + #[serde(rename = "description")] + pub description: String, +} + +impl AutocompleteTransaction { + pub fn new(id: String, name: String, description: String) -> AutocompleteTransaction { + AutocompleteTransaction { + id, + transaction_group_id: None, + name, + description, + } + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_transaction_id.rs b/firefly-iii-api/src/models/autocomplete_transaction_id.rs new file mode 100644 index 0000000..39ad404 --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_transaction_id.rs @@ -0,0 +1,40 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompleteTransactionId { + /// The ID of a transaction journal (basically a single split). + #[serde(rename = "id")] + pub id: String, + /// The ID of the underlying transaction group. + #[serde(rename = "transaction_group_id", skip_serializing_if = "Option::is_none")] + pub transaction_group_id: Option, + /// Transaction description with ID in the name. + #[serde(rename = "name")] + pub name: String, + /// Transaction description with ID in the name. + #[serde(rename = "description")] + pub description: String, +} + +impl AutocompleteTransactionId { + pub fn new(id: String, name: String, description: String) -> AutocompleteTransactionId { + AutocompleteTransactionId { + id, + transaction_group_id: None, + name, + description, + } + } +} + diff --git a/firefly-iii-api/src/models/autocomplete_transaction_type.rs b/firefly-iii-api/src/models/autocomplete_transaction_type.rs new file mode 100644 index 0000000..e292dea --- /dev/null +++ b/firefly-iii-api/src/models/autocomplete_transaction_type.rs @@ -0,0 +1,35 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutocompleteTransactionType { + #[serde(rename = "id")] + pub id: String, + /// Type of the object found by an auto-complete search. + #[serde(rename = "name")] + pub name: String, + /// Name of the object found by an auto-complete search. + #[serde(rename = "type")] + pub r#type: String, +} + +impl AutocompleteTransactionType { + pub fn new(id: String, name: String, r#type: String) -> AutocompleteTransactionType { + AutocompleteTransactionType { + id, + name, + r#type, + } + } +} + diff --git a/firefly-iii-api/src/models/available_budget.rs b/firefly-iii-api/src/models/available_budget.rs new file mode 100644 index 0000000..bc5944e --- /dev/null +++ b/firefly-iii-api/src/models/available_budget.rs @@ -0,0 +1,61 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AvailableBudget { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// Use either currency_id or currency_code. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// Use either currency_id or currency_code. + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, + #[serde(rename = "amount")] + pub amount: String, + /// Start date of the available budget. + #[serde(rename = "start")] + pub start: String, + /// End date of the available budget. + #[serde(rename = "end")] + pub end: String, + #[serde(rename = "spent_in_budgets", skip_serializing_if = "Option::is_none")] + pub spent_in_budgets: Option>, + #[serde(rename = "spent_outside_budget", skip_serializing_if = "Option::is_none")] + pub spent_outside_budget: Option>, +} + +impl AvailableBudget { + pub fn new(amount: String, start: String, end: String) -> AvailableBudget { + AvailableBudget { + created_at: None, + updated_at: None, + currency_id: None, + currency_code: None, + currency_symbol: None, + currency_decimal_places: None, + amount, + start, + end, + spent_in_budgets: None, + spent_outside_budget: None, + } + } +} + diff --git a/firefly-iii-api/src/models/available_budget_array.rs b/firefly-iii-api/src/models/available_budget_array.rs new file mode 100644 index 0000000..fed030c --- /dev/null +++ b/firefly-iii-api/src/models/available_budget_array.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AvailableBudgetArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, +} + +impl AvailableBudgetArray { + pub fn new(data: Vec, meta: models::Meta) -> AvailableBudgetArray { + AvailableBudgetArray { + data, + meta: Box::new(meta), + } + } +} + diff --git a/firefly-iii-api/src/models/available_budget_read.rs b/firefly-iii-api/src/models/available_budget_read.rs new file mode 100644 index 0000000..f02d082 --- /dev/null +++ b/firefly-iii-api/src/models/available_budget_read.rs @@ -0,0 +1,34 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AvailableBudgetRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, +} + +impl AvailableBudgetRead { + pub fn new(r#type: String, id: String, attributes: models::AvailableBudget) -> AvailableBudgetRead { + AvailableBudgetRead { + r#type, + id, + attributes: Box::new(attributes), + } + } +} + diff --git a/firefly-iii-api/src/models/available_budget_single.rs b/firefly-iii-api/src/models/available_budget_single.rs new file mode 100644 index 0000000..35e9810 --- /dev/null +++ b/firefly-iii-api/src/models/available_budget_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AvailableBudgetSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl AvailableBudgetSingle { + pub fn new(data: models::AvailableBudgetRead) -> AvailableBudgetSingle { + AvailableBudgetSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/bad_request_response.rs b/firefly-iii-api/src/models/bad_request_response.rs new file mode 100644 index 0000000..eeaabad --- /dev/null +++ b/firefly-iii-api/src/models/bad_request_response.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BadRequestResponse { + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(rename = "exception", skip_serializing_if = "Option::is_none")] + pub exception: Option, +} + +impl BadRequestResponse { + pub fn new() -> BadRequestResponse { + BadRequestResponse { + message: None, + exception: None, + } + } +} + diff --git a/firefly-iii-api/src/models/basic_summary_entry.rs b/firefly-iii-api/src/models/basic_summary_entry.rs new file mode 100644 index 0000000..8428cc9 --- /dev/null +++ b/firefly-iii-api/src/models/basic_summary_entry.rs @@ -0,0 +1,62 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BasicSummaryEntry { + /// This is a reference to the type of info shared, not influenced by translations or user preferences. The EUR value is a reference to the currency code. Possibilities are: balance-in-ABC, spent-in-ABC, earned-in-ABC, bills-paid-in-ABC, bills-unpaid-in-ABC, left-to-spend-in-ABC and net-worth-in-ABC. + #[serde(rename = "key", skip_serializing_if = "Option::is_none")] + pub key: Option, + /// A translated title for the information shared. + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + /// The amount as a float. + #[serde(rename = "monetary_value", skip_serializing_if = "Option::is_none")] + pub monetary_value: Option, + /// The currency ID of the associated currency. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + /// Number of decimals for the associated currency. + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, + /// The amount formatted according to the users locale + #[serde(rename = "value_parsed", skip_serializing_if = "Option::is_none")] + pub value_parsed: Option, + /// Reference to a font-awesome icon without the fa- part. + #[serde(rename = "local_icon", skip_serializing_if = "Option::is_none")] + pub local_icon: Option, + /// A short explanation of the amounts origin. Already formatted according to the locale of the user or translated, if relevant. + #[serde(rename = "sub_title", skip_serializing_if = "Option::is_none")] + pub sub_title: Option, +} + +impl BasicSummaryEntry { + pub fn new() -> BasicSummaryEntry { + BasicSummaryEntry { + key: None, + title: None, + monetary_value: None, + currency_id: None, + currency_code: None, + currency_symbol: None, + currency_decimal_places: None, + value_parsed: None, + local_icon: None, + sub_title: None, + } + } +} + diff --git a/firefly-iii-api/src/models/bill.rs b/firefly-iii-api/src/models/bill.rs new file mode 100644 index 0000000..e736081 --- /dev/null +++ b/firefly-iii-api/src/models/bill.rs @@ -0,0 +1,110 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Bill { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// Use either currency_id or currency_code + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// Use either currency_id or currency_code + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "amount_min")] + pub amount_min: String, + #[serde(rename = "amount_max")] + pub amount_max: String, + #[serde(rename = "date")] + pub date: String, + /// The date after which this bill is no longer valid or applicable + #[serde(rename = "end_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub end_date: Option>, + /// The date before which the bill must be renewed (or cancelled) + #[serde(rename = "extension_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub extension_date: Option>, + #[serde(rename = "repeat_freq")] + pub repeat_freq: models::BillRepeatFrequency, + /// How often the bill must be skipped. 1 means a bi-monthly bill. + #[serde(rename = "skip", skip_serializing_if = "Option::is_none")] + pub skip: Option, + /// If the bill is active. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Order of the bill. + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + /// When the bill is expected to be due. + #[serde(rename = "next_expected_match", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub next_expected_match: Option>, + /// Formatted (locally) when the bill is due. + #[serde(rename = "next_expected_match_diff", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub next_expected_match_diff: Option>, + /// The group ID of the group this object is part of. NULL if no group. + #[serde(rename = "object_group_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_id: Option>, + /// The order of the group. At least 1, for the highest sorting. + #[serde(rename = "object_group_order", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_order: Option>, + /// The name of the group. NULL if no group. + #[serde(rename = "object_group_title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_title: Option>, + /// Array of future dates when the bill is expected to be paid. Autogenerated. + #[serde(rename = "pay_dates", skip_serializing_if = "Option::is_none")] + pub pay_dates: Option>, + /// Array of past transactions when the bill was paid. + #[serde(rename = "paid_dates", skip_serializing_if = "Option::is_none")] + pub paid_dates: Option>, +} + +impl Bill { + pub fn new(name: String, amount_min: String, amount_max: String, date: String, repeat_freq: models::BillRepeatFrequency) -> Bill { + Bill { + created_at: None, + updated_at: None, + currency_id: None, + currency_code: None, + currency_symbol: None, + currency_decimal_places: None, + name, + amount_min, + amount_max, + date, + end_date: None, + extension_date: None, + repeat_freq, + skip: None, + active: None, + order: None, + notes: None, + next_expected_match: None, + next_expected_match_diff: None, + object_group_id: None, + object_group_order: None, + object_group_title: None, + pay_dates: None, + paid_dates: None, + } + } +} + diff --git a/firefly-iii-api/src/models/bill_array.rs b/firefly-iii-api/src/models/bill_array.rs new file mode 100644 index 0000000..319d264 --- /dev/null +++ b/firefly-iii-api/src/models/bill_array.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BillArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, +} + +impl BillArray { + pub fn new(data: Vec, meta: models::Meta) -> BillArray { + BillArray { + data, + meta: Box::new(meta), + } + } +} + diff --git a/firefly-iii-api/src/models/bill_paid_dates_inner.rs b/firefly-iii-api/src/models/bill_paid_dates_inner.rs new file mode 100644 index 0000000..d746ce5 --- /dev/null +++ b/firefly-iii-api/src/models/bill_paid_dates_inner.rs @@ -0,0 +1,36 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BillPaidDatesInner { + /// Transaction group ID of the paid bill. + #[serde(rename = "transaction_group_id", skip_serializing_if = "Option::is_none")] + pub transaction_group_id: Option, + /// Transaction journal ID of the paid bill. + #[serde(rename = "transaction_journal_id", skip_serializing_if = "Option::is_none")] + pub transaction_journal_id: Option, + /// Date the bill was paid. + #[serde(rename = "date", skip_serializing_if = "Option::is_none")] + pub date: Option, +} + +impl BillPaidDatesInner { + pub fn new() -> BillPaidDatesInner { + BillPaidDatesInner { + transaction_group_id: None, + transaction_journal_id: None, + date: None, + } + } +} + diff --git a/firefly-iii-api/src/models/bill_read.rs b/firefly-iii-api/src/models/bill_read.rs new file mode 100644 index 0000000..079147a --- /dev/null +++ b/firefly-iii-api/src/models/bill_read.rs @@ -0,0 +1,34 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BillRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, +} + +impl BillRead { + pub fn new(r#type: String, id: String, attributes: models::Bill) -> BillRead { + BillRead { + r#type, + id, + attributes: Box::new(attributes), + } + } +} + diff --git a/firefly-iii-api/src/models/bill_repeat_frequency.rs b/firefly-iii-api/src/models/bill_repeat_frequency.rs new file mode 100644 index 0000000..fb1f3fd --- /dev/null +++ b/firefly-iii-api/src/models/bill_repeat_frequency.rs @@ -0,0 +1,48 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// BillRepeatFrequency : How often the bill must be paid. +/// How often the bill must be paid. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum BillRepeatFrequency { + #[serde(rename = "weekly")] + Weekly, + #[serde(rename = "monthly")] + Monthly, + #[serde(rename = "quarterly")] + Quarterly, + #[serde(rename = "half-year")] + HalfYear, + #[serde(rename = "yearly")] + Yearly, + +} + +impl std::fmt::Display for BillRepeatFrequency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Weekly => write!(f, "weekly"), + Self::Monthly => write!(f, "monthly"), + Self::Quarterly => write!(f, "quarterly"), + Self::HalfYear => write!(f, "half-year"), + Self::Yearly => write!(f, "yearly"), + } + } +} + +impl Default for BillRepeatFrequency { + fn default() -> BillRepeatFrequency { + Self::Weekly + } +} + diff --git a/firefly-iii-api/src/models/bill_single.rs b/firefly-iii-api/src/models/bill_single.rs new file mode 100644 index 0000000..1225802 --- /dev/null +++ b/firefly-iii-api/src/models/bill_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BillSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl BillSingle { + pub fn new(data: models::BillRead) -> BillSingle { + BillSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/bill_store.rs b/firefly-iii-api/src/models/bill_store.rs new file mode 100644 index 0000000..2f9655d --- /dev/null +++ b/firefly-iii-api/src/models/bill_store.rs @@ -0,0 +1,74 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BillStore { + /// Use either currency_id or currency_code + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// Use either currency_id or currency_code + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "amount_min")] + pub amount_min: String, + #[serde(rename = "amount_max")] + pub amount_max: String, + #[serde(rename = "date")] + pub date: String, + /// The date after which this bill is no longer valid or applicable + #[serde(rename = "end_date", skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// The date before which the bill must be renewed (or cancelled) + #[serde(rename = "extension_date", skip_serializing_if = "Option::is_none")] + pub extension_date: Option, + #[serde(rename = "repeat_freq")] + pub repeat_freq: models::BillRepeatFrequency, + /// How often the bill must be skipped. 1 means a bi-monthly bill. + #[serde(rename = "skip", skip_serializing_if = "Option::is_none")] + pub skip: Option, + /// If the bill is active. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + /// The group ID of the group this object is part of. NULL if no group. + #[serde(rename = "object_group_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_id: Option>, + /// The name of the group. NULL if no group. + #[serde(rename = "object_group_title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_title: Option>, +} + +impl BillStore { + pub fn new(name: String, amount_min: String, amount_max: String, date: String, repeat_freq: models::BillRepeatFrequency) -> BillStore { + BillStore { + currency_id: None, + currency_code: None, + name, + amount_min, + amount_max, + date, + end_date: None, + extension_date: None, + repeat_freq, + skip: None, + active: None, + notes: None, + object_group_id: None, + object_group_title: None, + } + } +} + diff --git a/firefly-iii-api/src/models/bill_update.rs b/firefly-iii-api/src/models/bill_update.rs new file mode 100644 index 0000000..d63cf63 --- /dev/null +++ b/firefly-iii-api/src/models/bill_update.rs @@ -0,0 +1,74 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BillUpdate { + /// Use either currency_id or currency_code + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// Use either currency_id or currency_code + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "amount_min", skip_serializing_if = "Option::is_none")] + pub amount_min: Option, + #[serde(rename = "amount_max", skip_serializing_if = "Option::is_none")] + pub amount_max: Option, + #[serde(rename = "date", skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The date after which this bill is no longer valid or applicable + #[serde(rename = "end_date", skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// The date before which the bill must be renewed (or cancelled) + #[serde(rename = "extension_date", skip_serializing_if = "Option::is_none")] + pub extension_date: Option, + #[serde(rename = "repeat_freq", skip_serializing_if = "Option::is_none")] + pub repeat_freq: Option, + /// How often the bill must be skipped. 1 means a bi-monthly bill. + #[serde(rename = "skip", skip_serializing_if = "Option::is_none")] + pub skip: Option, + /// If the bill is active. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + /// The group ID of the group this object is part of. NULL if no group. + #[serde(rename = "object_group_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_id: Option>, + /// The name of the group. NULL if no group. + #[serde(rename = "object_group_title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_title: Option>, +} + +impl BillUpdate { + pub fn new(name: String) -> BillUpdate { + BillUpdate { + currency_id: None, + currency_code: None, + name, + amount_min: None, + amount_max: None, + date: None, + end_date: None, + extension_date: None, + repeat_freq: None, + skip: None, + active: None, + notes: None, + object_group_id: None, + object_group_title: None, + } + } +} + diff --git a/firefly-iii-api/src/models/budget.rs b/firefly-iii-api/src/models/budget.rs new file mode 100644 index 0000000..c5605f8 --- /dev/null +++ b/firefly-iii-api/src/models/budget.rs @@ -0,0 +1,63 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Budget { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "auto_budget_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub auto_budget_type: Option>, + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "auto_budget_currency_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub auto_budget_currency_id: Option>, + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "auto_budget_currency_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub auto_budget_currency_code: Option>, + #[serde(rename = "auto_budget_amount", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub auto_budget_amount: Option>, + #[serde(rename = "auto_budget_period", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub auto_budget_period: Option>, + /// Information on how much was spent in this budget. Is only filled in when the start and end date are submitted. + #[serde(rename = "spent", skip_serializing_if = "Option::is_none")] + pub spent: Option>, +} + +impl Budget { + pub fn new(name: String) -> Budget { + Budget { + created_at: None, + updated_at: None, + name, + active: None, + notes: None, + order: None, + auto_budget_type: None, + auto_budget_currency_id: None, + auto_budget_currency_code: None, + auto_budget_amount: None, + auto_budget_period: None, + spent: None, + } + } +} + diff --git a/firefly-iii-api/src/models/budget_array.rs b/firefly-iii-api/src/models/budget_array.rs new file mode 100644 index 0000000..a27b820 --- /dev/null +++ b/firefly-iii-api/src/models/budget_array.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BudgetArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, +} + +impl BudgetArray { + pub fn new(data: Vec, meta: models::Meta) -> BudgetArray { + BudgetArray { + data, + meta: Box::new(meta), + } + } +} + diff --git a/firefly-iii-api/src/models/budget_limit.rs b/firefly-iii-api/src/models/budget_limit.rs new file mode 100644 index 0000000..4057bca --- /dev/null +++ b/firefly-iii-api/src/models/budget_limit.rs @@ -0,0 +1,69 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BudgetLimit { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// Start date of the budget limit. + #[serde(rename = "start")] + pub start: String, + /// End date of the budget limit. + #[serde(rename = "end")] + pub end: String, + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "currency_name", skip_serializing_if = "Option::is_none")] + pub currency_name: Option, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, + /// The budget ID of the associated budget. + #[serde(rename = "budget_id")] + pub budget_id: String, + /// Period of the budget limit. Only used when auto-generated by auto-budget. + #[serde(rename = "period", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub period: Option>, + #[serde(rename = "amount")] + pub amount: String, + #[serde(rename = "spent", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub spent: Option>, +} + +impl BudgetLimit { + pub fn new(start: String, end: String, budget_id: String, amount: String) -> BudgetLimit { + BudgetLimit { + created_at: None, + updated_at: None, + start, + end, + currency_id: None, + currency_code: None, + currency_name: None, + currency_symbol: None, + currency_decimal_places: None, + budget_id, + period: None, + amount, + spent: None, + } + } +} + diff --git a/firefly-iii-api/src/models/budget_limit_array.rs b/firefly-iii-api/src/models/budget_limit_array.rs new file mode 100644 index 0000000..b1081ad --- /dev/null +++ b/firefly-iii-api/src/models/budget_limit_array.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BudgetLimitArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, +} + +impl BudgetLimitArray { + pub fn new(data: Vec, meta: models::Meta) -> BudgetLimitArray { + BudgetLimitArray { + data, + meta: Box::new(meta), + } + } +} + diff --git a/firefly-iii-api/src/models/budget_limit_read.rs b/firefly-iii-api/src/models/budget_limit_read.rs new file mode 100644 index 0000000..9a246f9 --- /dev/null +++ b/firefly-iii-api/src/models/budget_limit_read.rs @@ -0,0 +1,34 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BudgetLimitRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, +} + +impl BudgetLimitRead { + pub fn new(r#type: String, id: String, attributes: models::BudgetLimit) -> BudgetLimitRead { + BudgetLimitRead { + r#type, + id, + attributes: Box::new(attributes), + } + } +} + diff --git a/firefly-iii-api/src/models/budget_limit_single.rs b/firefly-iii-api/src/models/budget_limit_single.rs new file mode 100644 index 0000000..f4cb2f9 --- /dev/null +++ b/firefly-iii-api/src/models/budget_limit_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BudgetLimitSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl BudgetLimitSingle { + pub fn new(data: models::BudgetLimitRead) -> BudgetLimitSingle { + BudgetLimitSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/budget_limit_store.rs b/firefly-iii-api/src/models/budget_limit_store.rs new file mode 100644 index 0000000..c954b1d --- /dev/null +++ b/firefly-iii-api/src/models/budget_limit_store.rs @@ -0,0 +1,51 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BudgetLimitStore { + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + /// The budget ID of the associated budget. + #[serde(rename = "budget_id")] + pub budget_id: String, + /// Start date of the budget limit. + #[serde(rename = "start")] + pub start: String, + /// Period of the budget limit. Only used when auto-generated by auto-budget. + #[serde(rename = "period", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub period: Option>, + /// End date of the budget limit. + #[serde(rename = "end")] + pub end: String, + #[serde(rename = "amount")] + pub amount: String, +} + +impl BudgetLimitStore { + pub fn new(budget_id: String, start: String, end: String, amount: String) -> BudgetLimitStore { + BudgetLimitStore { + currency_id: None, + currency_code: None, + budget_id, + start, + period: None, + end, + amount, + } + } +} + diff --git a/firefly-iii-api/src/models/budget_read.rs b/firefly-iii-api/src/models/budget_read.rs new file mode 100644 index 0000000..027a959 --- /dev/null +++ b/firefly-iii-api/src/models/budget_read.rs @@ -0,0 +1,34 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BudgetRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, +} + +impl BudgetRead { + pub fn new(r#type: String, id: String, attributes: models::Budget) -> BudgetRead { + BudgetRead { + r#type, + id, + attributes: Box::new(attributes), + } + } +} + diff --git a/firefly-iii-api/src/models/budget_single.rs b/firefly-iii-api/src/models/budget_single.rs new file mode 100644 index 0000000..e34f512 --- /dev/null +++ b/firefly-iii-api/src/models/budget_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BudgetSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl BudgetSingle { + pub fn new(data: models::BudgetRead) -> BudgetSingle { + BudgetSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/budget_spent.rs b/firefly-iii-api/src/models/budget_spent.rs new file mode 100644 index 0000000..56a8c11 --- /dev/null +++ b/firefly-iii-api/src/models/budget_spent.rs @@ -0,0 +1,41 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BudgetSpent { + /// The amount spent. + #[serde(rename = "sum", skip_serializing_if = "Option::is_none")] + pub sum: Option, + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + /// Number of decimals supported by the currency + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, +} + +impl BudgetSpent { + pub fn new() -> BudgetSpent { + BudgetSpent { + sum: None, + currency_id: None, + currency_code: None, + currency_symbol: None, + currency_decimal_places: None, + } + } +} + diff --git a/firefly-iii-api/src/models/budget_store.rs b/firefly-iii-api/src/models/budget_store.rs new file mode 100644 index 0000000..f0be704 --- /dev/null +++ b/firefly-iii-api/src/models/budget_store.rs @@ -0,0 +1,53 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BudgetStore { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + #[serde(rename = "auto_budget_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub auto_budget_type: Option>, + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "auto_budget_currency_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub auto_budget_currency_id: Option>, + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "auto_budget_currency_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub auto_budget_currency_code: Option>, + #[serde(rename = "auto_budget_amount", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub auto_budget_amount: Option>, + #[serde(rename = "auto_budget_period", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub auto_budget_period: Option>, +} + +impl BudgetStore { + pub fn new(name: String) -> BudgetStore { + BudgetStore { + name, + active: None, + order: None, + notes: None, + auto_budget_type: None, + auto_budget_currency_id: None, + auto_budget_currency_code: None, + auto_budget_amount: None, + auto_budget_period: None, + } + } +} + diff --git a/firefly-iii-api/src/models/budget_update.rs b/firefly-iii-api/src/models/budget_update.rs new file mode 100644 index 0000000..a1406a5 --- /dev/null +++ b/firefly-iii-api/src/models/budget_update.rs @@ -0,0 +1,53 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BudgetUpdate { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + #[serde(rename = "auto_budget_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub auto_budget_type: Option>, + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "auto_budget_currency_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub auto_budget_currency_id: Option>, + /// Use either currency_id or currency_code. Defaults to the user's default currency. + #[serde(rename = "auto_budget_currency_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub auto_budget_currency_code: Option>, + #[serde(rename = "auto_budget_amount", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub auto_budget_amount: Option>, + #[serde(rename = "auto_budget_period", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub auto_budget_period: Option>, +} + +impl BudgetUpdate { + pub fn new(name: String) -> BudgetUpdate { + BudgetUpdate { + name, + active: None, + order: None, + notes: None, + auto_budget_type: None, + auto_budget_currency_id: None, + auto_budget_currency_code: None, + auto_budget_amount: None, + auto_budget_period: None, + } + } +} + diff --git a/firefly-iii-api/src/models/category.rs b/firefly-iii-api/src/models/category.rs new file mode 100644 index 0000000..de57390 --- /dev/null +++ b/firefly-iii-api/src/models/category.rs @@ -0,0 +1,42 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Category { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + #[serde(rename = "spent", skip_serializing_if = "Option::is_none")] + pub spent: Option>, + #[serde(rename = "earned", skip_serializing_if = "Option::is_none")] + pub earned: Option>, +} + +impl Category { + pub fn new(name: String) -> Category { + Category { + created_at: None, + updated_at: None, + name, + notes: None, + spent: None, + earned: None, + } + } +} + diff --git a/firefly-iii-api/src/models/category_array.rs b/firefly-iii-api/src/models/category_array.rs new file mode 100644 index 0000000..a2a7c20 --- /dev/null +++ b/firefly-iii-api/src/models/category_array.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CategoryArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, +} + +impl CategoryArray { + pub fn new(data: Vec, meta: models::Meta) -> CategoryArray { + CategoryArray { + data, + meta: Box::new(meta), + } + } +} + diff --git a/firefly-iii-api/src/models/category_earned.rs b/firefly-iii-api/src/models/category_earned.rs new file mode 100644 index 0000000..fab71f0 --- /dev/null +++ b/firefly-iii-api/src/models/category_earned.rs @@ -0,0 +1,41 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CategoryEarned { + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + /// Number of decimals supported by the currency + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, + /// The amount earned. + #[serde(rename = "sum", skip_serializing_if = "Option::is_none")] + pub sum: Option, +} + +impl CategoryEarned { + pub fn new() -> CategoryEarned { + CategoryEarned { + currency_id: None, + currency_code: None, + currency_symbol: None, + currency_decimal_places: None, + sum: None, + } + } +} + diff --git a/firefly-iii-api/src/models/category_read.rs b/firefly-iii-api/src/models/category_read.rs new file mode 100644 index 0000000..c9d3396 --- /dev/null +++ b/firefly-iii-api/src/models/category_read.rs @@ -0,0 +1,34 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CategoryRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, +} + +impl CategoryRead { + pub fn new(r#type: String, id: String, attributes: models::Category) -> CategoryRead { + CategoryRead { + r#type, + id, + attributes: Box::new(attributes), + } + } +} + diff --git a/firefly-iii-api/src/models/category_single.rs b/firefly-iii-api/src/models/category_single.rs new file mode 100644 index 0000000..701c95e --- /dev/null +++ b/firefly-iii-api/src/models/category_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CategorySingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl CategorySingle { + pub fn new(data: models::CategoryRead) -> CategorySingle { + CategorySingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/category_spent.rs b/firefly-iii-api/src/models/category_spent.rs new file mode 100644 index 0000000..b45f1ef --- /dev/null +++ b/firefly-iii-api/src/models/category_spent.rs @@ -0,0 +1,41 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CategorySpent { + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + /// Number of decimals supported by the currency + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, + /// The amount spent. + #[serde(rename = "sum", skip_serializing_if = "Option::is_none")] + pub sum: Option, +} + +impl CategorySpent { + pub fn new() -> CategorySpent { + CategorySpent { + currency_id: None, + currency_code: None, + currency_symbol: None, + currency_decimal_places: None, + sum: None, + } + } +} + diff --git a/firefly-iii-api/src/models/category_update.rs b/firefly-iii-api/src/models/category_update.rs new file mode 100644 index 0000000..6715d04 --- /dev/null +++ b/firefly-iii-api/src/models/category_update.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CategoryUpdate { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, +} + +impl CategoryUpdate { + pub fn new(name: String) -> CategoryUpdate { + CategoryUpdate { + name, + notes: None, + } + } +} + diff --git a/firefly-iii-api/src/models/chart_data_point.rs b/firefly-iii-api/src/models/chart_data_point.rs new file mode 100644 index 0000000..9bec5b8 --- /dev/null +++ b/firefly-iii-api/src/models/chart_data_point.rs @@ -0,0 +1,28 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ChartDataPoint { + /// The key is the label of the value, so for example: '2018-01-01' => 13 or 'Groceries' => -123. + #[serde(rename = "key", skip_serializing_if = "Option::is_none")] + pub key: Option, +} + +impl ChartDataPoint { + pub fn new() -> ChartDataPoint { + ChartDataPoint { + key: None, + } + } +} + diff --git a/firefly-iii-api/src/models/chart_data_set.rs b/firefly-iii-api/src/models/chart_data_set.rs new file mode 100644 index 0000000..39cbb2d --- /dev/null +++ b/firefly-iii-api/src/models/chart_data_set.rs @@ -0,0 +1,60 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ChartDataSet { + /// This is the title of the current set. It can refer to an account, a budget or another object (by name). + #[serde(rename = "label", skip_serializing_if = "Option::is_none")] + pub label: Option, + /// The currency ID of the currency associated to the data in the entries. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + /// Number of decimals for the currency associated to the data in the entries. + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, + #[serde(rename = "start_date", skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[serde(rename = "end_date", skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// Indicated the type of chart that is expected to be rendered. You can safely ignore this if you want. + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + /// Used to indicate the Y axis for this data set. Is usually between 0 and 1 (left and right side of the chart). + #[serde(rename = "yAxisID", skip_serializing_if = "Option::is_none")] + pub y_axis_id: Option, + /// The actual entries for this data set. They 'key' value is the label for the data point. The value is the actual (numerical) value. + #[serde(rename = "entries", skip_serializing_if = "Option::is_none")] + pub entries: Option>, +} + +impl ChartDataSet { + pub fn new() -> ChartDataSet { + ChartDataSet { + label: None, + currency_id: None, + currency_code: None, + currency_symbol: None, + currency_decimal_places: None, + start_date: None, + end_date: None, + r#type: None, + y_axis_id: None, + entries: None, + } + } +} + diff --git a/firefly-iii-api/src/models/config_value_filter.rs b/firefly-iii-api/src/models/config_value_filter.rs new file mode 100644 index 0000000..f8de66b --- /dev/null +++ b/firefly-iii-api/src/models/config_value_filter.rs @@ -0,0 +1,90 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// ConfigValueFilter : Title of the configuration value. +/// Title of the configuration value. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ConfigValueFilter { + #[serde(rename = "configuration.is_demo_site")] + ConfigurationPeriodIsDemoSite, + #[serde(rename = "configuration.permission_update_check")] + ConfigurationPeriodPermissionUpdateCheck, + #[serde(rename = "configuration.last_update_check")] + ConfigurationPeriodLastUpdateCheck, + #[serde(rename = "configuration.single_user_mode")] + ConfigurationPeriodSingleUserMode, + #[serde(rename = "firefly.version")] + FireflyPeriodVersion, + #[serde(rename = "firefly.api_version")] + FireflyPeriodApiVersion, + #[serde(rename = "firefly.default_location")] + FireflyPeriodDefaultLocation, + #[serde(rename = "firefly.account_to_transaction")] + FireflyPeriodAccountToTransaction, + #[serde(rename = "firefly.allowed_opposing_types")] + FireflyPeriodAllowedOpposingTypes, + #[serde(rename = "firefly.accountRoles")] + FireflyPeriodAccountRoles, + #[serde(rename = "firefly.valid_liabilities")] + FireflyPeriodValidLiabilities, + #[serde(rename = "firefly.interest_periods")] + FireflyPeriodInterestPeriods, + #[serde(rename = "firefly.enable_external_map")] + FireflyPeriodEnableExternalMap, + #[serde(rename = "firefly.expected_source_types")] + FireflyPeriodExpectedSourceTypes, + #[serde(rename = "app.timezone")] + AppPeriodTimezone, + #[serde(rename = "firefly.bill_periods")] + FireflyPeriodBillPeriods, + #[serde(rename = "firefly.credit_card_types")] + FireflyPeriodCreditCardTypes, + #[serde(rename = "firefly.languages")] + FireflyPeriodLanguages, + #[serde(rename = "firefly.valid_view_ranges")] + FireflyPeriodValidViewRanges, + +} + +impl std::fmt::Display for ConfigValueFilter { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::ConfigurationPeriodIsDemoSite => write!(f, "configuration.is_demo_site"), + Self::ConfigurationPeriodPermissionUpdateCheck => write!(f, "configuration.permission_update_check"), + Self::ConfigurationPeriodLastUpdateCheck => write!(f, "configuration.last_update_check"), + Self::ConfigurationPeriodSingleUserMode => write!(f, "configuration.single_user_mode"), + Self::FireflyPeriodVersion => write!(f, "firefly.version"), + Self::FireflyPeriodApiVersion => write!(f, "firefly.api_version"), + Self::FireflyPeriodDefaultLocation => write!(f, "firefly.default_location"), + Self::FireflyPeriodAccountToTransaction => write!(f, "firefly.account_to_transaction"), + Self::FireflyPeriodAllowedOpposingTypes => write!(f, "firefly.allowed_opposing_types"), + Self::FireflyPeriodAccountRoles => write!(f, "firefly.accountRoles"), + Self::FireflyPeriodValidLiabilities => write!(f, "firefly.valid_liabilities"), + Self::FireflyPeriodInterestPeriods => write!(f, "firefly.interest_periods"), + Self::FireflyPeriodEnableExternalMap => write!(f, "firefly.enable_external_map"), + Self::FireflyPeriodExpectedSourceTypes => write!(f, "firefly.expected_source_types"), + Self::AppPeriodTimezone => write!(f, "app.timezone"), + Self::FireflyPeriodBillPeriods => write!(f, "firefly.bill_periods"), + Self::FireflyPeriodCreditCardTypes => write!(f, "firefly.credit_card_types"), + Self::FireflyPeriodLanguages => write!(f, "firefly.languages"), + Self::FireflyPeriodValidViewRanges => write!(f, "firefly.valid_view_ranges"), + } + } +} + +impl Default for ConfigValueFilter { + fn default() -> ConfigValueFilter { + Self::ConfigurationPeriodIsDemoSite + } +} + diff --git a/firefly-iii-api/src/models/config_value_update_filter.rs b/firefly-iii-api/src/models/config_value_update_filter.rs new file mode 100644 index 0000000..0d45f27 --- /dev/null +++ b/firefly-iii-api/src/models/config_value_update_filter.rs @@ -0,0 +1,44 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ConfigValueUpdateFilter { + #[serde(rename = "configuration.is_demo_site")] + IsDemoSite, + #[serde(rename = "configuration.permission_update_check")] + PermissionUpdateCheck, + #[serde(rename = "configuration.last_update_check")] + LastUpdateCheck, + #[serde(rename = "configuration.single_user_mode")] + SingleUserMode, + +} + +impl std::fmt::Display for ConfigValueUpdateFilter { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::IsDemoSite => write!(f, "configuration.is_demo_site"), + Self::PermissionUpdateCheck => write!(f, "configuration.permission_update_check"), + Self::LastUpdateCheck => write!(f, "configuration.last_update_check"), + Self::SingleUserMode => write!(f, "configuration.single_user_mode"), + } + } +} + +impl Default for ConfigValueUpdateFilter { + fn default() -> ConfigValueUpdateFilter { + Self::IsDemoSite + } +} + diff --git a/firefly-iii-api/src/models/configuration.rs b/firefly-iii-api/src/models/configuration.rs new file mode 100644 index 0000000..ffb6f3f --- /dev/null +++ b/firefly-iii-api/src/models/configuration.rs @@ -0,0 +1,34 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Configuration { + #[serde(rename = "title")] + pub title: models::ConfigValueFilter, + #[serde(rename = "value")] + pub value: Box, + /// If this config variable can be edited by the user + #[serde(rename = "editable")] + pub editable: bool, +} + +impl Configuration { + pub fn new(title: models::ConfigValueFilter, value: models::PolymorphicProperty, editable: bool) -> Configuration { + Configuration { + title, + value: Box::new(value), + editable, + } + } +} + diff --git a/firefly-iii-api/src/models/configuration_single.rs b/firefly-iii-api/src/models/configuration_single.rs new file mode 100644 index 0000000..67e6958 --- /dev/null +++ b/firefly-iii-api/src/models/configuration_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConfigurationSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl ConfigurationSingle { + pub fn new(data: models::Configuration) -> ConfigurationSingle { + ConfigurationSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/configuration_update.rs b/firefly-iii-api/src/models/configuration_update.rs new file mode 100644 index 0000000..f338d7e --- /dev/null +++ b/firefly-iii-api/src/models/configuration_update.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConfigurationUpdate { + #[serde(rename = "value")] + pub value: Box, +} + +impl ConfigurationUpdate { + pub fn new(value: models::PolymorphicProperty) -> ConfigurationUpdate { + ConfigurationUpdate { + value: Box::new(value), + } + } +} + diff --git a/firefly-iii-api/src/models/credit_card_type_property.rs b/firefly-iii-api/src/models/credit_card_type_property.rs new file mode 100644 index 0000000..10b3c5b --- /dev/null +++ b/firefly-iii-api/src/models/credit_card_type_property.rs @@ -0,0 +1,39 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// CreditCardTypeProperty : Mandatory when the account_role is ccAsset. Can only be monthlyFull or null. +/// Mandatory when the account_role is ccAsset. Can only be monthlyFull or null. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum CreditCardTypeProperty { + #[serde(rename = "monthlyFull")] + MonthlyFull, + #[serde(rename = "null")] + Null, + +} + +impl std::fmt::Display for CreditCardTypeProperty { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::MonthlyFull => write!(f, "monthlyFull"), + Self::Null => write!(f, "null"), + } + } +} + +impl Default for CreditCardTypeProperty { + fn default() -> CreditCardTypeProperty { + Self::MonthlyFull + } +} + diff --git a/firefly-iii-api/src/models/cron_result.rs b/firefly-iii-api/src/models/cron_result.rs new file mode 100644 index 0000000..69a04d1 --- /dev/null +++ b/firefly-iii-api/src/models/cron_result.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CronResult { + #[serde(rename = "recurring_transactions", skip_serializing_if = "Option::is_none")] + pub recurring_transactions: Option>, + #[serde(rename = "auto_budgets", skip_serializing_if = "Option::is_none")] + pub auto_budgets: Option>, + #[serde(rename = "telemetry", skip_serializing_if = "Option::is_none")] + pub telemetry: Option>, +} + +impl CronResult { + pub fn new() -> CronResult { + CronResult { + recurring_transactions: None, + auto_budgets: None, + telemetry: None, + } + } +} + diff --git a/firefly-iii-api/src/models/cron_result_row.rs b/firefly-iii-api/src/models/cron_result_row.rs new file mode 100644 index 0000000..fe703bc --- /dev/null +++ b/firefly-iii-api/src/models/cron_result_row.rs @@ -0,0 +1,40 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CronResultRow { + /// This value tells you if this specific cron job actually fired. It may not fire. Some cron jobs only fire every 24 hours, for example. + #[serde(rename = "job_fired", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub job_fired: Option>, + /// This value tells you if this specific cron job actually did something. The job may fire but not change anything. + #[serde(rename = "job_succeeded", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub job_succeeded: Option>, + /// If the cron job ran into some kind of an error, this value will be true. + #[serde(rename = "job_errored", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub job_errored: Option>, + /// If the cron job ran into some kind of an error, this value will be the error message. The success message if the job actually ran OK. + #[serde(rename = "message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub message: Option>, +} + +impl CronResultRow { + pub fn new() -> CronResultRow { + CronResultRow { + job_fired: None, + job_succeeded: None, + job_errored: None, + message: None, + } + } +} + diff --git a/firefly-iii-api/src/models/currency.rs b/firefly-iii-api/src/models/currency.rs new file mode 100644 index 0000000..aef8d48 --- /dev/null +++ b/firefly-iii-api/src/models/currency.rs @@ -0,0 +1,51 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Currency { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// Defaults to true + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// Make this currency the default currency. + #[serde(rename = "default", skip_serializing_if = "Option::is_none")] + pub default: Option, + #[serde(rename = "code")] + pub code: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "symbol")] + pub symbol: String, + /// Supports 0-16 decimals. + #[serde(rename = "decimal_places", skip_serializing_if = "Option::is_none")] + pub decimal_places: Option, +} + +impl Currency { + pub fn new(code: String, name: String, symbol: String) -> Currency { + Currency { + created_at: None, + updated_at: None, + enabled: None, + default: None, + code, + name, + symbol, + decimal_places: None, + } + } +} + diff --git a/firefly-iii-api/src/models/currency_array.rs b/firefly-iii-api/src/models/currency_array.rs new file mode 100644 index 0000000..50c427d --- /dev/null +++ b/firefly-iii-api/src/models/currency_array.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CurrencyArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl CurrencyArray { + pub fn new(data: Vec, meta: models::Meta, links: models::PageLink) -> CurrencyArray { + CurrencyArray { + data, + meta: Box::new(meta), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/currency_read.rs b/firefly-iii-api/src/models/currency_read.rs new file mode 100644 index 0000000..c50e9df --- /dev/null +++ b/firefly-iii-api/src/models/currency_read.rs @@ -0,0 +1,34 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CurrencyRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, +} + +impl CurrencyRead { + pub fn new(r#type: String, id: String, attributes: models::Currency) -> CurrencyRead { + CurrencyRead { + r#type, + id, + attributes: Box::new(attributes), + } + } +} + diff --git a/firefly-iii-api/src/models/currency_single.rs b/firefly-iii-api/src/models/currency_single.rs new file mode 100644 index 0000000..5717de2 --- /dev/null +++ b/firefly-iii-api/src/models/currency_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CurrencySingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl CurrencySingle { + pub fn new(data: models::CurrencyRead) -> CurrencySingle { + CurrencySingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/currency_store.rs b/firefly-iii-api/src/models/currency_store.rs new file mode 100644 index 0000000..7cdd3ea --- /dev/null +++ b/firefly-iii-api/src/models/currency_store.rs @@ -0,0 +1,45 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CurrencyStore { + /// Defaults to true + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// Make this currency the default currency. You can set this value to FALSE, in which case nothing will change to the default currency. If you set it to TRUE, the current default currency will no longer be the default currency. + #[serde(rename = "default", skip_serializing_if = "Option::is_none")] + pub default: Option, + #[serde(rename = "code")] + pub code: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "symbol")] + pub symbol: String, + /// Supports 0-16 decimals. + #[serde(rename = "decimal_places", skip_serializing_if = "Option::is_none")] + pub decimal_places: Option, +} + +impl CurrencyStore { + pub fn new(code: String, name: String, symbol: String) -> CurrencyStore { + CurrencyStore { + enabled: None, + default: None, + code, + name, + symbol, + decimal_places: None, + } + } +} + diff --git a/firefly-iii-api/src/models/currency_update.rs b/firefly-iii-api/src/models/currency_update.rs new file mode 100644 index 0000000..7e0136c --- /dev/null +++ b/firefly-iii-api/src/models/currency_update.rs @@ -0,0 +1,48 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CurrencyUpdate { + /// If the currency is enabled + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// If the currency must be the default for the user. You can only submit TRUE. Submitting FALSE will not drop this currency as the default currency, because then the system would be without one. + #[serde(rename = "default", skip_serializing_if = "Option::is_none")] + pub default: Option, + /// The currency code + #[serde(rename = "code", skip_serializing_if = "Option::is_none")] + pub code: Option, + /// The currency name + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// The currency symbol + #[serde(rename = "symbol", skip_serializing_if = "Option::is_none")] + pub symbol: Option, + /// How many decimals to use when displaying this currency. Between 0 and 16. + #[serde(rename = "decimal_places", skip_serializing_if = "Option::is_none")] + pub decimal_places: Option, +} + +impl CurrencyUpdate { + pub fn new() -> CurrencyUpdate { + CurrencyUpdate { + enabled: None, + default: None, + code: None, + name: None, + symbol: None, + decimal_places: None, + } + } +} + diff --git a/firefly-iii-api/src/models/data_destroy_object.rs b/firefly-iii-api/src/models/data_destroy_object.rs new file mode 100644 index 0000000..803fbfa --- /dev/null +++ b/firefly-iii-api/src/models/data_destroy_object.rs @@ -0,0 +1,86 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum DataDestroyObject { + #[serde(rename = "not_assets_liabilities")] + NotAssetsLiabilities, + #[serde(rename = "budgets")] + Budgets, + #[serde(rename = "bills")] + Bills, + #[serde(rename = "piggy_banks")] + PiggyBanks, + #[serde(rename = "rules")] + Rules, + #[serde(rename = "recurring")] + Recurring, + #[serde(rename = "categories")] + Categories, + #[serde(rename = "tags")] + Tags, + #[serde(rename = "object_groups")] + ObjectGroups, + #[serde(rename = "accounts")] + Accounts, + #[serde(rename = "asset_accounts")] + AssetAccounts, + #[serde(rename = "expense_accounts")] + ExpenseAccounts, + #[serde(rename = "revenue_accounts")] + RevenueAccounts, + #[serde(rename = "liabilities")] + Liabilities, + #[serde(rename = "transactions")] + Transactions, + #[serde(rename = "withdrawals")] + Withdrawals, + #[serde(rename = "deposits")] + Deposits, + #[serde(rename = "transfers")] + Transfers, + +} + +impl std::fmt::Display for DataDestroyObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::NotAssetsLiabilities => write!(f, "not_assets_liabilities"), + Self::Budgets => write!(f, "budgets"), + Self::Bills => write!(f, "bills"), + Self::PiggyBanks => write!(f, "piggy_banks"), + Self::Rules => write!(f, "rules"), + Self::Recurring => write!(f, "recurring"), + Self::Categories => write!(f, "categories"), + Self::Tags => write!(f, "tags"), + Self::ObjectGroups => write!(f, "object_groups"), + Self::Accounts => write!(f, "accounts"), + Self::AssetAccounts => write!(f, "asset_accounts"), + Self::ExpenseAccounts => write!(f, "expense_accounts"), + Self::RevenueAccounts => write!(f, "revenue_accounts"), + Self::Liabilities => write!(f, "liabilities"), + Self::Transactions => write!(f, "transactions"), + Self::Withdrawals => write!(f, "withdrawals"), + Self::Deposits => write!(f, "deposits"), + Self::Transfers => write!(f, "transfers"), + } + } +} + +impl Default for DataDestroyObject { + fn default() -> DataDestroyObject { + Self::NotAssetsLiabilities + } +} + diff --git a/firefly-iii-api/src/models/export_file_filter.rs b/firefly-iii-api/src/models/export_file_filter.rs new file mode 100644 index 0000000..4c62696 --- /dev/null +++ b/firefly-iii-api/src/models/export_file_filter.rs @@ -0,0 +1,35 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ExportFileFilter { + #[serde(rename = "csv")] + Csv, + +} + +impl std::fmt::Display for ExportFileFilter { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Csv => write!(f, "csv"), + } + } +} + +impl Default for ExportFileFilter { + fn default() -> ExportFileFilter { + Self::Csv + } +} + diff --git a/firefly-iii-api/src/models/insight_group_entry.rs b/firefly-iii-api/src/models/insight_group_entry.rs new file mode 100644 index 0000000..a5819a7 --- /dev/null +++ b/firefly-iii-api/src/models/insight_group_entry.rs @@ -0,0 +1,48 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct InsightGroupEntry { + /// This ID is a reference to the original object. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// This is the name of the object. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// The amount spent or earned between start date and end date, a number defined as a string, for this object and all asset accounts. + #[serde(rename = "difference", skip_serializing_if = "Option::is_none")] + pub difference: Option, + /// The amount spent or earned between start date and end date, a number as a float, for this object and all asset accounts. May have rounding errors. + #[serde(rename = "difference_float", skip_serializing_if = "Option::is_none")] + pub difference_float: Option, + /// The currency ID of the expenses listed for this account. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// The currency code of the expenses listed for this account. + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, +} + +impl InsightGroupEntry { + pub fn new() -> InsightGroupEntry { + InsightGroupEntry { + id: None, + name: None, + difference: None, + difference_float: None, + currency_id: None, + currency_code: None, + } + } +} + diff --git a/firefly-iii-api/src/models/insight_total_entry.rs b/firefly-iii-api/src/models/insight_total_entry.rs new file mode 100644 index 0000000..dd81a72 --- /dev/null +++ b/firefly-iii-api/src/models/insight_total_entry.rs @@ -0,0 +1,40 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct InsightTotalEntry { + /// The amount spent between start date and end date, defined as a string, for this expense account and all asset accounts. + #[serde(rename = "difference", skip_serializing_if = "Option::is_none")] + pub difference: Option, + /// The amount spent between start date and end date, defined as a string, for this expense account and all asset accounts. This number is a float (double) and may have rounding errors. + #[serde(rename = "difference_float", skip_serializing_if = "Option::is_none")] + pub difference_float: Option, + /// The currency ID of the expenses listed for this expense account. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// The currency code of the expenses listed for this expense account. + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, +} + +impl InsightTotalEntry { + pub fn new() -> InsightTotalEntry { + InsightTotalEntry { + difference: None, + difference_float: None, + currency_id: None, + currency_code: None, + } + } +} + diff --git a/firefly-iii-api/src/models/insight_transfer_entry.rs b/firefly-iii-api/src/models/insight_transfer_entry.rs new file mode 100644 index 0000000..43097f9 --- /dev/null +++ b/firefly-iii-api/src/models/insight_transfer_entry.rs @@ -0,0 +1,64 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct InsightTransferEntry { + /// This ID is a reference to the original object. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// This is the name of the object. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// The total amount transferred between start date and end date, a number defined as a string, for this asset account. + #[serde(rename = "difference", skip_serializing_if = "Option::is_none")] + pub difference: Option, + /// The total amount transferred between start date and end date, a number as a float, for this asset account. May have rounding errors. + #[serde(rename = "difference_float", skip_serializing_if = "Option::is_none")] + pub difference_float: Option, + /// The total amount transferred TO this account between start date and end date, a number defined as a string, for this asset account. + #[serde(rename = "in", skip_serializing_if = "Option::is_none")] + pub r#in: Option, + /// The total amount transferred FROM this account between start date and end date, a number as a float, for this asset account. May have rounding errors. + #[serde(rename = "in_float", skip_serializing_if = "Option::is_none")] + pub in_float: Option, + /// The total amount transferred FROM this account between start date and end date, a number defined as a string, for this asset account. + #[serde(rename = "out", skip_serializing_if = "Option::is_none")] + pub out: Option, + /// The total amount transferred TO this account between start date and end date, a number as a float, for this asset account. May have rounding errors. + #[serde(rename = "out_float", skip_serializing_if = "Option::is_none")] + pub out_float: Option, + /// The currency ID of the expenses listed for this account. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// The currency code of the expenses listed for this account. + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, +} + +impl InsightTransferEntry { + pub fn new() -> InsightTransferEntry { + InsightTransferEntry { + id: None, + name: None, + difference: None, + difference_float: None, + r#in: None, + in_float: None, + out: None, + out_float: None, + currency_id: None, + currency_code: None, + } + } +} + diff --git a/firefly-iii-api/src/models/interest_period_property.rs b/firefly-iii-api/src/models/interest_period_property.rs new file mode 100644 index 0000000..ec6e6f8 --- /dev/null +++ b/firefly-iii-api/src/models/interest_period_property.rs @@ -0,0 +1,51 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// InterestPeriodProperty : Mandatory when type is liability. Period over which the interest is calculated. +/// Mandatory when type is liability. Period over which the interest is calculated. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum InterestPeriodProperty { + #[serde(rename = "weekly")] + Weekly, + #[serde(rename = "monthly")] + Monthly, + #[serde(rename = "quarterly")] + Quarterly, + #[serde(rename = "half-year")] + HalfYear, + #[serde(rename = "yearly")] + Yearly, + #[serde(rename = "null")] + Null, + +} + +impl std::fmt::Display for InterestPeriodProperty { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Weekly => write!(f, "weekly"), + Self::Monthly => write!(f, "monthly"), + Self::Quarterly => write!(f, "quarterly"), + Self::HalfYear => write!(f, "half-year"), + Self::Yearly => write!(f, "yearly"), + Self::Null => write!(f, "null"), + } + } +} + +impl Default for InterestPeriodProperty { + fn default() -> InterestPeriodProperty { + Self::Weekly + } +} + diff --git a/firefly-iii-api/src/models/internal_exception_response.rs b/firefly-iii-api/src/models/internal_exception_response.rs new file mode 100644 index 0000000..c276108 --- /dev/null +++ b/firefly-iii-api/src/models/internal_exception_response.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct InternalExceptionResponse { + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(rename = "exception", skip_serializing_if = "Option::is_none")] + pub exception: Option, +} + +impl InternalExceptionResponse { + pub fn new() -> InternalExceptionResponse { + InternalExceptionResponse { + message: None, + exception: None, + } + } +} + diff --git a/firefly-iii-api/src/models/liability_direction_property.rs b/firefly-iii-api/src/models/liability_direction_property.rs new file mode 100644 index 0000000..17ebce8 --- /dev/null +++ b/firefly-iii-api/src/models/liability_direction_property.rs @@ -0,0 +1,42 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// LiabilityDirectionProperty : 'credit' indicates somebody owes you the liability. 'debit' Indicates you owe this debt yourself. Works only for liabiltiies. +/// 'credit' indicates somebody owes you the liability. 'debit' Indicates you owe this debt yourself. Works only for liabiltiies. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum LiabilityDirectionProperty { + #[serde(rename = "credit")] + Credit, + #[serde(rename = "debit")] + Debit, + #[serde(rename = "null")] + Null, + +} + +impl std::fmt::Display for LiabilityDirectionProperty { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Credit => write!(f, "credit"), + Self::Debit => write!(f, "debit"), + Self::Null => write!(f, "null"), + } + } +} + +impl Default for LiabilityDirectionProperty { + fn default() -> LiabilityDirectionProperty { + Self::Credit + } +} + diff --git a/firefly-iii-api/src/models/liability_type_property.rs b/firefly-iii-api/src/models/liability_type_property.rs new file mode 100644 index 0000000..c9bfce2 --- /dev/null +++ b/firefly-iii-api/src/models/liability_type_property.rs @@ -0,0 +1,45 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// LiabilityTypeProperty : Mandatory when type is liability. Specifies the exact type. +/// Mandatory when type is liability. Specifies the exact type. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum LiabilityTypeProperty { + #[serde(rename = "loan")] + Loan, + #[serde(rename = "debt")] + Debt, + #[serde(rename = "mortgage")] + Mortgage, + #[serde(rename = "null")] + Null, + +} + +impl std::fmt::Display for LiabilityTypeProperty { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Loan => write!(f, "loan"), + Self::Debt => write!(f, "debt"), + Self::Mortgage => write!(f, "mortgage"), + Self::Null => write!(f, "null"), + } + } +} + +impl Default for LiabilityTypeProperty { + fn default() -> LiabilityTypeProperty { + Self::Loan + } +} + diff --git a/firefly-iii-api/src/models/link_type.rs b/firefly-iii-api/src/models/link_type.rs new file mode 100644 index 0000000..6612cfd --- /dev/null +++ b/firefly-iii-api/src/models/link_type.rs @@ -0,0 +1,36 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LinkType { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "inward")] + pub inward: String, + #[serde(rename = "outward")] + pub outward: String, + #[serde(rename = "editable", skip_serializing_if = "Option::is_none")] + pub editable: Option, +} + +impl LinkType { + pub fn new(name: String, inward: String, outward: String) -> LinkType { + LinkType { + name, + inward, + outward, + editable: None, + } + } +} + diff --git a/firefly-iii-api/src/models/link_type_array.rs b/firefly-iii-api/src/models/link_type_array.rs new file mode 100644 index 0000000..6ce94de --- /dev/null +++ b/firefly-iii-api/src/models/link_type_array.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LinkTypeArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl LinkTypeArray { + pub fn new(data: Vec, meta: models::Meta, links: models::PageLink) -> LinkTypeArray { + LinkTypeArray { + data, + meta: Box::new(meta), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/link_type_read.rs b/firefly-iii-api/src/models/link_type_read.rs new file mode 100644 index 0000000..85a0305 --- /dev/null +++ b/firefly-iii-api/src/models/link_type_read.rs @@ -0,0 +1,37 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LinkTypeRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl LinkTypeRead { + pub fn new(r#type: String, id: String, attributes: models::LinkType, links: models::ObjectLink) -> LinkTypeRead { + LinkTypeRead { + r#type, + id, + attributes: Box::new(attributes), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/link_type_single.rs b/firefly-iii-api/src/models/link_type_single.rs new file mode 100644 index 0000000..3f3ef71 --- /dev/null +++ b/firefly-iii-api/src/models/link_type_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LinkTypeSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl LinkTypeSingle { + pub fn new(data: models::LinkTypeRead) -> LinkTypeSingle { + LinkTypeSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/link_type_update.rs b/firefly-iii-api/src/models/link_type_update.rs new file mode 100644 index 0000000..417fbdb --- /dev/null +++ b/firefly-iii-api/src/models/link_type_update.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LinkTypeUpdate { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "inward", skip_serializing_if = "Option::is_none")] + pub inward: Option, + #[serde(rename = "outward", skip_serializing_if = "Option::is_none")] + pub outward: Option, +} + +impl LinkTypeUpdate { + pub fn new() -> LinkTypeUpdate { + LinkTypeUpdate { + name: None, + inward: None, + outward: None, + } + } +} + diff --git a/firefly-iii-api/src/models/meta.rs b/firefly-iii-api/src/models/meta.rs new file mode 100644 index 0000000..5ac0ed1 --- /dev/null +++ b/firefly-iii-api/src/models/meta.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Meta { + #[serde(rename = "pagination", skip_serializing_if = "Option::is_none")] + pub pagination: Option>, +} + +impl Meta { + pub fn new() -> Meta { + Meta { + pagination: None, + } + } +} + diff --git a/firefly-iii-api/src/models/meta_pagination.rs b/firefly-iii-api/src/models/meta_pagination.rs new file mode 100644 index 0000000..86ccc81 --- /dev/null +++ b/firefly-iii-api/src/models/meta_pagination.rs @@ -0,0 +1,39 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MetaPagination { + #[serde(rename = "total", skip_serializing_if = "Option::is_none")] + pub total: Option, + #[serde(rename = "count", skip_serializing_if = "Option::is_none")] + pub count: Option, + #[serde(rename = "per_page", skip_serializing_if = "Option::is_none")] + pub per_page: Option, + #[serde(rename = "current_page", skip_serializing_if = "Option::is_none")] + pub current_page: Option, + #[serde(rename = "total_pages", skip_serializing_if = "Option::is_none")] + pub total_pages: Option, +} + +impl MetaPagination { + pub fn new() -> MetaPagination { + MetaPagination { + total: None, + count: None, + per_page: None, + current_page: None, + total_pages: None, + } + } +} + diff --git a/firefly-iii-api/src/models/mod.rs b/firefly-iii-api/src/models/mod.rs new file mode 100644 index 0000000..44c0e7b --- /dev/null +++ b/firefly-iii-api/src/models/mod.rs @@ -0,0 +1,422 @@ +pub mod account; +pub use self::account::Account; +pub mod account_array; +pub use self::account_array::AccountArray; +pub mod account_read; +pub use self::account_read::AccountRead; +pub mod account_role_property; +pub use self::account_role_property::AccountRoleProperty; +pub mod account_search_field_filter; +pub use self::account_search_field_filter::AccountSearchFieldFilter; +pub mod account_single; +pub use self::account_single::AccountSingle; +pub mod account_store; +pub use self::account_store::AccountStore; +pub mod account_type_filter; +pub use self::account_type_filter::AccountTypeFilter; +pub mod account_type_property; +pub use self::account_type_property::AccountTypeProperty; +pub mod account_update; +pub use self::account_update::AccountUpdate; +pub mod attachable_type; +pub use self::attachable_type::AttachableType; +pub mod attachment; +pub use self::attachment::Attachment; +pub mod attachment_array; +pub use self::attachment_array::AttachmentArray; +pub mod attachment_read; +pub use self::attachment_read::AttachmentRead; +pub mod attachment_single; +pub use self::attachment_single::AttachmentSingle; +pub mod attachment_store; +pub use self::attachment_store::AttachmentStore; +pub mod attachment_update; +pub use self::attachment_update::AttachmentUpdate; +pub mod auto_budget_period; +pub use self::auto_budget_period::AutoBudgetPeriod; +pub mod auto_budget_type; +pub use self::auto_budget_type::AutoBudgetType; +pub mod autocomplete_account; +pub use self::autocomplete_account::AutocompleteAccount; +pub mod autocomplete_bill; +pub use self::autocomplete_bill::AutocompleteBill; +pub mod autocomplete_budget; +pub use self::autocomplete_budget::AutocompleteBudget; +pub mod autocomplete_category; +pub use self::autocomplete_category::AutocompleteCategory; +pub mod autocomplete_currency; +pub use self::autocomplete_currency::AutocompleteCurrency; +pub mod autocomplete_currency_code; +pub use self::autocomplete_currency_code::AutocompleteCurrencyCode; +pub mod autocomplete_object_group; +pub use self::autocomplete_object_group::AutocompleteObjectGroup; +pub mod autocomplete_piggy; +pub use self::autocomplete_piggy::AutocompletePiggy; +pub mod autocomplete_piggy_balance; +pub use self::autocomplete_piggy_balance::AutocompletePiggyBalance; +pub mod autocomplete_recurrence; +pub use self::autocomplete_recurrence::AutocompleteRecurrence; +pub mod autocomplete_rule; +pub use self::autocomplete_rule::AutocompleteRule; +pub mod autocomplete_rule_group; +pub use self::autocomplete_rule_group::AutocompleteRuleGroup; +pub mod autocomplete_tag; +pub use self::autocomplete_tag::AutocompleteTag; +pub mod autocomplete_transaction; +pub use self::autocomplete_transaction::AutocompleteTransaction; +pub mod autocomplete_transaction_id; +pub use self::autocomplete_transaction_id::AutocompleteTransactionId; +pub mod autocomplete_transaction_type; +pub use self::autocomplete_transaction_type::AutocompleteTransactionType; +pub mod available_budget; +pub use self::available_budget::AvailableBudget; +pub mod available_budget_array; +pub use self::available_budget_array::AvailableBudgetArray; +pub mod available_budget_read; +pub use self::available_budget_read::AvailableBudgetRead; +pub mod available_budget_single; +pub use self::available_budget_single::AvailableBudgetSingle; +pub mod bad_request_response; +pub use self::bad_request_response::BadRequestResponse; +pub mod basic_summary_entry; +pub use self::basic_summary_entry::BasicSummaryEntry; +pub mod bill; +pub use self::bill::Bill; +pub mod bill_array; +pub use self::bill_array::BillArray; +pub mod bill_paid_dates_inner; +pub use self::bill_paid_dates_inner::BillPaidDatesInner; +pub mod bill_read; +pub use self::bill_read::BillRead; +pub mod bill_repeat_frequency; +pub use self::bill_repeat_frequency::BillRepeatFrequency; +pub mod bill_single; +pub use self::bill_single::BillSingle; +pub mod bill_store; +pub use self::bill_store::BillStore; +pub mod bill_update; +pub use self::bill_update::BillUpdate; +pub mod budget; +pub use self::budget::Budget; +pub mod budget_array; +pub use self::budget_array::BudgetArray; +pub mod budget_limit; +pub use self::budget_limit::BudgetLimit; +pub mod budget_limit_array; +pub use self::budget_limit_array::BudgetLimitArray; +pub mod budget_limit_read; +pub use self::budget_limit_read::BudgetLimitRead; +pub mod budget_limit_single; +pub use self::budget_limit_single::BudgetLimitSingle; +pub mod budget_limit_store; +pub use self::budget_limit_store::BudgetLimitStore; +pub mod budget_read; +pub use self::budget_read::BudgetRead; +pub mod budget_single; +pub use self::budget_single::BudgetSingle; +pub mod budget_spent; +pub use self::budget_spent::BudgetSpent; +pub mod budget_store; +pub use self::budget_store::BudgetStore; +pub mod budget_update; +pub use self::budget_update::BudgetUpdate; +pub mod category; +pub use self::category::Category; +pub mod category_array; +pub use self::category_array::CategoryArray; +pub mod category_earned; +pub use self::category_earned::CategoryEarned; +pub mod category_read; +pub use self::category_read::CategoryRead; +pub mod category_single; +pub use self::category_single::CategorySingle; +pub mod category_spent; +pub use self::category_spent::CategorySpent; +pub mod category_update; +pub use self::category_update::CategoryUpdate; +pub mod chart_data_point; +pub use self::chart_data_point::ChartDataPoint; +pub mod chart_data_set; +pub use self::chart_data_set::ChartDataSet; +pub mod config_value_filter; +pub use self::config_value_filter::ConfigValueFilter; +pub mod config_value_update_filter; +pub use self::config_value_update_filter::ConfigValueUpdateFilter; +pub mod configuration; +pub use self::configuration::Configuration; +pub mod configuration_single; +pub use self::configuration_single::ConfigurationSingle; +pub mod configuration_update; +pub use self::configuration_update::ConfigurationUpdate; +pub mod credit_card_type_property; +pub use self::credit_card_type_property::CreditCardTypeProperty; +pub mod cron_result; +pub use self::cron_result::CronResult; +pub mod cron_result_row; +pub use self::cron_result_row::CronResultRow; +pub mod currency; +pub use self::currency::Currency; +pub mod currency_array; +pub use self::currency_array::CurrencyArray; +pub mod currency_read; +pub use self::currency_read::CurrencyRead; +pub mod currency_single; +pub use self::currency_single::CurrencySingle; +pub mod currency_store; +pub use self::currency_store::CurrencyStore; +pub mod currency_update; +pub use self::currency_update::CurrencyUpdate; +pub mod data_destroy_object; +pub use self::data_destroy_object::DataDestroyObject; +pub mod export_file_filter; +pub use self::export_file_filter::ExportFileFilter; +pub mod insight_group_entry; +pub use self::insight_group_entry::InsightGroupEntry; +pub mod insight_total_entry; +pub use self::insight_total_entry::InsightTotalEntry; +pub mod insight_transfer_entry; +pub use self::insight_transfer_entry::InsightTransferEntry; +pub mod interest_period_property; +pub use self::interest_period_property::InterestPeriodProperty; +pub mod internal_exception_response; +pub use self::internal_exception_response::InternalExceptionResponse; +pub mod liability_direction_property; +pub use self::liability_direction_property::LiabilityDirectionProperty; +pub mod liability_type_property; +pub use self::liability_type_property::LiabilityTypeProperty; +pub mod link_type; +pub use self::link_type::LinkType; +pub mod link_type_array; +pub use self::link_type_array::LinkTypeArray; +pub mod link_type_read; +pub use self::link_type_read::LinkTypeRead; +pub mod link_type_single; +pub use self::link_type_single::LinkTypeSingle; +pub mod link_type_update; +pub use self::link_type_update::LinkTypeUpdate; +pub mod meta; +pub use self::meta::Meta; +pub mod meta_pagination; +pub use self::meta_pagination::MetaPagination; +pub mod not_found_response; +pub use self::not_found_response::NotFoundResponse; +pub mod object_group; +pub use self::object_group::ObjectGroup; +pub mod object_group_array; +pub use self::object_group_array::ObjectGroupArray; +pub mod object_group_read; +pub use self::object_group_read::ObjectGroupRead; +pub mod object_group_single; +pub use self::object_group_single::ObjectGroupSingle; +pub mod object_group_update; +pub use self::object_group_update::ObjectGroupUpdate; +pub mod object_link; +pub use self::object_link::ObjectLink; +pub mod object_link_0; +pub use self::object_link_0::ObjectLink0; +pub mod page_link; +pub use self::page_link::PageLink; +pub mod piggy_bank; +pub use self::piggy_bank::PiggyBank; +pub mod piggy_bank_array; +pub use self::piggy_bank_array::PiggyBankArray; +pub mod piggy_bank_event; +pub use self::piggy_bank_event::PiggyBankEvent; +pub mod piggy_bank_event_array; +pub use self::piggy_bank_event_array::PiggyBankEventArray; +pub mod piggy_bank_event_read; +pub use self::piggy_bank_event_read::PiggyBankEventRead; +pub mod piggy_bank_read; +pub use self::piggy_bank_read::PiggyBankRead; +pub mod piggy_bank_single; +pub use self::piggy_bank_single::PiggyBankSingle; +pub mod piggy_bank_store; +pub use self::piggy_bank_store::PiggyBankStore; +pub mod piggy_bank_update; +pub use self::piggy_bank_update::PiggyBankUpdate; +pub mod polymorphic_property; +pub use self::polymorphic_property::PolymorphicProperty; +pub mod preference; +pub use self::preference::Preference; +pub mod preference_array; +pub use self::preference_array::PreferenceArray; +pub mod preference_read; +pub use self::preference_read::PreferenceRead; +pub mod preference_single; +pub use self::preference_single::PreferenceSingle; +pub mod preference_update; +pub use self::preference_update::PreferenceUpdate; +pub mod recurrence; +pub use self::recurrence::Recurrence; +pub mod recurrence_array; +pub use self::recurrence_array::RecurrenceArray; +pub mod recurrence_read; +pub use self::recurrence_read::RecurrenceRead; +pub mod recurrence_repetition; +pub use self::recurrence_repetition::RecurrenceRepetition; +pub mod recurrence_repetition_store; +pub use self::recurrence_repetition_store::RecurrenceRepetitionStore; +pub mod recurrence_repetition_type; +pub use self::recurrence_repetition_type::RecurrenceRepetitionType; +pub mod recurrence_repetition_update; +pub use self::recurrence_repetition_update::RecurrenceRepetitionUpdate; +pub mod recurrence_single; +pub use self::recurrence_single::RecurrenceSingle; +pub mod recurrence_store; +pub use self::recurrence_store::RecurrenceStore; +pub mod recurrence_transaction; +pub use self::recurrence_transaction::RecurrenceTransaction; +pub mod recurrence_transaction_store; +pub use self::recurrence_transaction_store::RecurrenceTransactionStore; +pub mod recurrence_transaction_type; +pub use self::recurrence_transaction_type::RecurrenceTransactionType; +pub mod recurrence_transaction_update; +pub use self::recurrence_transaction_update::RecurrenceTransactionUpdate; +pub mod recurrence_update; +pub use self::recurrence_update::RecurrenceUpdate; +pub mod rule; +pub use self::rule::Rule; +pub mod rule_action; +pub use self::rule_action::RuleAction; +pub mod rule_action_keyword; +pub use self::rule_action_keyword::RuleActionKeyword; +pub mod rule_action_store; +pub use self::rule_action_store::RuleActionStore; +pub mod rule_action_update; +pub use self::rule_action_update::RuleActionUpdate; +pub mod rule_array; +pub use self::rule_array::RuleArray; +pub mod rule_group; +pub use self::rule_group::RuleGroup; +pub mod rule_group_array; +pub use self::rule_group_array::RuleGroupArray; +pub mod rule_group_read; +pub use self::rule_group_read::RuleGroupRead; +pub mod rule_group_single; +pub use self::rule_group_single::RuleGroupSingle; +pub mod rule_group_store; +pub use self::rule_group_store::RuleGroupStore; +pub mod rule_group_update; +pub use self::rule_group_update::RuleGroupUpdate; +pub mod rule_read; +pub use self::rule_read::RuleRead; +pub mod rule_single; +pub use self::rule_single::RuleSingle; +pub mod rule_store; +pub use self::rule_store::RuleStore; +pub mod rule_trigger; +pub use self::rule_trigger::RuleTrigger; +pub mod rule_trigger_keyword; +pub use self::rule_trigger_keyword::RuleTriggerKeyword; +pub mod rule_trigger_store; +pub use self::rule_trigger_store::RuleTriggerStore; +pub mod rule_trigger_type; +pub use self::rule_trigger_type::RuleTriggerType; +pub mod rule_trigger_update; +pub use self::rule_trigger_update::RuleTriggerUpdate; +pub mod rule_update; +pub use self::rule_update::RuleUpdate; +pub mod short_account_type_property; +pub use self::short_account_type_property::ShortAccountTypeProperty; +pub mod system_info; +pub use self::system_info::SystemInfo; +pub mod system_info_data; +pub use self::system_info_data::SystemInfoData; +pub mod tag_array; +pub use self::tag_array::TagArray; +pub mod tag_model; +pub use self::tag_model::TagModel; +pub mod tag_model_store; +pub use self::tag_model_store::TagModelStore; +pub mod tag_model_update; +pub use self::tag_model_update::TagModelUpdate; +pub mod tag_read; +pub use self::tag_read::TagRead; +pub mod tag_single; +pub use self::tag_single::TagSingle; +pub mod transaction; +pub use self::transaction::Transaction; +pub mod transaction_array; +pub use self::transaction_array::TransactionArray; +pub mod transaction_link; +pub use self::transaction_link::TransactionLink; +pub mod transaction_link_array; +pub use self::transaction_link_array::TransactionLinkArray; +pub mod transaction_link_read; +pub use self::transaction_link_read::TransactionLinkRead; +pub mod transaction_link_single; +pub use self::transaction_link_single::TransactionLinkSingle; +pub mod transaction_link_store; +pub use self::transaction_link_store::TransactionLinkStore; +pub mod transaction_link_update; +pub use self::transaction_link_update::TransactionLinkUpdate; +pub mod transaction_read; +pub use self::transaction_read::TransactionRead; +pub mod transaction_single; +pub use self::transaction_single::TransactionSingle; +pub mod transaction_split; +pub use self::transaction_split::TransactionSplit; +pub mod transaction_split_store; +pub use self::transaction_split_store::TransactionSplitStore; +pub mod transaction_split_update; +pub use self::transaction_split_update::TransactionSplitUpdate; +pub mod transaction_store; +pub use self::transaction_store::TransactionStore; +pub mod transaction_type_filter; +pub use self::transaction_type_filter::TransactionTypeFilter; +pub mod transaction_type_property; +pub use self::transaction_type_property::TransactionTypeProperty; +pub mod transaction_update; +pub use self::transaction_update::TransactionUpdate; +pub mod unauthenticated_response; +pub use self::unauthenticated_response::UnauthenticatedResponse; +pub mod user; +pub use self::user::User; +pub mod user_array; +pub use self::user_array::UserArray; +pub mod user_blocked_code_property; +pub use self::user_blocked_code_property::UserBlockedCodeProperty; +pub mod user_read; +pub use self::user_read::UserRead; +pub mod user_role_property; +pub use self::user_role_property::UserRoleProperty; +pub mod user_single; +pub use self::user_single::UserSingle; +pub mod validation_error_response; +pub use self::validation_error_response::ValidationErrorResponse; +pub mod validation_error_response_errors; +pub use self::validation_error_response_errors::ValidationErrorResponseErrors; +pub mod webhook; +pub use self::webhook::Webhook; +pub mod webhook_array; +pub use self::webhook_array::WebhookArray; +pub mod webhook_attempt; +pub use self::webhook_attempt::WebhookAttempt; +pub mod webhook_attempt_array; +pub use self::webhook_attempt_array::WebhookAttemptArray; +pub mod webhook_attempt_read; +pub use self::webhook_attempt_read::WebhookAttemptRead; +pub mod webhook_attempt_single; +pub use self::webhook_attempt_single::WebhookAttemptSingle; +pub mod webhook_delivery; +pub use self::webhook_delivery::WebhookDelivery; +pub mod webhook_message; +pub use self::webhook_message::WebhookMessage; +pub mod webhook_message_array; +pub use self::webhook_message_array::WebhookMessageArray; +pub mod webhook_message_read; +pub use self::webhook_message_read::WebhookMessageRead; +pub mod webhook_message_single; +pub use self::webhook_message_single::WebhookMessageSingle; +pub mod webhook_read; +pub use self::webhook_read::WebhookRead; +pub mod webhook_response; +pub use self::webhook_response::WebhookResponse; +pub mod webhook_single; +pub use self::webhook_single::WebhookSingle; +pub mod webhook_store; +pub use self::webhook_store::WebhookStore; +pub mod webhook_trigger; +pub use self::webhook_trigger::WebhookTrigger; +pub mod webhook_update; +pub use self::webhook_update::WebhookUpdate; diff --git a/firefly-iii-api/src/models/not_found_response.rs b/firefly-iii-api/src/models/not_found_response.rs new file mode 100644 index 0000000..258a625 --- /dev/null +++ b/firefly-iii-api/src/models/not_found_response.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NotFoundResponse { + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(rename = "exception", skip_serializing_if = "Option::is_none")] + pub exception: Option, +} + +impl NotFoundResponse { + pub fn new() -> NotFoundResponse { + NotFoundResponse { + message: None, + exception: None, + } + } +} + diff --git a/firefly-iii-api/src/models/object_group.rs b/firefly-iii-api/src/models/object_group.rs new file mode 100644 index 0000000..d789e62 --- /dev/null +++ b/firefly-iii-api/src/models/object_group.rs @@ -0,0 +1,37 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ObjectGroup { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "title")] + pub title: String, + /// Order of the object group + #[serde(rename = "order")] + pub order: i32, +} + +impl ObjectGroup { + pub fn new(title: String, order: i32) -> ObjectGroup { + ObjectGroup { + created_at: None, + updated_at: None, + title, + order, + } + } +} + diff --git a/firefly-iii-api/src/models/object_group_array.rs b/firefly-iii-api/src/models/object_group_array.rs new file mode 100644 index 0000000..c1a4ea1 --- /dev/null +++ b/firefly-iii-api/src/models/object_group_array.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ObjectGroupArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, +} + +impl ObjectGroupArray { + pub fn new(data: Vec, meta: models::Meta) -> ObjectGroupArray { + ObjectGroupArray { + data, + meta: Box::new(meta), + } + } +} + diff --git a/firefly-iii-api/src/models/object_group_read.rs b/firefly-iii-api/src/models/object_group_read.rs new file mode 100644 index 0000000..02d5d92 --- /dev/null +++ b/firefly-iii-api/src/models/object_group_read.rs @@ -0,0 +1,34 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ObjectGroupRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, +} + +impl ObjectGroupRead { + pub fn new(r#type: String, id: String, attributes: models::ObjectGroup) -> ObjectGroupRead { + ObjectGroupRead { + r#type, + id, + attributes: Box::new(attributes), + } + } +} + diff --git a/firefly-iii-api/src/models/object_group_single.rs b/firefly-iii-api/src/models/object_group_single.rs new file mode 100644 index 0000000..0918c24 --- /dev/null +++ b/firefly-iii-api/src/models/object_group_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ObjectGroupSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl ObjectGroupSingle { + pub fn new(data: models::ObjectGroupRead) -> ObjectGroupSingle { + ObjectGroupSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/object_group_update.rs b/firefly-iii-api/src/models/object_group_update.rs new file mode 100644 index 0000000..6e780e4 --- /dev/null +++ b/firefly-iii-api/src/models/object_group_update.rs @@ -0,0 +1,31 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ObjectGroupUpdate { + #[serde(rename = "title")] + pub title: String, + /// Order of the object group + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, +} + +impl ObjectGroupUpdate { + pub fn new(title: String) -> ObjectGroupUpdate { + ObjectGroupUpdate { + title, + order: None, + } + } +} + diff --git a/firefly-iii-api/src/models/object_link.rs b/firefly-iii-api/src/models/object_link.rs new file mode 100644 index 0000000..07f0b1c --- /dev/null +++ b/firefly-iii-api/src/models/object_link.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ObjectLink { + #[serde(rename = "0", skip_serializing_if = "Option::is_none")] + pub param_0: Option>, + #[serde(rename = "self", skip_serializing_if = "Option::is_none")] + pub param_self: Option, +} + +impl ObjectLink { + pub fn new() -> ObjectLink { + ObjectLink { + param_0: None, + param_self: None, + } + } +} + diff --git a/firefly-iii-api/src/models/object_link_0.rs b/firefly-iii-api/src/models/object_link_0.rs new file mode 100644 index 0000000..1690b58 --- /dev/null +++ b/firefly-iii-api/src/models/object_link_0.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ObjectLink0 { + #[serde(rename = "rel", skip_serializing_if = "Option::is_none")] + pub rel: Option, + #[serde(rename = "uri", skip_serializing_if = "Option::is_none")] + pub uri: Option, +} + +impl ObjectLink0 { + pub fn new() -> ObjectLink0 { + ObjectLink0 { + rel: None, + uri: None, + } + } +} + diff --git a/firefly-iii-api/src/models/page_link.rs b/firefly-iii-api/src/models/page_link.rs new file mode 100644 index 0000000..86361db --- /dev/null +++ b/firefly-iii-api/src/models/page_link.rs @@ -0,0 +1,39 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PageLink { + #[serde(rename = "self", skip_serializing_if = "Option::is_none")] + pub param_self: Option, + #[serde(rename = "first", skip_serializing_if = "Option::is_none")] + pub first: Option, + #[serde(rename = "next", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub next: Option>, + #[serde(rename = "prev", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub prev: Option>, + #[serde(rename = "last", skip_serializing_if = "Option::is_none")] + pub last: Option, +} + +impl PageLink { + pub fn new() -> PageLink { + PageLink { + param_self: None, + first: None, + next: None, + prev: None, + last: None, + } + } +} + diff --git a/firefly-iii-api/src/models/piggy_bank.rs b/firefly-iii-api/src/models/piggy_bank.rs new file mode 100644 index 0000000..b4722d8 --- /dev/null +++ b/firefly-iii-api/src/models/piggy_bank.rs @@ -0,0 +1,98 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PiggyBank { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// The ID of the asset account this piggy bank is connected to. + #[serde(rename = "account_id")] + pub account_id: String, + /// The name of the asset account this piggy bank is connected to. + #[serde(rename = "account_name", skip_serializing_if = "Option::is_none")] + pub account_name: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + /// Number of decimals supported by the currency + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, + #[serde(rename = "target_amount", deserialize_with = "Option::deserialize")] + pub target_amount: Option, + #[serde(rename = "percentage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub percentage: Option>, + #[serde(rename = "current_amount", skip_serializing_if = "Option::is_none")] + pub current_amount: Option, + #[serde(rename = "left_to_save", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub left_to_save: Option>, + #[serde(rename = "save_per_month", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub save_per_month: Option>, + /// The date you started with this piggy bank. + #[serde(rename = "start_date", skip_serializing_if = "Option::is_none")] + pub start_date: Option, + /// The date you intend to finish saving money. + #[serde(rename = "target_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub target_date: Option>, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + /// The group ID of the group this object is part of. NULL if no group. + #[serde(rename = "object_group_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_id: Option>, + /// The order of the group. At least 1, for the highest sorting. + #[serde(rename = "object_group_order", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_order: Option>, + /// The name of the group. NULL if no group. + #[serde(rename = "object_group_title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_title: Option>, +} + +impl PiggyBank { + pub fn new(account_id: String, name: String, target_amount: Option) -> PiggyBank { + PiggyBank { + created_at: None, + updated_at: None, + account_id, + account_name: None, + name, + currency_id: None, + currency_code: None, + currency_symbol: None, + currency_decimal_places: None, + target_amount, + percentage: None, + current_amount: None, + left_to_save: None, + save_per_month: None, + start_date: None, + target_date: None, + order: None, + active: None, + notes: None, + object_group_id: None, + object_group_order: None, + object_group_title: None, + } + } +} + diff --git a/firefly-iii-api/src/models/piggy_bank_array.rs b/firefly-iii-api/src/models/piggy_bank_array.rs new file mode 100644 index 0000000..4189ad0 --- /dev/null +++ b/firefly-iii-api/src/models/piggy_bank_array.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PiggyBankArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl PiggyBankArray { + pub fn new(data: Vec, meta: models::Meta, links: models::PageLink) -> PiggyBankArray { + PiggyBankArray { + data, + meta: Box::new(meta), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/piggy_bank_event.rs b/firefly-iii-api/src/models/piggy_bank_event.rs new file mode 100644 index 0000000..e4e16b5 --- /dev/null +++ b/firefly-iii-api/src/models/piggy_bank_event.rs @@ -0,0 +1,53 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PiggyBankEvent { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, + #[serde(rename = "amount", skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The journal associated with the event. + #[serde(rename = "transaction_journal_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub transaction_journal_id: Option>, + /// The transaction group associated with the event. + #[serde(rename = "transaction_group_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub transaction_group_id: Option>, +} + +impl PiggyBankEvent { + pub fn new() -> PiggyBankEvent { + PiggyBankEvent { + created_at: None, + updated_at: None, + currency_id: None, + currency_code: None, + currency_symbol: None, + currency_decimal_places: None, + amount: None, + transaction_journal_id: None, + transaction_group_id: None, + } + } +} + diff --git a/firefly-iii-api/src/models/piggy_bank_event_array.rs b/firefly-iii-api/src/models/piggy_bank_event_array.rs new file mode 100644 index 0000000..fb24e50 --- /dev/null +++ b/firefly-iii-api/src/models/piggy_bank_event_array.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PiggyBankEventArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl PiggyBankEventArray { + pub fn new(data: Vec, meta: models::Meta, links: models::PageLink) -> PiggyBankEventArray { + PiggyBankEventArray { + data, + meta: Box::new(meta), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/piggy_bank_event_read.rs b/firefly-iii-api/src/models/piggy_bank_event_read.rs new file mode 100644 index 0000000..d50571a --- /dev/null +++ b/firefly-iii-api/src/models/piggy_bank_event_read.rs @@ -0,0 +1,37 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PiggyBankEventRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl PiggyBankEventRead { + pub fn new(r#type: String, id: String, attributes: models::PiggyBankEvent, links: models::ObjectLink) -> PiggyBankEventRead { + PiggyBankEventRead { + r#type, + id, + attributes: Box::new(attributes), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/piggy_bank_read.rs b/firefly-iii-api/src/models/piggy_bank_read.rs new file mode 100644 index 0000000..fb160cc --- /dev/null +++ b/firefly-iii-api/src/models/piggy_bank_read.rs @@ -0,0 +1,37 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PiggyBankRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl PiggyBankRead { + pub fn new(r#type: String, id: String, attributes: models::PiggyBank, links: models::ObjectLink) -> PiggyBankRead { + PiggyBankRead { + r#type, + id, + attributes: Box::new(attributes), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/piggy_bank_single.rs b/firefly-iii-api/src/models/piggy_bank_single.rs new file mode 100644 index 0000000..bba732d --- /dev/null +++ b/firefly-iii-api/src/models/piggy_bank_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PiggyBankSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl PiggyBankSingle { + pub fn new(data: models::PiggyBankRead) -> PiggyBankSingle { + PiggyBankSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/piggy_bank_store.rs b/firefly-iii-api/src/models/piggy_bank_store.rs new file mode 100644 index 0000000..856a772 --- /dev/null +++ b/firefly-iii-api/src/models/piggy_bank_store.rs @@ -0,0 +1,62 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PiggyBankStore { + #[serde(rename = "name")] + pub name: String, + /// The ID of the asset account this piggy bank is connected to. + #[serde(rename = "account_id")] + pub account_id: String, + #[serde(rename = "target_amount", deserialize_with = "Option::deserialize")] + pub target_amount: Option, + #[serde(rename = "current_amount", skip_serializing_if = "Option::is_none")] + pub current_amount: Option, + /// The date you started with this piggy bank. + #[serde(rename = "start_date", skip_serializing_if = "Option::is_none")] + pub start_date: Option, + /// The date you intend to finish saving money. + #[serde(rename = "target_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub target_date: Option>, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + /// The group ID of the group this object is part of. NULL if no group. + #[serde(rename = "object_group_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_id: Option>, + /// The name of the group. NULL if no group. + #[serde(rename = "object_group_title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_title: Option>, +} + +impl PiggyBankStore { + pub fn new(name: String, account_id: String, target_amount: Option) -> PiggyBankStore { + PiggyBankStore { + name, + account_id, + target_amount, + current_amount: None, + start_date: None, + target_date: None, + order: None, + active: None, + notes: None, + object_group_id: None, + object_group_title: None, + } + } +} + diff --git a/firefly-iii-api/src/models/piggy_bank_update.rs b/firefly-iii-api/src/models/piggy_bank_update.rs new file mode 100644 index 0000000..b49a434 --- /dev/null +++ b/firefly-iii-api/src/models/piggy_bank_update.rs @@ -0,0 +1,68 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PiggyBankUpdate { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// The ID of the asset account this piggy bank is connected to. + #[serde(rename = "account_id", skip_serializing_if = "Option::is_none")] + pub account_id: Option, + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "target_amount", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub target_amount: Option>, + #[serde(rename = "current_amount", skip_serializing_if = "Option::is_none")] + pub current_amount: Option, + /// The date you started with this piggy bank. + #[serde(rename = "start_date", skip_serializing_if = "Option::is_none")] + pub start_date: Option, + /// The date you intend to finish saving money. + #[serde(rename = "target_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub target_date: Option>, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + /// The group ID of the group this object is part of. NULL if no group. + #[serde(rename = "object_group_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_id: Option>, + /// The name of the group. NULL if no group. + #[serde(rename = "object_group_title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub object_group_title: Option>, +} + +impl PiggyBankUpdate { + pub fn new() -> PiggyBankUpdate { + PiggyBankUpdate { + name: None, + account_id: None, + currency_id: None, + currency_code: None, + target_amount: None, + current_amount: None, + start_date: None, + target_date: None, + order: None, + active: None, + notes: None, + object_group_id: None, + object_group_title: None, + } + } +} + diff --git a/firefly-iii-api/src/models/polymorphic_property.rs b/firefly-iii-api/src/models/polymorphic_property.rs new file mode 100644 index 0000000..8813122 --- /dev/null +++ b/firefly-iii-api/src/models/polymorphic_property.rs @@ -0,0 +1,28 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PolymorphicProperty { + Boolean(bool), + String(String), + Object(serde_json::Value), + Array(Vec), +} + +impl Default for PolymorphicProperty { + fn default() -> Self { + Self::Boolean(Default::default()) + } +} + diff --git a/firefly-iii-api/src/models/preference.rs b/firefly-iii-api/src/models/preference.rs new file mode 100644 index 0000000..ae41a73 --- /dev/null +++ b/firefly-iii-api/src/models/preference.rs @@ -0,0 +1,36 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Preference { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "data")] + pub data: Box, +} + +impl Preference { + pub fn new(name: String, data: models::PolymorphicProperty) -> Preference { + Preference { + created_at: None, + updated_at: None, + name, + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/preference_array.rs b/firefly-iii-api/src/models/preference_array.rs new file mode 100644 index 0000000..48a901d --- /dev/null +++ b/firefly-iii-api/src/models/preference_array.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PreferenceArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl PreferenceArray { + pub fn new(data: Vec, meta: models::Meta, links: models::PageLink) -> PreferenceArray { + PreferenceArray { + data, + meta: Box::new(meta), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/preference_read.rs b/firefly-iii-api/src/models/preference_read.rs new file mode 100644 index 0000000..caf3c68 --- /dev/null +++ b/firefly-iii-api/src/models/preference_read.rs @@ -0,0 +1,34 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PreferenceRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, +} + +impl PreferenceRead { + pub fn new(r#type: String, id: String, attributes: models::Preference) -> PreferenceRead { + PreferenceRead { + r#type, + id, + attributes: Box::new(attributes), + } + } +} + diff --git a/firefly-iii-api/src/models/preference_single.rs b/firefly-iii-api/src/models/preference_single.rs new file mode 100644 index 0000000..f8d2d1e --- /dev/null +++ b/firefly-iii-api/src/models/preference_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PreferenceSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl PreferenceSingle { + pub fn new(data: models::PreferenceRead) -> PreferenceSingle { + PreferenceSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/preference_update.rs b/firefly-iii-api/src/models/preference_update.rs new file mode 100644 index 0000000..b80e7eb --- /dev/null +++ b/firefly-iii-api/src/models/preference_update.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PreferenceUpdate { + #[serde(rename = "data")] + pub data: Box, +} + +impl PreferenceUpdate { + pub fn new(data: models::PolymorphicProperty) -> PreferenceUpdate { + PreferenceUpdate { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/recurrence.rs b/firefly-iii-api/src/models/recurrence.rs new file mode 100644 index 0000000..623eaad --- /dev/null +++ b/firefly-iii-api/src/models/recurrence.rs @@ -0,0 +1,73 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Recurrence { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + /// Not to be confused with the description of the actual transaction(s) being created. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// First time the recurring transaction will fire. Must be after today. + #[serde(rename = "first_date", skip_serializing_if = "Option::is_none")] + pub first_date: Option, + /// Last time the recurring transaction has fired. + #[serde(rename = "latest_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub latest_date: Option>, + /// Date until the recurring transaction can fire. Use either this field or repetitions. + #[serde(rename = "repeat_until", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub repeat_until: Option>, + /// Max number of created transactions. Use either this field or repeat_until. + #[serde(rename = "nr_of_repetitions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub nr_of_repetitions: Option>, + /// Whether or not to fire the rules after the creation of a transaction. + #[serde(rename = "apply_rules", skip_serializing_if = "Option::is_none")] + pub apply_rules: Option, + /// If the recurrence is even active. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + #[serde(rename = "repetitions", skip_serializing_if = "Option::is_none")] + pub repetitions: Option>, + #[serde(rename = "transactions", skip_serializing_if = "Option::is_none")] + pub transactions: Option>, +} + +impl Recurrence { + pub fn new() -> Recurrence { + Recurrence { + created_at: None, + updated_at: None, + r#type: None, + title: None, + description: None, + first_date: None, + latest_date: None, + repeat_until: None, + nr_of_repetitions: None, + apply_rules: None, + active: None, + notes: None, + repetitions: None, + transactions: None, + } + } +} + diff --git a/firefly-iii-api/src/models/recurrence_array.rs b/firefly-iii-api/src/models/recurrence_array.rs new file mode 100644 index 0000000..dc5cf46 --- /dev/null +++ b/firefly-iii-api/src/models/recurrence_array.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RecurrenceArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl RecurrenceArray { + pub fn new(data: Vec, meta: models::Meta, links: models::PageLink) -> RecurrenceArray { + RecurrenceArray { + data, + meta: Box::new(meta), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/recurrence_read.rs b/firefly-iii-api/src/models/recurrence_read.rs new file mode 100644 index 0000000..1e0cacb --- /dev/null +++ b/firefly-iii-api/src/models/recurrence_read.rs @@ -0,0 +1,37 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RecurrenceRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl RecurrenceRead { + pub fn new(r#type: String, id: String, attributes: models::Recurrence, links: models::ObjectLink) -> RecurrenceRead { + RecurrenceRead { + r#type, + id, + attributes: Box::new(attributes), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/recurrence_repetition.rs b/firefly-iii-api/src/models/recurrence_repetition.rs new file mode 100644 index 0000000..48deac8 --- /dev/null +++ b/firefly-iii-api/src/models/recurrence_repetition.rs @@ -0,0 +1,56 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RecurrenceRepetition { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "type")] + pub r#type: models::RecurrenceRepetitionType, + /// Information that defined the type of repetition. - For 'daily', this is empty. - For 'weekly', it is day of the week between 1 and 7 (Monday - Sunday). - For 'ndom', it is '1,2' or '4,5' or something else, where the first number is the week in the month, and the second number is the day in the week (between 1 and 7). '2,3' means: the 2nd Wednesday of the month - For 'monthly' it is the day of the month (1 - 31) - For yearly, it is a full date, ie '2018-09-17'. The year you use does not matter. + #[serde(rename = "moment")] + pub moment: String, + /// How many occurrences to skip. 0 means skip nothing. 1 means every other. + #[serde(rename = "skip", skip_serializing_if = "Option::is_none")] + pub skip: Option, + /// How to respond when the recurring transaction falls in the weekend. Possible values: 1. Do nothing, just create it 2. Create no transaction. 3. Skip to the previous Friday. 4. Skip to the next Monday. + #[serde(rename = "weekend", skip_serializing_if = "Option::is_none")] + pub weekend: Option, + /// Auto-generated repetition description. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Array of future dates when the repetition will apply to. Auto generated. + #[serde(rename = "occurrences", skip_serializing_if = "Option::is_none")] + pub occurrences: Option>, +} + +impl RecurrenceRepetition { + pub fn new(r#type: models::RecurrenceRepetitionType, moment: String) -> RecurrenceRepetition { + RecurrenceRepetition { + id: None, + created_at: None, + updated_at: None, + r#type, + moment, + skip: None, + weekend: None, + description: None, + occurrences: None, + } + } +} + diff --git a/firefly-iii-api/src/models/recurrence_repetition_store.rs b/firefly-iii-api/src/models/recurrence_repetition_store.rs new file mode 100644 index 0000000..6266814 --- /dev/null +++ b/firefly-iii-api/src/models/recurrence_repetition_store.rs @@ -0,0 +1,39 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RecurrenceRepetitionStore { + #[serde(rename = "type")] + pub r#type: models::RecurrenceRepetitionType, + /// Information that defined the type of repetition. - For 'daily', this is empty. - For 'weekly', it is day of the week between 1 and 7 (Monday - Sunday). - For 'ndom', it is '1,2' or '4,5' or something else, where the first number is the week in the month, and the second number is the day in the week (between 1 and 7). '2,3' means: the 2nd Wednesday of the month - For 'monthly' it is the day of the month (1 - 31) - For yearly, it is a full date, ie '2018-09-17'. The year you use does not matter. + #[serde(rename = "moment")] + pub moment: String, + /// How many occurrences to skip. 0 means skip nothing. 1 means every other. + #[serde(rename = "skip", skip_serializing_if = "Option::is_none")] + pub skip: Option, + /// How to respond when the recurring transaction falls in the weekend. Possible values: 1. Do nothing, just create it 2. Create no transaction. 3. Skip to the previous Friday. 4. Skip to the next Monday. + #[serde(rename = "weekend", skip_serializing_if = "Option::is_none")] + pub weekend: Option, +} + +impl RecurrenceRepetitionStore { + pub fn new(r#type: models::RecurrenceRepetitionType, moment: String) -> RecurrenceRepetitionStore { + RecurrenceRepetitionStore { + r#type, + moment, + skip: None, + weekend: None, + } + } +} + diff --git a/firefly-iii-api/src/models/recurrence_repetition_type.rs b/firefly-iii-api/src/models/recurrence_repetition_type.rs new file mode 100644 index 0000000..a603899 --- /dev/null +++ b/firefly-iii-api/src/models/recurrence_repetition_type.rs @@ -0,0 +1,48 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// RecurrenceRepetitionType : The type of the repetition. ndom means: the n-th weekday of the month, where you can also specify which day of the week. +/// The type of the repetition. ndom means: the n-th weekday of the month, where you can also specify which day of the week. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RecurrenceRepetitionType { + #[serde(rename = "daily")] + Daily, + #[serde(rename = "weekly")] + Weekly, + #[serde(rename = "ndom")] + Ndom, + #[serde(rename = "monthly")] + Monthly, + #[serde(rename = "yearly")] + Yearly, + +} + +impl std::fmt::Display for RecurrenceRepetitionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Daily => write!(f, "daily"), + Self::Weekly => write!(f, "weekly"), + Self::Ndom => write!(f, "ndom"), + Self::Monthly => write!(f, "monthly"), + Self::Yearly => write!(f, "yearly"), + } + } +} + +impl Default for RecurrenceRepetitionType { + fn default() -> RecurrenceRepetitionType { + Self::Daily + } +} + diff --git a/firefly-iii-api/src/models/recurrence_repetition_update.rs b/firefly-iii-api/src/models/recurrence_repetition_update.rs new file mode 100644 index 0000000..062742e --- /dev/null +++ b/firefly-iii-api/src/models/recurrence_repetition_update.rs @@ -0,0 +1,39 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RecurrenceRepetitionUpdate { + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + /// Information that defined the type of repetition. - For 'daily', this is empty. - For 'weekly', it is day of the week between 1 and 7 (Monday - Sunday). - For 'ndom', it is '1,2' or '4,5' or something else, where the first number is the week in the month, and the second number is the day in the week (between 1 and 7). '2,3' means: the 2nd Wednesday of the month - For 'monthly' it is the day of the month (1 - 31) - For yearly, it is a full date, ie '2018-09-17'. The year you use does not matter. + #[serde(rename = "moment", skip_serializing_if = "Option::is_none")] + pub moment: Option, + /// How many occurrences to skip. 0 means skip nothing. 1 means every other. + #[serde(rename = "skip", skip_serializing_if = "Option::is_none")] + pub skip: Option, + /// How to respond when the recurring transaction falls in the weekend. Possible values: 1. Do nothing, just create it 2. Create no transaction. 3. Skip to the previous Friday. 4. Skip to the next Monday. + #[serde(rename = "weekend", skip_serializing_if = "Option::is_none")] + pub weekend: Option, +} + +impl RecurrenceRepetitionUpdate { + pub fn new() -> RecurrenceRepetitionUpdate { + RecurrenceRepetitionUpdate { + r#type: None, + moment: None, + skip: None, + weekend: None, + } + } +} + diff --git a/firefly-iii-api/src/models/recurrence_single.rs b/firefly-iii-api/src/models/recurrence_single.rs new file mode 100644 index 0000000..c0f32dc --- /dev/null +++ b/firefly-iii-api/src/models/recurrence_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RecurrenceSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl RecurrenceSingle { + pub fn new(data: models::RecurrenceRead) -> RecurrenceSingle { + RecurrenceSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/recurrence_store.rs b/firefly-iii-api/src/models/recurrence_store.rs new file mode 100644 index 0000000..8a12a50 --- /dev/null +++ b/firefly-iii-api/src/models/recurrence_store.rs @@ -0,0 +1,63 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RecurrenceStore { + #[serde(rename = "type")] + pub r#type: models::RecurrenceTransactionType, + #[serde(rename = "title")] + pub title: String, + /// Not to be confused with the description of the actual transaction(s) being created. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// First time the recurring transaction will fire. Must be after today. + #[serde(rename = "first_date")] + pub first_date: String, + /// Date until the recurring transaction can fire. Use either this field or repetitions. + #[serde(rename = "repeat_until", deserialize_with = "Option::deserialize")] + pub repeat_until: Option, + /// Max number of created transactions. Use either this field or repeat_until. + #[serde(rename = "nr_of_repetitions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub nr_of_repetitions: Option>, + /// Whether or not to fire the rules after the creation of a transaction. + #[serde(rename = "apply_rules", skip_serializing_if = "Option::is_none")] + pub apply_rules: Option, + /// If the recurrence is even active. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + #[serde(rename = "repetitions")] + pub repetitions: Vec, + #[serde(rename = "transactions")] + pub transactions: Vec, +} + +impl RecurrenceStore { + pub fn new(r#type: models::RecurrenceTransactionType, title: String, first_date: String, repeat_until: Option, repetitions: Vec, transactions: Vec) -> RecurrenceStore { + RecurrenceStore { + r#type, + title, + description: None, + first_date, + repeat_until, + nr_of_repetitions: None, + apply_rules: None, + active: None, + notes: None, + repetitions, + transactions, + } + } +} + diff --git a/firefly-iii-api/src/models/recurrence_transaction.rs b/firefly-iii-api/src/models/recurrence_transaction.rs new file mode 100644 index 0000000..465168b --- /dev/null +++ b/firefly-iii-api/src/models/recurrence_transaction.rs @@ -0,0 +1,132 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RecurrenceTransaction { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "description")] + pub description: String, + /// Amount of the transaction. + #[serde(rename = "amount")] + pub amount: String, + /// Foreign amount of the transaction. + #[serde(rename = "foreign_amount", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_amount: Option>, + /// Submit either a currency_id or a currency_code. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// Submit either a currency_id or a currency_code. + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + /// Number of decimals in the currency + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, + /// Submit either a foreign_currency_id or a foreign_currency_code, or neither. + #[serde(rename = "foreign_currency_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_id: Option>, + /// Submit either a foreign_currency_id or a foreign_currency_code, or neither. + #[serde(rename = "foreign_currency_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_code: Option>, + #[serde(rename = "foreign_currency_symbol", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_symbol: Option>, + /// Number of decimals in the currency + #[serde(rename = "foreign_currency_decimal_places", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_decimal_places: Option>, + /// The budget ID for this transaction. + #[serde(rename = "budget_id", skip_serializing_if = "Option::is_none")] + pub budget_id: Option, + /// 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. + #[serde(rename = "budget_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub budget_name: Option>, + /// Category ID for this transaction. + #[serde(rename = "category_id", skip_serializing_if = "Option::is_none")] + pub category_id: Option, + /// Category name for this transaction. + #[serde(rename = "category_name", skip_serializing_if = "Option::is_none")] + pub category_name: Option, + /// ID of the source account. Submit either this or source_name. + #[serde(rename = "source_id", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + /// Name of the source account. Submit either this or source_id. + #[serde(rename = "source_name", skip_serializing_if = "Option::is_none")] + pub source_name: Option, + #[serde(rename = "source_iban", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub source_iban: Option>, + #[serde(rename = "source_type", skip_serializing_if = "Option::is_none")] + pub source_type: Option, + /// ID of the destination account. Submit either this or destination_name. + #[serde(rename = "destination_id", skip_serializing_if = "Option::is_none")] + pub destination_id: Option, + /// Name of the destination account. Submit either this or destination_id. + #[serde(rename = "destination_name", skip_serializing_if = "Option::is_none")] + pub destination_name: Option, + #[serde(rename = "destination_iban", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub destination_iban: Option>, + #[serde(rename = "destination_type", skip_serializing_if = "Option::is_none")] + pub destination_type: Option, + /// Array of tags. + #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub tags: Option>>, + /// Optional. Use either this or the piggy_bank_name + #[serde(rename = "piggy_bank_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub piggy_bank_id: Option>, + /// Optional. Use either this or the piggy_bank_id + #[serde(rename = "piggy_bank_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub piggy_bank_name: Option>, + /// Optional. Use either this or the bill_name + #[serde(rename = "bill_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bill_id: Option>, + /// Optional. Use either this or the bill_id + #[serde(rename = "bill_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bill_name: Option>, +} + +impl RecurrenceTransaction { + pub fn new(description: String, amount: String) -> RecurrenceTransaction { + RecurrenceTransaction { + id: None, + description, + amount, + foreign_amount: None, + currency_id: None, + currency_code: None, + currency_symbol: None, + currency_decimal_places: None, + foreign_currency_id: None, + foreign_currency_code: None, + foreign_currency_symbol: None, + foreign_currency_decimal_places: None, + budget_id: None, + budget_name: None, + category_id: None, + category_name: None, + source_id: None, + source_name: None, + source_iban: None, + source_type: None, + destination_id: None, + destination_name: None, + destination_iban: None, + destination_type: None, + tags: None, + piggy_bank_id: None, + piggy_bank_name: None, + bill_id: None, + bill_name: None, + } + } +} + diff --git a/firefly-iii-api/src/models/recurrence_transaction_store.rs b/firefly-iii-api/src/models/recurrence_transaction_store.rs new file mode 100644 index 0000000..36a30fb --- /dev/null +++ b/firefly-iii-api/src/models/recurrence_transaction_store.rs @@ -0,0 +1,79 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RecurrenceTransactionStore { + #[serde(rename = "description")] + pub description: String, + /// Amount of the transaction. + #[serde(rename = "amount")] + pub amount: String, + /// Foreign amount of the transaction. + #[serde(rename = "foreign_amount", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_amount: Option>, + /// Submit either a currency_id or a currency_code. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// Submit either a currency_id or a currency_code. + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + /// Submit either a foreign_currency_id or a foreign_currency_code, or neither. + #[serde(rename = "foreign_currency_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_id: Option>, + /// Submit either a foreign_currency_id or a foreign_currency_code, or neither. + #[serde(rename = "foreign_currency_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_code: Option>, + /// The budget ID for this transaction. + #[serde(rename = "budget_id", skip_serializing_if = "Option::is_none")] + pub budget_id: Option, + /// Category ID for this transaction. + #[serde(rename = "category_id", skip_serializing_if = "Option::is_none")] + pub category_id: Option, + /// ID of the source account. + #[serde(rename = "source_id")] + pub source_id: String, + /// ID of the destination account. + #[serde(rename = "destination_id")] + pub destination_id: String, + /// Array of tags. + #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub tags: Option>>, + /// Optional. + #[serde(rename = "piggy_bank_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub piggy_bank_id: Option>, + /// Optional. + #[serde(rename = "bill_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bill_id: Option>, +} + +impl RecurrenceTransactionStore { + pub fn new(description: String, amount: String, source_id: String, destination_id: String) -> RecurrenceTransactionStore { + RecurrenceTransactionStore { + description, + amount, + foreign_amount: None, + currency_id: None, + currency_code: None, + foreign_currency_id: None, + foreign_currency_code: None, + budget_id: None, + category_id: None, + source_id, + destination_id, + tags: None, + piggy_bank_id: None, + bill_id: None, + } + } +} + diff --git a/firefly-iii-api/src/models/recurrence_transaction_type.rs b/firefly-iii-api/src/models/recurrence_transaction_type.rs new file mode 100644 index 0000000..1bae841 --- /dev/null +++ b/firefly-iii-api/src/models/recurrence_transaction_type.rs @@ -0,0 +1,41 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RecurrenceTransactionType { + #[serde(rename = "withdrawal")] + Withdrawal, + #[serde(rename = "transfer")] + Transfer, + #[serde(rename = "deposit")] + Deposit, + +} + +impl std::fmt::Display for RecurrenceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Withdrawal => write!(f, "withdrawal"), + Self::Transfer => write!(f, "transfer"), + Self::Deposit => write!(f, "deposit"), + } + } +} + +impl Default for RecurrenceTransactionType { + fn default() -> RecurrenceTransactionType { + Self::Withdrawal + } +} + diff --git a/firefly-iii-api/src/models/recurrence_transaction_update.rs b/firefly-iii-api/src/models/recurrence_transaction_update.rs new file mode 100644 index 0000000..a55f526 --- /dev/null +++ b/firefly-iii-api/src/models/recurrence_transaction_update.rs @@ -0,0 +1,77 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RecurrenceTransactionUpdate { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Amount of the transaction. + #[serde(rename = "amount", skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Foreign amount of the transaction. + #[serde(rename = "foreign_amount", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_amount: Option>, + /// Submit either a currency_id or a currency_code. + #[serde(rename = "currency_id", skip_serializing_if = "Option::is_none")] + pub currency_id: Option, + /// Submit either a currency_id or a currency_code. + #[serde(rename = "currency_code", skip_serializing_if = "Option::is_none")] + pub currency_code: Option, + /// Submit either a foreign_currency_id or a foreign_currency_code, or neither. + #[serde(rename = "foreign_currency_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_id: Option>, + /// The budget ID for this transaction. + #[serde(rename = "budget_id", skip_serializing_if = "Option::is_none")] + pub budget_id: Option, + /// Category ID for this transaction. + #[serde(rename = "category_id", skip_serializing_if = "Option::is_none")] + pub category_id: Option, + /// ID of the source account. Submit either this or source_name. + #[serde(rename = "source_id", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + /// ID of the destination account. Submit either this or destination_name. + #[serde(rename = "destination_id", skip_serializing_if = "Option::is_none")] + pub destination_id: Option, + /// Array of tags. + #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub tags: Option>>, + #[serde(rename = "piggy_bank_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub piggy_bank_id: Option>, + /// Optional. + #[serde(rename = "bill_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bill_id: Option>, +} + +impl RecurrenceTransactionUpdate { + pub fn new(id: String) -> RecurrenceTransactionUpdate { + RecurrenceTransactionUpdate { + id, + description: None, + amount: None, + foreign_amount: None, + currency_id: None, + currency_code: None, + foreign_currency_id: None, + budget_id: None, + category_id: None, + source_id: None, + destination_id: None, + tags: None, + piggy_bank_id: None, + bill_id: None, + } + } +} + diff --git a/firefly-iii-api/src/models/recurrence_update.rs b/firefly-iii-api/src/models/recurrence_update.rs new file mode 100644 index 0000000..e44cf1c --- /dev/null +++ b/firefly-iii-api/src/models/recurrence_update.rs @@ -0,0 +1,60 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RecurrenceUpdate { + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + /// Not to be confused with the description of the actual transaction(s) being created. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// First time the recurring transaction will fire. + #[serde(rename = "first_date", skip_serializing_if = "Option::is_none")] + pub first_date: Option, + /// Date until the recurring transaction can fire. After that date, it's basically inactive. Use either this field or repetitions. + #[serde(rename = "repeat_until", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub repeat_until: Option>, + /// Max number of created transactions. Use either this field or repeat_until. + #[serde(rename = "nr_of_repetitions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub nr_of_repetitions: Option>, + /// Whether or not to fire the rules after the creation of a transaction. + #[serde(rename = "apply_rules", skip_serializing_if = "Option::is_none")] + pub apply_rules: Option, + /// If the recurrence is even active. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + #[serde(rename = "repetitions", skip_serializing_if = "Option::is_none")] + pub repetitions: Option>, + #[serde(rename = "transactions", skip_serializing_if = "Option::is_none")] + pub transactions: Option>, +} + +impl RecurrenceUpdate { + pub fn new() -> RecurrenceUpdate { + RecurrenceUpdate { + title: None, + description: None, + first_date: None, + repeat_until: None, + nr_of_repetitions: None, + apply_rules: None, + active: None, + notes: None, + repetitions: None, + transactions: None, + } + } +} + diff --git a/firefly-iii-api/src/models/rule.rs b/firefly-iii-api/src/models/rule.rs new file mode 100644 index 0000000..8423016 --- /dev/null +++ b/firefly-iii-api/src/models/rule.rs @@ -0,0 +1,68 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Rule { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "title")] + pub title: String, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// ID of the rule group under which the rule must be stored. Either this field or rule_group_title is mandatory. + #[serde(rename = "rule_group_id")] + pub rule_group_id: String, + /// Title of the rule group under which the rule must be stored. Either this field or rule_group_id is mandatory. + #[serde(rename = "rule_group_title", skip_serializing_if = "Option::is_none")] + pub rule_group_title: Option, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "trigger")] + pub trigger: models::RuleTriggerType, + /// Whether or not the rule is even active. Default is true. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// If the rule is set to be strict, ALL triggers must hit in order for the rule to fire. Otherwise, just one is enough. Default value is true. + #[serde(rename = "strict", skip_serializing_if = "Option::is_none")] + pub strict: Option, + /// If this value is true and the rule is triggered, other rules after this one in the group will be skipped. Default value is false. + #[serde(rename = "stop_processing", skip_serializing_if = "Option::is_none")] + pub stop_processing: Option, + #[serde(rename = "triggers")] + pub triggers: Vec, + #[serde(rename = "actions")] + pub actions: Vec, +} + +impl Rule { + pub fn new(title: String, rule_group_id: String, trigger: models::RuleTriggerType, triggers: Vec, actions: Vec) -> Rule { + Rule { + created_at: None, + updated_at: None, + title, + description: None, + rule_group_id, + rule_group_title: None, + order: None, + trigger, + active: None, + strict: None, + stop_processing: None, + triggers, + actions, + } + } +} + diff --git a/firefly-iii-api/src/models/rule_action.rs b/firefly-iii-api/src/models/rule_action.rs new file mode 100644 index 0000000..6ce713a --- /dev/null +++ b/firefly-iii-api/src/models/rule_action.rs @@ -0,0 +1,52 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleAction { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "type")] + pub r#type: models::RuleActionKeyword, + /// The accompanying value the action will set, change or update. Can be empty, but for some types this value is mandatory. + #[serde(rename = "value", deserialize_with = "Option::deserialize")] + pub value: Option, + /// Order of the action + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + /// If the action is active. Defaults to true. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// When true, other actions will not be fired after this action has fired. Defaults to false. + #[serde(rename = "stop_processing", skip_serializing_if = "Option::is_none")] + pub stop_processing: Option, +} + +impl RuleAction { + pub fn new(r#type: models::RuleActionKeyword, value: Option) -> RuleAction { + RuleAction { + id: None, + created_at: None, + updated_at: None, + r#type, + value, + order: None, + active: None, + stop_processing: None, + } + } +} + diff --git a/firefly-iii-api/src/models/rule_action_keyword.rs b/firefly-iii-api/src/models/rule_action_keyword.rs new file mode 100644 index 0000000..ae53438 --- /dev/null +++ b/firefly-iii-api/src/models/rule_action_keyword.rs @@ -0,0 +1,99 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// RuleActionKeyword : The type of thing this action will do. A limited set is possible. +/// The type of thing this action will do. A limited set is possible. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RuleActionKeyword { + #[serde(rename = "user_action")] + UserAction, + #[serde(rename = "set_category")] + SetCategory, + #[serde(rename = "clear_category")] + ClearCategory, + #[serde(rename = "set_budget")] + SetBudget, + #[serde(rename = "clear_budget")] + ClearBudget, + #[serde(rename = "add_tag")] + AddTag, + #[serde(rename = "remove_tag")] + RemoveTag, + #[serde(rename = "remove_all_tags")] + RemoveAllTags, + #[serde(rename = "set_description")] + SetDescription, + #[serde(rename = "append_description")] + AppendDescription, + #[serde(rename = "prepend_description")] + PrependDescription, + #[serde(rename = "set_source_account")] + SetSourceAccount, + #[serde(rename = "set_destination_account")] + SetDestinationAccount, + #[serde(rename = "set_notes")] + SetNotes, + #[serde(rename = "append_notes")] + AppendNotes, + #[serde(rename = "prepend_notes")] + PrependNotes, + #[serde(rename = "clear_notes")] + ClearNotes, + #[serde(rename = "link_to_bill")] + LinkToBill, + #[serde(rename = "convert_withdrawal")] + ConvertWithdrawal, + #[serde(rename = "convert_deposit")] + ConvertDeposit, + #[serde(rename = "convert_transfer")] + ConvertTransfer, + #[serde(rename = "delete_transaction")] + DeleteTransaction, + +} + +impl std::fmt::Display for RuleActionKeyword { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::UserAction => write!(f, "user_action"), + Self::SetCategory => write!(f, "set_category"), + Self::ClearCategory => write!(f, "clear_category"), + Self::SetBudget => write!(f, "set_budget"), + Self::ClearBudget => write!(f, "clear_budget"), + Self::AddTag => write!(f, "add_tag"), + Self::RemoveTag => write!(f, "remove_tag"), + Self::RemoveAllTags => write!(f, "remove_all_tags"), + Self::SetDescription => write!(f, "set_description"), + Self::AppendDescription => write!(f, "append_description"), + Self::PrependDescription => write!(f, "prepend_description"), + Self::SetSourceAccount => write!(f, "set_source_account"), + Self::SetDestinationAccount => write!(f, "set_destination_account"), + Self::SetNotes => write!(f, "set_notes"), + Self::AppendNotes => write!(f, "append_notes"), + Self::PrependNotes => write!(f, "prepend_notes"), + Self::ClearNotes => write!(f, "clear_notes"), + Self::LinkToBill => write!(f, "link_to_bill"), + Self::ConvertWithdrawal => write!(f, "convert_withdrawal"), + Self::ConvertDeposit => write!(f, "convert_deposit"), + Self::ConvertTransfer => write!(f, "convert_transfer"), + Self::DeleteTransaction => write!(f, "delete_transaction"), + } + } +} + +impl Default for RuleActionKeyword { + fn default() -> RuleActionKeyword { + Self::UserAction + } +} + diff --git a/firefly-iii-api/src/models/rule_action_store.rs b/firefly-iii-api/src/models/rule_action_store.rs new file mode 100644 index 0000000..73c2c67 --- /dev/null +++ b/firefly-iii-api/src/models/rule_action_store.rs @@ -0,0 +1,43 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleActionStore { + #[serde(rename = "type")] + pub r#type: models::RuleActionKeyword, + /// The accompanying value the action will set, change or update. Can be empty, but for some types this value is mandatory. + #[serde(rename = "value", deserialize_with = "Option::deserialize")] + pub value: Option, + /// Order of the action + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + /// If the action is active. Defaults to true. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// When true, other actions will not be fired after this action has fired. Defaults to false. + #[serde(rename = "stop_processing", skip_serializing_if = "Option::is_none")] + pub stop_processing: Option, +} + +impl RuleActionStore { + pub fn new(r#type: models::RuleActionKeyword, value: Option) -> RuleActionStore { + RuleActionStore { + r#type, + value, + order: None, + active: None, + stop_processing: None, + } + } +} + diff --git a/firefly-iii-api/src/models/rule_action_update.rs b/firefly-iii-api/src/models/rule_action_update.rs new file mode 100644 index 0000000..5329d63 --- /dev/null +++ b/firefly-iii-api/src/models/rule_action_update.rs @@ -0,0 +1,43 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleActionUpdate { + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + /// The accompanying value the action will set, change or update. Can be empty, but for some types this value is mandatory. + #[serde(rename = "value", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub value: Option>, + /// Order of the action + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + /// If the action is active. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// When true, other actions will not be fired after this action has fired. + #[serde(rename = "stop_processing", skip_serializing_if = "Option::is_none")] + pub stop_processing: Option, +} + +impl RuleActionUpdate { + pub fn new() -> RuleActionUpdate { + RuleActionUpdate { + r#type: None, + value: None, + order: None, + active: None, + stop_processing: None, + } + } +} + diff --git a/firefly-iii-api/src/models/rule_array.rs b/firefly-iii-api/src/models/rule_array.rs new file mode 100644 index 0000000..f5e8d08 --- /dev/null +++ b/firefly-iii-api/src/models/rule_array.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl RuleArray { + pub fn new(data: Vec, meta: models::Meta, links: models::PageLink) -> RuleArray { + RuleArray { + data, + meta: Box::new(meta), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/rule_group.rs b/firefly-iii-api/src/models/rule_group.rs new file mode 100644 index 0000000..b3eab7d --- /dev/null +++ b/firefly-iii-api/src/models/rule_group.rs @@ -0,0 +1,42 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleGroup { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "title")] + pub title: String, + #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub description: Option>, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, +} + +impl RuleGroup { + pub fn new(title: String) -> RuleGroup { + RuleGroup { + created_at: None, + updated_at: None, + title, + description: None, + order: None, + active: None, + } + } +} + diff --git a/firefly-iii-api/src/models/rule_group_array.rs b/firefly-iii-api/src/models/rule_group_array.rs new file mode 100644 index 0000000..cb36274 --- /dev/null +++ b/firefly-iii-api/src/models/rule_group_array.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleGroupArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl RuleGroupArray { + pub fn new(data: Vec, meta: models::Meta, links: models::PageLink) -> RuleGroupArray { + RuleGroupArray { + data, + meta: Box::new(meta), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/rule_group_read.rs b/firefly-iii-api/src/models/rule_group_read.rs new file mode 100644 index 0000000..3d1e9f8 --- /dev/null +++ b/firefly-iii-api/src/models/rule_group_read.rs @@ -0,0 +1,37 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleGroupRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl RuleGroupRead { + pub fn new(r#type: String, id: String, attributes: models::RuleGroup, links: models::ObjectLink) -> RuleGroupRead { + RuleGroupRead { + r#type, + id, + attributes: Box::new(attributes), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/rule_group_single.rs b/firefly-iii-api/src/models/rule_group_single.rs new file mode 100644 index 0000000..041b68c --- /dev/null +++ b/firefly-iii-api/src/models/rule_group_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleGroupSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl RuleGroupSingle { + pub fn new(data: models::RuleGroupRead) -> RuleGroupSingle { + RuleGroupSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/rule_group_store.rs b/firefly-iii-api/src/models/rule_group_store.rs new file mode 100644 index 0000000..c08fd7d --- /dev/null +++ b/firefly-iii-api/src/models/rule_group_store.rs @@ -0,0 +1,36 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleGroupStore { + #[serde(rename = "title")] + pub title: String, + #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub description: Option>, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, +} + +impl RuleGroupStore { + pub fn new(title: String) -> RuleGroupStore { + RuleGroupStore { + title, + description: None, + order: None, + active: None, + } + } +} + diff --git a/firefly-iii-api/src/models/rule_group_update.rs b/firefly-iii-api/src/models/rule_group_update.rs new file mode 100644 index 0000000..e70c760 --- /dev/null +++ b/firefly-iii-api/src/models/rule_group_update.rs @@ -0,0 +1,36 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleGroupUpdate { + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub description: Option>, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, +} + +impl RuleGroupUpdate { + pub fn new() -> RuleGroupUpdate { + RuleGroupUpdate { + title: None, + description: None, + order: None, + active: None, + } + } +} + diff --git a/firefly-iii-api/src/models/rule_read.rs b/firefly-iii-api/src/models/rule_read.rs new file mode 100644 index 0000000..5212e0f --- /dev/null +++ b/firefly-iii-api/src/models/rule_read.rs @@ -0,0 +1,37 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl RuleRead { + pub fn new(r#type: String, id: String, attributes: models::Rule, links: models::ObjectLink) -> RuleRead { + RuleRead { + r#type, + id, + attributes: Box::new(attributes), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/rule_single.rs b/firefly-iii-api/src/models/rule_single.rs new file mode 100644 index 0000000..e0c5177 --- /dev/null +++ b/firefly-iii-api/src/models/rule_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl RuleSingle { + pub fn new(data: models::RuleRead) -> RuleSingle { + RuleSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/rule_store.rs b/firefly-iii-api/src/models/rule_store.rs new file mode 100644 index 0000000..89a4bf5 --- /dev/null +++ b/firefly-iii-api/src/models/rule_store.rs @@ -0,0 +1,62 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleStore { + #[serde(rename = "title")] + pub title: String, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// ID of the rule group under which the rule must be stored. Either this field or rule_group_title is mandatory. + #[serde(rename = "rule_group_id")] + pub rule_group_id: String, + /// Title of the rule group under which the rule must be stored. Either this field or rule_group_id is mandatory. + #[serde(rename = "rule_group_title", skip_serializing_if = "Option::is_none")] + pub rule_group_title: Option, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "trigger")] + pub trigger: models::RuleTriggerType, + /// Whether or not the rule is even active. Default is true. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// If the rule is set to be strict, ALL triggers must hit in order for the rule to fire. Otherwise, just one is enough. Default value is true. + #[serde(rename = "strict", skip_serializing_if = "Option::is_none")] + pub strict: Option, + /// If this value is true and the rule is triggered, other rules after this one in the group will be skipped. Default value is false. + #[serde(rename = "stop_processing", skip_serializing_if = "Option::is_none")] + pub stop_processing: Option, + #[serde(rename = "triggers")] + pub triggers: Vec, + #[serde(rename = "actions")] + pub actions: Vec, +} + +impl RuleStore { + pub fn new(title: String, rule_group_id: String, trigger: models::RuleTriggerType, triggers: Vec, actions: Vec) -> RuleStore { + RuleStore { + title, + description: None, + rule_group_id, + rule_group_title: None, + order: None, + trigger, + active: None, + strict: None, + stop_processing: None, + triggers, + actions, + } + } +} + diff --git a/firefly-iii-api/src/models/rule_trigger.rs b/firefly-iii-api/src/models/rule_trigger.rs new file mode 100644 index 0000000..55c8693 --- /dev/null +++ b/firefly-iii-api/src/models/rule_trigger.rs @@ -0,0 +1,56 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleTrigger { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "type")] + pub r#type: models::RuleTriggerKeyword, + /// The accompanying value the trigger responds to. This value is often mandatory, but this depends on the trigger. + #[serde(rename = "value")] + pub value: String, + /// If 'prohibited' is true, this rule trigger will be negated. 'Description is' will become 'Description is NOT' etc. + #[serde(rename = "prohibited", skip_serializing_if = "Option::is_none")] + pub prohibited: Option, + /// Order of the trigger + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + /// If the trigger is active. Defaults to true. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// When true, other triggers will not be checked if this trigger was triggered. Defaults to false. + #[serde(rename = "stop_processing", skip_serializing_if = "Option::is_none")] + pub stop_processing: Option, +} + +impl RuleTrigger { + pub fn new(r#type: models::RuleTriggerKeyword, value: String) -> RuleTrigger { + RuleTrigger { + id: None, + created_at: None, + updated_at: None, + r#type, + value, + prohibited: None, + order: None, + active: None, + stop_processing: None, + } + } +} + diff --git a/firefly-iii-api/src/models/rule_trigger_keyword.rs b/firefly-iii-api/src/models/rule_trigger_keyword.rs new file mode 100644 index 0000000..180a6c6 --- /dev/null +++ b/firefly-iii-api/src/models/rule_trigger_keyword.rs @@ -0,0 +1,141 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// RuleTriggerKeyword : The type of thing this trigger responds to. A limited set is possible +/// The type of thing this trigger responds to. A limited set is possible +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RuleTriggerKeyword { + #[serde(rename = "from_account_starts")] + FromAccountStarts, + #[serde(rename = "from_account_ends")] + FromAccountEnds, + #[serde(rename = "from_account_is")] + FromAccountIs, + #[serde(rename = "from_account_contains")] + FromAccountContains, + #[serde(rename = "to_account_starts")] + ToAccountStarts, + #[serde(rename = "to_account_ends")] + ToAccountEnds, + #[serde(rename = "to_account_is")] + ToAccountIs, + #[serde(rename = "to_account_contains")] + ToAccountContains, + #[serde(rename = "amount_less")] + AmountLess, + #[serde(rename = "amount_exactly")] + AmountExactly, + #[serde(rename = "amount_more")] + AmountMore, + #[serde(rename = "description_starts")] + DescriptionStarts, + #[serde(rename = "description_ends")] + DescriptionEnds, + #[serde(rename = "description_contains")] + DescriptionContains, + #[serde(rename = "description_is")] + DescriptionIs, + #[serde(rename = "transaction_type")] + TransactionType, + #[serde(rename = "category_is")] + CategoryIs, + #[serde(rename = "budget_is")] + BudgetIs, + #[serde(rename = "tag_is")] + TagIs, + #[serde(rename = "currency_is")] + CurrencyIs, + #[serde(rename = "has_attachments")] + HasAttachments, + #[serde(rename = "has_no_category")] + HasNoCategory, + #[serde(rename = "has_any_category")] + HasAnyCategory, + #[serde(rename = "has_no_budget")] + HasNoBudget, + #[serde(rename = "has_any_budget")] + HasAnyBudget, + #[serde(rename = "has_no_tag")] + HasNoTag, + #[serde(rename = "has_any_tag")] + HasAnyTag, + #[serde(rename = "notes_contains")] + NotesContains, + #[serde(rename = "notes_start")] + NotesStart, + #[serde(rename = "notes_end")] + NotesEnd, + #[serde(rename = "notes_are")] + NotesAre, + #[serde(rename = "no_notes")] + NoNotes, + #[serde(rename = "any_notes")] + AnyNotes, + #[serde(rename = "source_account_is")] + SourceAccountIs, + #[serde(rename = "destination_account_is")] + DestinationAccountIs, + #[serde(rename = "source_account_starts")] + SourceAccountStarts, + +} + +impl std::fmt::Display for RuleTriggerKeyword { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::FromAccountStarts => write!(f, "from_account_starts"), + Self::FromAccountEnds => write!(f, "from_account_ends"), + Self::FromAccountIs => write!(f, "from_account_is"), + Self::FromAccountContains => write!(f, "from_account_contains"), + Self::ToAccountStarts => write!(f, "to_account_starts"), + Self::ToAccountEnds => write!(f, "to_account_ends"), + Self::ToAccountIs => write!(f, "to_account_is"), + Self::ToAccountContains => write!(f, "to_account_contains"), + Self::AmountLess => write!(f, "amount_less"), + Self::AmountExactly => write!(f, "amount_exactly"), + Self::AmountMore => write!(f, "amount_more"), + Self::DescriptionStarts => write!(f, "description_starts"), + Self::DescriptionEnds => write!(f, "description_ends"), + Self::DescriptionContains => write!(f, "description_contains"), + Self::DescriptionIs => write!(f, "description_is"), + Self::TransactionType => write!(f, "transaction_type"), + Self::CategoryIs => write!(f, "category_is"), + Self::BudgetIs => write!(f, "budget_is"), + Self::TagIs => write!(f, "tag_is"), + Self::CurrencyIs => write!(f, "currency_is"), + Self::HasAttachments => write!(f, "has_attachments"), + Self::HasNoCategory => write!(f, "has_no_category"), + Self::HasAnyCategory => write!(f, "has_any_category"), + Self::HasNoBudget => write!(f, "has_no_budget"), + Self::HasAnyBudget => write!(f, "has_any_budget"), + Self::HasNoTag => write!(f, "has_no_tag"), + Self::HasAnyTag => write!(f, "has_any_tag"), + Self::NotesContains => write!(f, "notes_contains"), + Self::NotesStart => write!(f, "notes_start"), + Self::NotesEnd => write!(f, "notes_end"), + Self::NotesAre => write!(f, "notes_are"), + Self::NoNotes => write!(f, "no_notes"), + Self::AnyNotes => write!(f, "any_notes"), + Self::SourceAccountIs => write!(f, "source_account_is"), + Self::DestinationAccountIs => write!(f, "destination_account_is"), + Self::SourceAccountStarts => write!(f, "source_account_starts"), + } + } +} + +impl Default for RuleTriggerKeyword { + fn default() -> RuleTriggerKeyword { + Self::FromAccountStarts + } +} + diff --git a/firefly-iii-api/src/models/rule_trigger_store.rs b/firefly-iii-api/src/models/rule_trigger_store.rs new file mode 100644 index 0000000..1a63728 --- /dev/null +++ b/firefly-iii-api/src/models/rule_trigger_store.rs @@ -0,0 +1,47 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleTriggerStore { + #[serde(rename = "type")] + pub r#type: models::RuleTriggerKeyword, + /// The accompanying value the trigger responds to. This value is often mandatory, but this depends on the trigger. + #[serde(rename = "value")] + pub value: String, + /// Order of the trigger + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + /// If the trigger is active. Defaults to true. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// If 'prohibited' is true, this rule trigger will be negated. 'Description is' will become 'Description is NOT' etc. + #[serde(rename = "prohibited", skip_serializing_if = "Option::is_none")] + pub prohibited: Option, + /// When true, other triggers will not be checked if this trigger was triggered. Defaults to false. + #[serde(rename = "stop_processing", skip_serializing_if = "Option::is_none")] + pub stop_processing: Option, +} + +impl RuleTriggerStore { + pub fn new(r#type: models::RuleTriggerKeyword, value: String) -> RuleTriggerStore { + RuleTriggerStore { + r#type, + value, + order: None, + active: None, + prohibited: None, + stop_processing: None, + } + } +} + diff --git a/firefly-iii-api/src/models/rule_trigger_type.rs b/firefly-iii-api/src/models/rule_trigger_type.rs new file mode 100644 index 0000000..4dee0e7 --- /dev/null +++ b/firefly-iii-api/src/models/rule_trigger_type.rs @@ -0,0 +1,39 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// RuleTriggerType : Which action is necessary for the rule to fire? Use either store-journal or update-journal. +/// Which action is necessary for the rule to fire? Use either store-journal or update-journal. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RuleTriggerType { + #[serde(rename = "store-journal")] + StoreJournal, + #[serde(rename = "update-journal")] + UpdateJournal, + +} + +impl std::fmt::Display for RuleTriggerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::StoreJournal => write!(f, "store-journal"), + Self::UpdateJournal => write!(f, "update-journal"), + } + } +} + +impl Default for RuleTriggerType { + fn default() -> RuleTriggerType { + Self::StoreJournal + } +} + diff --git a/firefly-iii-api/src/models/rule_trigger_update.rs b/firefly-iii-api/src/models/rule_trigger_update.rs new file mode 100644 index 0000000..c4b1439 --- /dev/null +++ b/firefly-iii-api/src/models/rule_trigger_update.rs @@ -0,0 +1,43 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleTriggerUpdate { + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + /// The accompanying value the trigger responds to. This value is often mandatory, but this depends on the trigger. If the rule trigger is something like 'has any tag', submit the string 'true'. + #[serde(rename = "value", skip_serializing_if = "Option::is_none")] + pub value: Option, + /// Order of the trigger + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + /// If the trigger is active. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// When true, other triggers will not be checked if this trigger was triggered. + #[serde(rename = "stop_processing", skip_serializing_if = "Option::is_none")] + pub stop_processing: Option, +} + +impl RuleTriggerUpdate { + pub fn new() -> RuleTriggerUpdate { + RuleTriggerUpdate { + r#type: None, + value: None, + order: None, + active: None, + stop_processing: None, + } + } +} + diff --git a/firefly-iii-api/src/models/rule_update.rs b/firefly-iii-api/src/models/rule_update.rs new file mode 100644 index 0000000..8ce17ac --- /dev/null +++ b/firefly-iii-api/src/models/rule_update.rs @@ -0,0 +1,58 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RuleUpdate { + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// ID of the rule group under which the rule must be stored. Either this field or rule_group_title is mandatory. + #[serde(rename = "rule_group_id", skip_serializing_if = "Option::is_none")] + pub rule_group_id: Option, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "trigger", skip_serializing_if = "Option::is_none")] + pub trigger: Option, + /// Whether or not the rule is even active. Default is true. + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// If the rule is set to be strict, ALL triggers must hit in order for the rule to fire. Otherwise, just one is enough. Default value is true. + #[serde(rename = "strict", skip_serializing_if = "Option::is_none")] + pub strict: Option, + /// If this value is true and the rule is triggered, other rules after this one in the group will be skipped. Default value is false. + #[serde(rename = "stop_processing", skip_serializing_if = "Option::is_none")] + pub stop_processing: Option, + #[serde(rename = "triggers", skip_serializing_if = "Option::is_none")] + pub triggers: Option>, + #[serde(rename = "actions", skip_serializing_if = "Option::is_none")] + pub actions: Option>, +} + +impl RuleUpdate { + pub fn new() -> RuleUpdate { + RuleUpdate { + title: None, + description: None, + rule_group_id: None, + order: None, + trigger: None, + active: None, + strict: None, + stop_processing: None, + triggers: None, + actions: None, + } + } +} + diff --git a/firefly-iii-api/src/models/short_account_type_property.rs b/firefly-iii-api/src/models/short_account_type_property.rs new file mode 100644 index 0000000..ba6c6db --- /dev/null +++ b/firefly-iii-api/src/models/short_account_type_property.rs @@ -0,0 +1,60 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// ShortAccountTypeProperty : Can only be one one these account types. import, initial-balance and reconciliation cannot be set manually. +/// Can only be one one these account types. import, initial-balance and reconciliation cannot be set manually. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ShortAccountTypeProperty { + #[serde(rename = "asset")] + Asset, + #[serde(rename = "expense")] + Expense, + #[serde(rename = "import")] + Import, + #[serde(rename = "revenue")] + Revenue, + #[serde(rename = "cash")] + Cash, + #[serde(rename = "liability")] + Liability, + #[serde(rename = "liabilities")] + Liabilities, + #[serde(rename = "initial-balance")] + InitialBalance, + #[serde(rename = "reconciliation")] + Reconciliation, + +} + +impl std::fmt::Display for ShortAccountTypeProperty { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Asset => write!(f, "asset"), + Self::Expense => write!(f, "expense"), + Self::Import => write!(f, "import"), + Self::Revenue => write!(f, "revenue"), + Self::Cash => write!(f, "cash"), + Self::Liability => write!(f, "liability"), + Self::Liabilities => write!(f, "liabilities"), + Self::InitialBalance => write!(f, "initial-balance"), + Self::Reconciliation => write!(f, "reconciliation"), + } + } +} + +impl Default for ShortAccountTypeProperty { + fn default() -> ShortAccountTypeProperty { + Self::Asset + } +} + diff --git a/firefly-iii-api/src/models/system_info.rs b/firefly-iii-api/src/models/system_info.rs new file mode 100644 index 0000000..f538335 --- /dev/null +++ b/firefly-iii-api/src/models/system_info.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SystemInfo { + #[serde(rename = "data", skip_serializing_if = "Option::is_none")] + pub data: Option>, +} + +impl SystemInfo { + pub fn new() -> SystemInfo { + SystemInfo { + data: None, + } + } +} + diff --git a/firefly-iii-api/src/models/system_info_data.rs b/firefly-iii-api/src/models/system_info_data.rs new file mode 100644 index 0000000..fcd38c8 --- /dev/null +++ b/firefly-iii-api/src/models/system_info_data.rs @@ -0,0 +1,39 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SystemInfoData { + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + #[serde(rename = "api_version", skip_serializing_if = "Option::is_none")] + pub api_version: Option, + #[serde(rename = "php_version", skip_serializing_if = "Option::is_none")] + pub php_version: Option, + #[serde(rename = "os", skip_serializing_if = "Option::is_none")] + pub os: Option, + #[serde(rename = "driver", skip_serializing_if = "Option::is_none")] + pub driver: Option, +} + +impl SystemInfoData { + pub fn new() -> SystemInfoData { + SystemInfoData { + version: None, + api_version: None, + php_version: None, + os: None, + driver: None, + } + } +} + diff --git a/firefly-iii-api/src/models/tag_array.rs b/firefly-iii-api/src/models/tag_array.rs new file mode 100644 index 0000000..e8a43eb --- /dev/null +++ b/firefly-iii-api/src/models/tag_array.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TagArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl TagArray { + pub fn new(data: Vec, meta: models::Meta, links: models::PageLink) -> TagArray { + TagArray { + data, + meta: Box::new(meta), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/tag_model.rs b/firefly-iii-api/src/models/tag_model.rs new file mode 100644 index 0000000..696231e --- /dev/null +++ b/firefly-iii-api/src/models/tag_model.rs @@ -0,0 +1,53 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TagModel { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// The tag + #[serde(rename = "tag")] + pub tag: String, + /// The date to which the tag is applicable. + #[serde(rename = "date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub date: Option>, + #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub description: Option>, + /// Latitude of the tag's location, if applicable. Can be used to draw a map. + #[serde(rename = "latitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub latitude: Option>, + /// Latitude of the tag's location, if applicable. Can be used to draw a map. + #[serde(rename = "longitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub longitude: Option>, + /// Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. + #[serde(rename = "zoom_level", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub zoom_level: Option>, +} + +impl TagModel { + pub fn new(tag: String) -> TagModel { + TagModel { + created_at: None, + updated_at: None, + tag, + date: None, + description: None, + latitude: None, + longitude: None, + zoom_level: None, + } + } +} + diff --git a/firefly-iii-api/src/models/tag_model_store.rs b/firefly-iii-api/src/models/tag_model_store.rs new file mode 100644 index 0000000..c7a5666 --- /dev/null +++ b/firefly-iii-api/src/models/tag_model_store.rs @@ -0,0 +1,47 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TagModelStore { + /// The tag + #[serde(rename = "tag")] + pub tag: String, + /// The date to which the tag is applicable. + #[serde(rename = "date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub date: Option>, + #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub description: Option>, + /// Latitude of the tag's location, if applicable. Can be used to draw a map. + #[serde(rename = "latitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub latitude: Option>, + /// Latitude of the tag's location, if applicable. Can be used to draw a map. + #[serde(rename = "longitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub longitude: Option>, + /// Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. + #[serde(rename = "zoom_level", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub zoom_level: Option>, +} + +impl TagModelStore { + pub fn new(tag: String) -> TagModelStore { + TagModelStore { + tag, + date: None, + description: None, + latitude: None, + longitude: None, + zoom_level: None, + } + } +} + diff --git a/firefly-iii-api/src/models/tag_model_update.rs b/firefly-iii-api/src/models/tag_model_update.rs new file mode 100644 index 0000000..df5c148 --- /dev/null +++ b/firefly-iii-api/src/models/tag_model_update.rs @@ -0,0 +1,47 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TagModelUpdate { + /// The tag + #[serde(rename = "tag", skip_serializing_if = "Option::is_none")] + pub tag: Option, + /// The date to which the tag is applicable. + #[serde(rename = "date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub date: Option>, + #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub description: Option>, + /// Latitude of the tag's location, if applicable. Can be used to draw a map. + #[serde(rename = "latitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub latitude: Option>, + /// Latitude of the tag's location, if applicable. Can be used to draw a map. + #[serde(rename = "longitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub longitude: Option>, + /// Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. + #[serde(rename = "zoom_level", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub zoom_level: Option>, +} + +impl TagModelUpdate { + pub fn new() -> TagModelUpdate { + TagModelUpdate { + tag: None, + date: None, + description: None, + latitude: None, + longitude: None, + zoom_level: None, + } + } +} + diff --git a/firefly-iii-api/src/models/tag_read.rs b/firefly-iii-api/src/models/tag_read.rs new file mode 100644 index 0000000..b43cfb3 --- /dev/null +++ b/firefly-iii-api/src/models/tag_read.rs @@ -0,0 +1,37 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TagRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl TagRead { + pub fn new(r#type: String, id: String, attributes: models::TagModel, links: models::ObjectLink) -> TagRead { + TagRead { + r#type, + id, + attributes: Box::new(attributes), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/tag_single.rs b/firefly-iii-api/src/models/tag_single.rs new file mode 100644 index 0000000..92a9077 --- /dev/null +++ b/firefly-iii-api/src/models/tag_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TagSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl TagSingle { + pub fn new(data: models::TagRead) -> TagSingle { + TagSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/transaction.rs b/firefly-iii-api/src/models/transaction.rs new file mode 100644 index 0000000..5f145ef --- /dev/null +++ b/firefly-iii-api/src/models/transaction.rs @@ -0,0 +1,41 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Transaction { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// User ID + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option, + /// Title of the transaction if it has been split in more than one piece. Empty otherwise. + #[serde(rename = "group_title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub group_title: Option>, + #[serde(rename = "transactions")] + pub transactions: Vec, +} + +impl Transaction { + pub fn new(transactions: Vec) -> Transaction { + Transaction { + created_at: None, + updated_at: None, + user: None, + group_title: None, + transactions, + } + } +} + diff --git a/firefly-iii-api/src/models/transaction_array.rs b/firefly-iii-api/src/models/transaction_array.rs new file mode 100644 index 0000000..e408bdd --- /dev/null +++ b/firefly-iii-api/src/models/transaction_array.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl TransactionArray { + pub fn new(data: Vec, meta: models::Meta, links: models::PageLink) -> TransactionArray { + TransactionArray { + data, + meta: Box::new(meta), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/transaction_link.rs b/firefly-iii-api/src/models/transaction_link.rs new file mode 100644 index 0000000..b94ac47 --- /dev/null +++ b/firefly-iii-api/src/models/transaction_link.rs @@ -0,0 +1,50 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionLink { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// The link type ID to use. You can also use the link_type_name field. + #[serde(rename = "link_type_id")] + pub link_type_id: String, + /// The link type name to use. You can also use the link_type_id field. + #[serde(rename = "link_type_name", skip_serializing_if = "Option::is_none")] + pub link_type_name: Option, + /// The inward transaction transaction_journal_id for the link. This becomes the 'is paid by' transaction of the set. + #[serde(rename = "inward_id")] + pub inward_id: String, + /// The outward transaction transaction_journal_id for the link. This becomes the 'pays for' transaction of the set. + #[serde(rename = "outward_id")] + pub outward_id: String, + /// Optional. Some notes. + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, +} + +impl TransactionLink { + pub fn new(link_type_id: String, inward_id: String, outward_id: String) -> TransactionLink { + TransactionLink { + created_at: None, + updated_at: None, + link_type_id, + link_type_name: None, + inward_id, + outward_id, + notes: None, + } + } +} + diff --git a/firefly-iii-api/src/models/transaction_link_array.rs b/firefly-iii-api/src/models/transaction_link_array.rs new file mode 100644 index 0000000..d536c0e --- /dev/null +++ b/firefly-iii-api/src/models/transaction_link_array.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionLinkArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl TransactionLinkArray { + pub fn new(data: Vec, meta: models::Meta, links: models::PageLink) -> TransactionLinkArray { + TransactionLinkArray { + data, + meta: Box::new(meta), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/transaction_link_read.rs b/firefly-iii-api/src/models/transaction_link_read.rs new file mode 100644 index 0000000..fa09f6d --- /dev/null +++ b/firefly-iii-api/src/models/transaction_link_read.rs @@ -0,0 +1,37 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionLinkRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl TransactionLinkRead { + pub fn new(r#type: String, id: String, attributes: models::TransactionLink, links: models::ObjectLink) -> TransactionLinkRead { + TransactionLinkRead { + r#type, + id, + attributes: Box::new(attributes), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/transaction_link_single.rs b/firefly-iii-api/src/models/transaction_link_single.rs new file mode 100644 index 0000000..e1e13c3 --- /dev/null +++ b/firefly-iii-api/src/models/transaction_link_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionLinkSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl TransactionLinkSingle { + pub fn new(data: models::TransactionLinkRead) -> TransactionLinkSingle { + TransactionLinkSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/transaction_link_store.rs b/firefly-iii-api/src/models/transaction_link_store.rs new file mode 100644 index 0000000..664de5b --- /dev/null +++ b/firefly-iii-api/src/models/transaction_link_store.rs @@ -0,0 +1,44 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionLinkStore { + /// The link type ID to use. You can also use the link_type_name field. + #[serde(rename = "link_type_id")] + pub link_type_id: String, + /// The link type name to use. You can also use the link_type_id field. + #[serde(rename = "link_type_name", skip_serializing_if = "Option::is_none")] + pub link_type_name: Option, + /// The inward transaction transaction_journal_id for the link. This becomes the 'is paid by' transaction of the set. + #[serde(rename = "inward_id")] + pub inward_id: String, + /// The outward transaction transaction_journal_id for the link. This becomes the 'pays for' transaction of the set. + #[serde(rename = "outward_id")] + pub outward_id: String, + /// Optional. Some notes. + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, +} + +impl TransactionLinkStore { + pub fn new(link_type_id: String, inward_id: String, outward_id: String) -> TransactionLinkStore { + TransactionLinkStore { + link_type_id, + link_type_name: None, + inward_id, + outward_id, + notes: None, + } + } +} + diff --git a/firefly-iii-api/src/models/transaction_link_update.rs b/firefly-iii-api/src/models/transaction_link_update.rs new file mode 100644 index 0000000..fa5325e --- /dev/null +++ b/firefly-iii-api/src/models/transaction_link_update.rs @@ -0,0 +1,44 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionLinkUpdate { + /// The link type ID to use. Use this field OR use the link_type_name field. + #[serde(rename = "link_type_id", skip_serializing_if = "Option::is_none")] + pub link_type_id: Option, + /// The link type name to use. Use this field OR use the link_type_id field. + #[serde(rename = "link_type_name", skip_serializing_if = "Option::is_none")] + pub link_type_name: Option, + /// The inward transaction transaction_journal_id for the link. This becomes the 'is paid by' transaction of the set. + #[serde(rename = "inward_id", skip_serializing_if = "Option::is_none")] + pub inward_id: Option, + /// The outward transaction transaction_journal_id for the link. This becomes the 'pays for' transaction of the set. + #[serde(rename = "outward_id", skip_serializing_if = "Option::is_none")] + pub outward_id: Option, + /// Optional. Some notes. If you submit an empty string the current notes will be removed + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, +} + +impl TransactionLinkUpdate { + pub fn new() -> TransactionLinkUpdate { + TransactionLinkUpdate { + link_type_id: None, + link_type_name: None, + inward_id: None, + outward_id: None, + notes: None, + } + } +} + diff --git a/firefly-iii-api/src/models/transaction_read.rs b/firefly-iii-api/src/models/transaction_read.rs new file mode 100644 index 0000000..a91dd80 --- /dev/null +++ b/firefly-iii-api/src/models/transaction_read.rs @@ -0,0 +1,37 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl TransactionRead { + pub fn new(r#type: String, id: String, attributes: models::Transaction, links: models::ObjectLink) -> TransactionRead { + TransactionRead { + r#type, + id, + attributes: Box::new(attributes), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/transaction_single.rs b/firefly-iii-api/src/models/transaction_single.rs new file mode 100644 index 0000000..b51c1b3 --- /dev/null +++ b/firefly-iii-api/src/models/transaction_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl TransactionSingle { + pub fn new(data: models::TransactionRead) -> TransactionSingle { + TransactionSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/transaction_split.rs b/firefly-iii-api/src/models/transaction_split.rs new file mode 100644 index 0000000..a03d9d4 --- /dev/null +++ b/firefly-iii-api/src/models/transaction_split.rs @@ -0,0 +1,253 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionSplit { + /// User ID + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option, + /// 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. + #[serde(rename = "transaction_journal_id", skip_serializing_if = "Option::is_none")] + pub transaction_journal_id: Option, + #[serde(rename = "type")] + pub r#type: models::TransactionTypeProperty, + /// Date of the transaction + #[serde(rename = "date")] + pub date: String, + /// Order of this entry in the list of transactions. + #[serde(rename = "order", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub order: Option>, + /// Currency ID. Default is the source account's currency, or the user's default currency. Can be used instead of currency_code. + #[serde(rename = "currency_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub currency_id: Option>, + /// Currency code. Default is the source account's currency, or the user's default currency. Can be used instead of currency_id. + #[serde(rename = "currency_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub currency_code: Option>, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + #[serde(rename = "currency_name", skip_serializing_if = "Option::is_none")] + pub currency_name: Option, + /// Number of decimals used in this currency. + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, + /// Currency ID of the foreign currency. Default is null. Is required when you submit a foreign amount. + #[serde(rename = "foreign_currency_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_id: Option>, + /// Currency code of the foreign currency. Default is NULL. Can be used instead of the foreign_currency_id, but this or the ID is required when submitting a foreign amount. + #[serde(rename = "foreign_currency_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_code: Option>, + #[serde(rename = "foreign_currency_symbol", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_symbol: Option>, + /// Number of decimals in the currency + #[serde(rename = "foreign_currency_decimal_places", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_decimal_places: Option>, + /// Amount of the transaction. + #[serde(rename = "amount")] + pub amount: String, + /// The amount in a foreign currency. + #[serde(rename = "foreign_amount", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_amount: Option>, + /// Description of the transaction. + #[serde(rename = "description")] + pub description: String, + /// 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. + #[serde(rename = "source_id", deserialize_with = "Option::deserialize")] + pub source_id: Option, + /// 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. + #[serde(rename = "source_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub source_name: Option>, + #[serde(rename = "source_iban", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub source_iban: Option>, + #[serde(rename = "source_type", skip_serializing_if = "Option::is_none")] + pub source_type: Option, + /// 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. + #[serde(rename = "destination_id", deserialize_with = "Option::deserialize")] + pub destination_id: Option, + /// 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. + #[serde(rename = "destination_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub destination_name: Option>, + #[serde(rename = "destination_iban", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub destination_iban: Option>, + #[serde(rename = "destination_type", skip_serializing_if = "Option::is_none")] + pub destination_type: Option, + /// The budget ID for this transaction. + #[serde(rename = "budget_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub budget_id: Option>, + /// 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. + #[serde(rename = "budget_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub budget_name: Option>, + /// The category ID for this transaction. + #[serde(rename = "category_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub category_id: Option>, + /// 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. + #[serde(rename = "category_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub category_name: Option>, + /// Optional. Use either this or the bill_name + #[serde(rename = "bill_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bill_id: Option>, + /// Optional. Use either this or the bill_id + #[serde(rename = "bill_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bill_name: Option>, + /// If the transaction has been reconciled already. When you set this, the amount can no longer be edited by the user. + #[serde(rename = "reconciled", skip_serializing_if = "Option::is_none")] + pub reconciled: Option, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + /// Array of tags. + #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub tags: Option>>, + /// Reference to internal reference of other systems. + #[serde(rename = "internal_reference", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub internal_reference: Option>, + /// Reference to external ID in other systems. + #[serde(rename = "external_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub external_id: Option>, + /// External, custom URL for this transaction. + #[serde(rename = "external_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub external_url: Option>, + /// System generated identifier for original creator of transaction. + #[serde(rename = "original_source", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub original_source: Option>, + /// Reference to recurrence that made the transaction. + #[serde(rename = "recurrence_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub recurrence_id: Option>, + /// Total number of transactions expected to be created by this recurrence repetition. Will be 0 if infinite. + #[serde(rename = "recurrence_total", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub recurrence_total: Option>, + /// The # of the current transaction created under this recurrence. + #[serde(rename = "recurrence_count", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub recurrence_count: Option>, + /// Internal ID of bunq transaction. DEPRECATED + #[serde(rename = "bunq_payment_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bunq_payment_id: Option>, + /// Hash value of original import transaction (for duplicate detection). + #[serde(rename = "import_hash_v2", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub import_hash_v2: Option>, + /// SEPA Clearing Code + #[serde(rename = "sepa_cc", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_cc: Option>, + /// SEPA Opposing Account Identifier + #[serde(rename = "sepa_ct_op", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_ct_op: Option>, + /// SEPA end-to-end Identifier + #[serde(rename = "sepa_ct_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_ct_id: Option>, + /// SEPA mandate identifier + #[serde(rename = "sepa_db", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_db: Option>, + /// SEPA Country + #[serde(rename = "sepa_country", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_country: Option>, + /// SEPA External Purpose indicator + #[serde(rename = "sepa_ep", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_ep: Option>, + /// SEPA Creditor Identifier + #[serde(rename = "sepa_ci", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_ci: Option>, + /// SEPA Batch ID + #[serde(rename = "sepa_batch_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_batch_id: Option>, + #[serde(rename = "interest_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub interest_date: Option>, + #[serde(rename = "book_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub book_date: Option>, + #[serde(rename = "process_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub process_date: Option>, + #[serde(rename = "due_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub due_date: Option>, + #[serde(rename = "payment_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub payment_date: Option>, + #[serde(rename = "invoice_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub invoice_date: Option>, + /// Latitude of the transaction's location, if applicable. Can be used to draw a map. + #[serde(rename = "latitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub latitude: Option>, + /// Latitude of the transaction's location, if applicable. Can be used to draw a map. + #[serde(rename = "longitude", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub longitude: Option>, + /// Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. + #[serde(rename = "zoom_level", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub zoom_level: Option>, + /// If the transaction has attachments. + #[serde(rename = "has_attachments", skip_serializing_if = "Option::is_none")] + pub has_attachments: Option, +} + +impl TransactionSplit { + pub fn new(r#type: models::TransactionTypeProperty, date: String, amount: String, description: String, source_id: Option, destination_id: Option) -> TransactionSplit { + TransactionSplit { + user: None, + transaction_journal_id: None, + r#type, + date, + order: None, + currency_id: None, + currency_code: None, + currency_symbol: None, + currency_name: None, + currency_decimal_places: None, + foreign_currency_id: None, + foreign_currency_code: None, + foreign_currency_symbol: None, + foreign_currency_decimal_places: None, + amount, + foreign_amount: None, + description, + source_id, + source_name: None, + source_iban: None, + source_type: None, + destination_id, + destination_name: None, + destination_iban: None, + destination_type: None, + budget_id: None, + budget_name: None, + category_id: None, + category_name: None, + bill_id: None, + bill_name: None, + reconciled: None, + notes: None, + tags: None, + internal_reference: None, + external_id: None, + external_url: None, + original_source: None, + recurrence_id: None, + recurrence_total: None, + recurrence_count: None, + bunq_payment_id: None, + import_hash_v2: None, + sepa_cc: None, + sepa_ct_op: None, + sepa_ct_id: None, + sepa_db: None, + sepa_country: None, + sepa_ep: None, + sepa_ci: None, + sepa_batch_id: None, + interest_date: None, + book_date: None, + process_date: None, + due_date: None, + payment_date: None, + invoice_date: None, + latitude: None, + longitude: None, + zoom_level: None, + has_attachments: None, + } + } +} + diff --git a/firefly-iii-api/src/models/transaction_split_store.rs b/firefly-iii-api/src/models/transaction_split_store.rs new file mode 100644 index 0000000..e56687a --- /dev/null +++ b/firefly-iii-api/src/models/transaction_split_store.rs @@ -0,0 +1,188 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionSplitStore { + #[serde(rename = "type")] + pub r#type: models::TransactionTypeProperty, + /// Date of the transaction + #[serde(rename = "date")] + pub date: String, + /// Amount of the transaction. + #[serde(rename = "amount")] + pub amount: String, + /// Description of the transaction. + #[serde(rename = "description")] + pub description: String, + /// Order of this entry in the list of transactions. + #[serde(rename = "order", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub order: Option>, + /// Currency ID. Default is the source account's currency, or the user's default currency. The value you submit may be overruled by the source or destination account. + #[serde(rename = "currency_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub currency_id: Option>, + /// Currency code. Default is the source account's currency, or the user's default currency. The value you submit may be overruled by the source or destination account. + #[serde(rename = "currency_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub currency_code: Option>, + /// The amount in a foreign currency. + #[serde(rename = "foreign_amount", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_amount: Option>, + /// Currency ID of the foreign currency. Default is null. Is required when you submit a foreign amount. + #[serde(rename = "foreign_currency_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_id: Option>, + /// Currency code of the foreign currency. Default is NULL. Can be used instead of the foreign_currency_id, but this or the ID is required when submitting a foreign amount. + #[serde(rename = "foreign_currency_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_code: Option>, + /// The budget ID for this transaction. + #[serde(rename = "budget_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub budget_id: Option>, + /// 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. + #[serde(rename = "budget_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub budget_name: Option>, + /// The category ID for this transaction. + #[serde(rename = "category_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub category_id: Option>, + /// 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. + #[serde(rename = "category_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub category_name: Option>, + /// 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. + #[serde(rename = "source_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub source_id: Option>, + /// 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. + #[serde(rename = "source_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub source_name: Option>, + /// 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. + #[serde(rename = "destination_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub destination_id: Option>, + /// 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. + #[serde(rename = "destination_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub destination_name: Option>, + /// If the transaction has been reconciled already. When you set this, the amount can no longer be edited by the user. + #[serde(rename = "reconciled", skip_serializing_if = "Option::is_none")] + pub reconciled: Option, + /// Optional. Use either this or the piggy_bank_name + #[serde(rename = "piggy_bank_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub piggy_bank_id: Option>, + /// Optional. Use either this or the piggy_bank_id + #[serde(rename = "piggy_bank_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub piggy_bank_name: Option>, + /// Optional. Use either this or the bill_name + #[serde(rename = "bill_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bill_id: Option>, + /// Optional. Use either this or the bill_id + #[serde(rename = "bill_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bill_name: Option>, + /// Array of tags. + #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub tags: Option>>, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + /// Reference to internal reference of other systems. + #[serde(rename = "internal_reference", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub internal_reference: Option>, + /// Reference to external ID in other systems. + #[serde(rename = "external_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub external_id: Option>, + /// External, custom URL for this transaction. + #[serde(rename = "external_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub external_url: Option>, + /// Internal ID of bunq transaction. Field is no longer used but still works. + #[serde(rename = "bunq_payment_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bunq_payment_id: Option>, + /// SEPA Clearing Code + #[serde(rename = "sepa_cc", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_cc: Option>, + /// SEPA Opposing Account Identifier + #[serde(rename = "sepa_ct_op", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_ct_op: Option>, + /// SEPA end-to-end Identifier + #[serde(rename = "sepa_ct_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_ct_id: Option>, + /// SEPA mandate identifier + #[serde(rename = "sepa_db", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_db: Option>, + /// SEPA Country + #[serde(rename = "sepa_country", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_country: Option>, + /// SEPA External Purpose indicator + #[serde(rename = "sepa_ep", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_ep: Option>, + /// SEPA Creditor Identifier + #[serde(rename = "sepa_ci", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_ci: Option>, + /// SEPA Batch ID + #[serde(rename = "sepa_batch_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_batch_id: Option>, + #[serde(rename = "interest_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub interest_date: Option>, + #[serde(rename = "book_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub book_date: Option>, + #[serde(rename = "process_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub process_date: Option>, + #[serde(rename = "due_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub due_date: Option>, + #[serde(rename = "payment_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub payment_date: Option>, + #[serde(rename = "invoice_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub invoice_date: Option>, +} + +impl TransactionSplitStore { + pub fn new(r#type: models::TransactionTypeProperty, date: String, amount: String, description: String) -> TransactionSplitStore { + TransactionSplitStore { + r#type, + date, + amount, + description, + order: None, + currency_id: None, + currency_code: None, + foreign_amount: None, + foreign_currency_id: None, + foreign_currency_code: None, + budget_id: None, + budget_name: None, + category_id: None, + category_name: None, + source_id: None, + source_name: None, + destination_id: None, + destination_name: None, + reconciled: None, + piggy_bank_id: None, + piggy_bank_name: None, + bill_id: None, + bill_name: None, + tags: None, + notes: None, + internal_reference: None, + external_id: None, + external_url: None, + bunq_payment_id: None, + sepa_cc: None, + sepa_ct_op: None, + sepa_ct_id: None, + sepa_db: None, + sepa_country: None, + sepa_ep: None, + sepa_ci: None, + sepa_batch_id: None, + interest_date: None, + book_date: None, + process_date: None, + due_date: None, + payment_date: None, + invoice_date: None, + } + } +} + diff --git a/firefly-iii-api/src/models/transaction_split_update.rs b/firefly-iii-api/src/models/transaction_split_update.rs new file mode 100644 index 0000000..36893a3 --- /dev/null +++ b/firefly-iii-api/src/models/transaction_split_update.rs @@ -0,0 +1,207 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionSplitUpdate { + /// Transaction journal ID of current transaction (split). + #[serde(rename = "transaction_journal_id", skip_serializing_if = "Option::is_none")] + pub transaction_journal_id: Option, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + /// Date of the transaction + #[serde(rename = "date", skip_serializing_if = "Option::is_none")] + pub date: Option, + /// Amount of the transaction. + #[serde(rename = "amount", skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Description of the transaction. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Order of this entry in the list of transactions. + #[serde(rename = "order", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub order: Option>, + /// Currency ID. Default is the source account's currency, or the user's default currency. Can be used instead of currency_code. + #[serde(rename = "currency_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub currency_id: Option>, + /// Currency code. Default is the source account's currency, or the user's default currency. Can be used instead of currency_id. + #[serde(rename = "currency_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub currency_code: Option>, + #[serde(rename = "currency_symbol", skip_serializing_if = "Option::is_none")] + pub currency_symbol: Option, + #[serde(rename = "currency_name", skip_serializing_if = "Option::is_none")] + pub currency_name: Option, + /// Number of decimals used in this currency. + #[serde(rename = "currency_decimal_places", skip_serializing_if = "Option::is_none")] + pub currency_decimal_places: Option, + /// The amount in a foreign currency. + #[serde(rename = "foreign_amount", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_amount: Option>, + /// Currency ID of the foreign currency. Default is null. Is required when you submit a foreign amount. + #[serde(rename = "foreign_currency_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_id: Option>, + /// Currency code of the foreign currency. Default is NULL. Can be used instead of the foreign_currency_id, but this or the ID is required when submitting a foreign amount. + #[serde(rename = "foreign_currency_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_code: Option>, + #[serde(rename = "foreign_currency_symbol", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_symbol: Option>, + /// Number of decimals in the currency + #[serde(rename = "foreign_currency_decimal_places", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub foreign_currency_decimal_places: Option>, + /// The budget ID for this transaction. + #[serde(rename = "budget_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub budget_id: Option>, + /// 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. + #[serde(rename = "budget_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub budget_name: Option>, + /// The category ID for this transaction. + #[serde(rename = "category_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub category_id: Option>, + /// 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. + #[serde(rename = "category_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub category_name: Option>, + /// 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. + #[serde(rename = "source_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub source_id: Option>, + /// 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. + #[serde(rename = "source_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub source_name: Option>, + #[serde(rename = "source_iban", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub source_iban: Option>, + /// 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. + #[serde(rename = "destination_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub destination_id: Option>, + /// 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. + #[serde(rename = "destination_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub destination_name: Option>, + #[serde(rename = "destination_iban", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub destination_iban: Option>, + /// If the transaction has been reconciled already. When you set this, the amount can no longer be edited by the user. + #[serde(rename = "reconciled", skip_serializing_if = "Option::is_none")] + pub reconciled: Option, + /// Optional. Use either this or the bill_name + #[serde(rename = "bill_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bill_id: Option>, + /// Optional. Use either this or the bill_id + #[serde(rename = "bill_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bill_name: Option>, + /// Array of tags. + #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub tags: Option>>, + #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub notes: Option>, + /// Reference to internal reference of other systems. + #[serde(rename = "internal_reference", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub internal_reference: Option>, + /// Reference to external ID in other systems. + #[serde(rename = "external_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub external_id: Option>, + /// External, custom URL for this transaction. + #[serde(rename = "external_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub external_url: Option>, + /// Internal ID of bunq transaction. + #[serde(rename = "bunq_payment_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub bunq_payment_id: Option>, + /// SEPA Clearing Code + #[serde(rename = "sepa_cc", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_cc: Option>, + /// SEPA Opposing Account Identifier + #[serde(rename = "sepa_ct_op", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_ct_op: Option>, + /// SEPA end-to-end Identifier + #[serde(rename = "sepa_ct_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_ct_id: Option>, + /// SEPA mandate identifier + #[serde(rename = "sepa_db", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_db: Option>, + /// SEPA Country + #[serde(rename = "sepa_country", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_country: Option>, + /// SEPA External Purpose indicator + #[serde(rename = "sepa_ep", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_ep: Option>, + /// SEPA Creditor Identifier + #[serde(rename = "sepa_ci", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_ci: Option>, + /// SEPA Batch ID + #[serde(rename = "sepa_batch_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sepa_batch_id: Option>, + #[serde(rename = "interest_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub interest_date: Option>, + #[serde(rename = "book_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub book_date: Option>, + #[serde(rename = "process_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub process_date: Option>, + #[serde(rename = "due_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub due_date: Option>, + #[serde(rename = "payment_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub payment_date: Option>, + #[serde(rename = "invoice_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub invoice_date: Option>, +} + +impl TransactionSplitUpdate { + pub fn new() -> TransactionSplitUpdate { + TransactionSplitUpdate { + transaction_journal_id: None, + r#type: None, + date: None, + amount: None, + description: None, + order: None, + currency_id: None, + currency_code: None, + currency_symbol: None, + currency_name: None, + currency_decimal_places: None, + foreign_amount: None, + foreign_currency_id: None, + foreign_currency_code: None, + foreign_currency_symbol: None, + foreign_currency_decimal_places: None, + budget_id: None, + budget_name: None, + category_id: None, + category_name: None, + source_id: None, + source_name: None, + source_iban: None, + destination_id: None, + destination_name: None, + destination_iban: None, + reconciled: None, + bill_id: None, + bill_name: None, + tags: None, + notes: None, + internal_reference: None, + external_id: None, + external_url: None, + bunq_payment_id: None, + sepa_cc: None, + sepa_ct_op: None, + sepa_ct_id: None, + sepa_db: None, + sepa_country: None, + sepa_ep: None, + sepa_ci: None, + sepa_batch_id: None, + interest_date: None, + book_date: None, + process_date: None, + due_date: None, + payment_date: None, + invoice_date: None, + } + } +} + diff --git a/firefly-iii-api/src/models/transaction_store.rs b/firefly-iii-api/src/models/transaction_store.rs new file mode 100644 index 0000000..747e5ab --- /dev/null +++ b/firefly-iii-api/src/models/transaction_store.rs @@ -0,0 +1,43 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionStore { + /// Break if the submitted transaction exists already. + #[serde(rename = "error_if_duplicate_hash", skip_serializing_if = "Option::is_none")] + pub error_if_duplicate_hash: Option, + /// Whether or not to apply rules when submitting transaction. + #[serde(rename = "apply_rules", skip_serializing_if = "Option::is_none")] + pub apply_rules: Option, + /// Whether or not to fire the webhooks that are related to this event. + #[serde(rename = "fire_webhooks", skip_serializing_if = "Option::is_none")] + pub fire_webhooks: Option, + /// Title of the transaction if it has been split in more than one piece. Empty otherwise. + #[serde(rename = "group_title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub group_title: Option>, + #[serde(rename = "transactions")] + pub transactions: Vec, +} + +impl TransactionStore { + pub fn new(transactions: Vec) -> TransactionStore { + TransactionStore { + error_if_duplicate_hash: None, + apply_rules: None, + fire_webhooks: None, + group_title: None, + transactions, + } + } +} + diff --git a/firefly-iii-api/src/models/transaction_type_filter.rs b/firefly-iii-api/src/models/transaction_type_filter.rs new file mode 100644 index 0000000..2c37ed6 --- /dev/null +++ b/firefly-iii-api/src/models/transaction_type_filter.rs @@ -0,0 +1,74 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum TransactionTypeFilter { + #[serde(rename = "all")] + All, + #[serde(rename = "withdrawal")] + Withdrawal, + #[serde(rename = "withdrawals")] + Withdrawals, + #[serde(rename = "expense")] + Expense, + #[serde(rename = "deposit")] + Deposit, + #[serde(rename = "deposits")] + Deposits, + #[serde(rename = "income")] + Income, + #[serde(rename = "transfer")] + Transfer, + #[serde(rename = "transfers")] + Transfers, + #[serde(rename = "opening_balance")] + OpeningBalance, + #[serde(rename = "reconciliation")] + Reconciliation, + #[serde(rename = "special")] + Special, + #[serde(rename = "specials")] + Specials, + #[serde(rename = "default")] + Default, + +} + +impl std::fmt::Display for TransactionTypeFilter { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::All => write!(f, "all"), + Self::Withdrawal => write!(f, "withdrawal"), + Self::Withdrawals => write!(f, "withdrawals"), + Self::Expense => write!(f, "expense"), + Self::Deposit => write!(f, "deposit"), + Self::Deposits => write!(f, "deposits"), + Self::Income => write!(f, "income"), + Self::Transfer => write!(f, "transfer"), + Self::Transfers => write!(f, "transfers"), + Self::OpeningBalance => write!(f, "opening_balance"), + Self::Reconciliation => write!(f, "reconciliation"), + Self::Special => write!(f, "special"), + Self::Specials => write!(f, "specials"), + Self::Default => write!(f, "default"), + } + } +} + +impl Default for TransactionTypeFilter { + fn default() -> TransactionTypeFilter { + Self::All + } +} + diff --git a/firefly-iii-api/src/models/transaction_type_property.rs b/firefly-iii-api/src/models/transaction_type_property.rs new file mode 100644 index 0000000..857b192 --- /dev/null +++ b/firefly-iii-api/src/models/transaction_type_property.rs @@ -0,0 +1,47 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum TransactionTypeProperty { + #[serde(rename = "withdrawal")] + Withdrawal, + #[serde(rename = "deposit")] + Deposit, + #[serde(rename = "transfer")] + Transfer, + #[serde(rename = "reconciliation")] + Reconciliation, + #[serde(rename = "opening balance")] + OpeningBalance, + +} + +impl std::fmt::Display for TransactionTypeProperty { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Withdrawal => write!(f, "withdrawal"), + Self::Deposit => write!(f, "deposit"), + Self::Transfer => write!(f, "transfer"), + Self::Reconciliation => write!(f, "reconciliation"), + Self::OpeningBalance => write!(f, "opening balance"), + } + } +} + +impl Default for TransactionTypeProperty { + fn default() -> TransactionTypeProperty { + Self::Withdrawal + } +} + diff --git a/firefly-iii-api/src/models/transaction_update.rs b/firefly-iii-api/src/models/transaction_update.rs new file mode 100644 index 0000000..3c566f7 --- /dev/null +++ b/firefly-iii-api/src/models/transaction_update.rs @@ -0,0 +1,39 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionUpdate { + /// Whether or not to apply rules when submitting transaction. + #[serde(rename = "apply_rules", skip_serializing_if = "Option::is_none")] + pub apply_rules: Option, + /// Whether or not to fire the webhooks that are related to this event. + #[serde(rename = "fire_webhooks", skip_serializing_if = "Option::is_none")] + pub fire_webhooks: Option, + /// Title of the transaction if it has been split in more than one piece. Empty otherwise. + #[serde(rename = "group_title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub group_title: Option>, + #[serde(rename = "transactions", skip_serializing_if = "Option::is_none")] + pub transactions: Option>, +} + +impl TransactionUpdate { + pub fn new() -> TransactionUpdate { + TransactionUpdate { + apply_rules: None, + fire_webhooks: None, + group_title: None, + transactions: None, + } + } +} + diff --git a/firefly-iii-api/src/models/unauthenticated_response.rs b/firefly-iii-api/src/models/unauthenticated_response.rs new file mode 100644 index 0000000..9a4ed32 --- /dev/null +++ b/firefly-iii-api/src/models/unauthenticated_response.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UnauthenticatedResponse { + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(rename = "exception", skip_serializing_if = "Option::is_none")] + pub exception: Option, +} + +impl UnauthenticatedResponse { + pub fn new() -> UnauthenticatedResponse { + UnauthenticatedResponse { + message: None, + exception: None, + } + } +} + diff --git a/firefly-iii-api/src/models/user.rs b/firefly-iii-api/src/models/user.rs new file mode 100644 index 0000000..5c3c4f9 --- /dev/null +++ b/firefly-iii-api/src/models/user.rs @@ -0,0 +1,44 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct User { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// The new users email address. + #[serde(rename = "email")] + pub email: String, + /// Boolean to indicate if the user is blocked. + #[serde(rename = "blocked", skip_serializing_if = "Option::is_none")] + pub blocked: Option, + #[serde(rename = "blocked_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub blocked_code: Option>, + #[serde(rename = "role", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub role: Option>, +} + +impl User { + pub fn new(email: String) -> User { + User { + created_at: None, + updated_at: None, + email, + blocked: None, + blocked_code: None, + role: None, + } + } +} + diff --git a/firefly-iii-api/src/models/user_array.rs b/firefly-iii-api/src/models/user_array.rs new file mode 100644 index 0000000..3cf9a65 --- /dev/null +++ b/firefly-iii-api/src/models/user_array.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl UserArray { + pub fn new(data: Vec, meta: models::Meta, links: models::PageLink) -> UserArray { + UserArray { + data, + meta: Box::new(meta), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/user_blocked_code_property.rs b/firefly-iii-api/src/models/user_blocked_code_property.rs new file mode 100644 index 0000000..05e6198 --- /dev/null +++ b/firefly-iii-api/src/models/user_blocked_code_property.rs @@ -0,0 +1,39 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// UserBlockedCodeProperty : If you say the user must be blocked, this will be the reason code. +/// If you say the user must be blocked, this will be the reason code. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UserBlockedCodeProperty { + #[serde(rename = "email_changed")] + EmailChanged, + #[serde(rename = "null")] + Null, + +} + +impl std::fmt::Display for UserBlockedCodeProperty { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::EmailChanged => write!(f, "email_changed"), + Self::Null => write!(f, "null"), + } + } +} + +impl Default for UserBlockedCodeProperty { + fn default() -> UserBlockedCodeProperty { + Self::EmailChanged + } +} + diff --git a/firefly-iii-api/src/models/user_read.rs b/firefly-iii-api/src/models/user_read.rs new file mode 100644 index 0000000..ae8bb18 --- /dev/null +++ b/firefly-iii-api/src/models/user_read.rs @@ -0,0 +1,37 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl UserRead { + pub fn new(r#type: String, id: String, attributes: models::User, links: models::ObjectLink) -> UserRead { + UserRead { + r#type, + id, + attributes: Box::new(attributes), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/user_role_property.rs b/firefly-iii-api/src/models/user_role_property.rs new file mode 100644 index 0000000..e966929 --- /dev/null +++ b/firefly-iii-api/src/models/user_role_property.rs @@ -0,0 +1,42 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// UserRoleProperty : Role for the user. Can be empty or omitted. +/// Role for the user. Can be empty or omitted. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UserRoleProperty { + #[serde(rename = "owner")] + Owner, + #[serde(rename = "demo")] + Demo, + #[serde(rename = "null")] + Null, + +} + +impl std::fmt::Display for UserRoleProperty { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Owner => write!(f, "owner"), + Self::Demo => write!(f, "demo"), + Self::Null => write!(f, "null"), + } + } +} + +impl Default for UserRoleProperty { + fn default() -> UserRoleProperty { + Self::Owner + } +} + diff --git a/firefly-iii-api/src/models/user_single.rs b/firefly-iii-api/src/models/user_single.rs new file mode 100644 index 0000000..794ac42 --- /dev/null +++ b/firefly-iii-api/src/models/user_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl UserSingle { + pub fn new(data: models::UserRead) -> UserSingle { + UserSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/validation_error_response.rs b/firefly-iii-api/src/models/validation_error_response.rs new file mode 100644 index 0000000..411c18d --- /dev/null +++ b/firefly-iii-api/src/models/validation_error_response.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ValidationErrorResponse { + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(rename = "errors", skip_serializing_if = "Option::is_none")] + pub errors: Option>, +} + +impl ValidationErrorResponse { + pub fn new() -> ValidationErrorResponse { + ValidationErrorResponse { + message: None, + errors: None, + } + } +} + diff --git a/firefly-iii-api/src/models/validation_error_response_errors.rs b/firefly-iii-api/src/models/validation_error_response_errors.rs new file mode 100644 index 0000000..af4d8c6 --- /dev/null +++ b/firefly-iii-api/src/models/validation_error_response_errors.rs @@ -0,0 +1,54 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ValidationErrorResponseErrors { + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option>, + #[serde(rename = "blocked", skip_serializing_if = "Option::is_none")] + pub blocked: Option>, + #[serde(rename = "role", skip_serializing_if = "Option::is_none")] + pub role: Option>, + #[serde(rename = "blocked_code", skip_serializing_if = "Option::is_none")] + pub blocked_code: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option>, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option>, + #[serde(rename = "iban", skip_serializing_if = "Option::is_none")] + pub iban: Option>, + #[serde(rename = "start", skip_serializing_if = "Option::is_none")] + pub start: Option>, + #[serde(rename = "end", skip_serializing_if = "Option::is_none")] + pub end: Option>, + #[serde(rename = "date", skip_serializing_if = "Option::is_none")] + pub date: Option>, +} + +impl ValidationErrorResponseErrors { + pub fn new() -> ValidationErrorResponseErrors { + ValidationErrorResponseErrors { + email: None, + blocked: None, + role: None, + blocked_code: None, + name: None, + r#type: None, + iban: None, + start: None, + end: None, + date: None, + } + } +} + diff --git a/firefly-iii-api/src/models/webhook.rs b/firefly-iii-api/src/models/webhook.rs new file mode 100644 index 0000000..726a1d9 --- /dev/null +++ b/firefly-iii-api/src/models/webhook.rs @@ -0,0 +1,55 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Webhook { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// Boolean to indicate if the webhook is active + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// A title for the webhook for easy recognition. + #[serde(rename = "title")] + pub title: String, + /// A 24-character secret for the webhook. It's generated by Firefly III when saving a new webhook. If you submit a new secret through the PUT endpoint it will generate a new secret for the selected webhook, a new secret bearing no relation to whatever you just submitted. + #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] + pub secret: Option, + #[serde(rename = "trigger")] + pub trigger: models::WebhookTrigger, + #[serde(rename = "response")] + pub response: models::WebhookResponse, + #[serde(rename = "delivery")] + pub delivery: models::WebhookDelivery, + /// The URL of the webhook. Has to start with `https`. + #[serde(rename = "url")] + pub url: String, +} + +impl Webhook { + pub fn new(title: String, trigger: models::WebhookTrigger, response: models::WebhookResponse, delivery: models::WebhookDelivery, url: String) -> Webhook { + Webhook { + created_at: None, + updated_at: None, + active: None, + title, + secret: None, + trigger, + response, + delivery, + url, + } + } +} + diff --git a/firefly-iii-api/src/models/webhook_array.rs b/firefly-iii-api/src/models/webhook_array.rs new file mode 100644 index 0000000..20b4715 --- /dev/null +++ b/firefly-iii-api/src/models/webhook_array.rs @@ -0,0 +1,33 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl WebhookArray { + pub fn new(data: Vec, meta: models::Meta, links: models::PageLink) -> WebhookArray { + WebhookArray { + data, + meta: Box::new(meta), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/webhook_attempt.rs b/firefly-iii-api/src/models/webhook_attempt.rs new file mode 100644 index 0000000..99b4777 --- /dev/null +++ b/firefly-iii-api/src/models/webhook_attempt.rs @@ -0,0 +1,46 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookAttempt { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// The ID of the webhook message this attempt belongs to. + #[serde(rename = "webhook_message_id", skip_serializing_if = "Option::is_none")] + pub webhook_message_id: Option, + /// The HTTP status code of the error, if any. + #[serde(rename = "status_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub status_code: Option>, + /// Internal log for this attempt. May contain sensitive user data. + #[serde(rename = "logs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub logs: Option>, + /// Webhook receiver response for this attempt, if any. May contain sensitive user data. + #[serde(rename = "response", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub response: Option>, +} + +impl WebhookAttempt { + pub fn new() -> WebhookAttempt { + WebhookAttempt { + created_at: None, + updated_at: None, + webhook_message_id: None, + status_code: None, + logs: None, + response: None, + } + } +} + diff --git a/firefly-iii-api/src/models/webhook_attempt_array.rs b/firefly-iii-api/src/models/webhook_attempt_array.rs new file mode 100644 index 0000000..ef8c15a --- /dev/null +++ b/firefly-iii-api/src/models/webhook_attempt_array.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookAttemptArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, +} + +impl WebhookAttemptArray { + pub fn new(data: Vec, meta: models::Meta) -> WebhookAttemptArray { + WebhookAttemptArray { + data, + meta: Box::new(meta), + } + } +} + diff --git a/firefly-iii-api/src/models/webhook_attempt_read.rs b/firefly-iii-api/src/models/webhook_attempt_read.rs new file mode 100644 index 0000000..82e2b19 --- /dev/null +++ b/firefly-iii-api/src/models/webhook_attempt_read.rs @@ -0,0 +1,34 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookAttemptRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, +} + +impl WebhookAttemptRead { + pub fn new(r#type: String, id: String, attributes: models::WebhookAttempt) -> WebhookAttemptRead { + WebhookAttemptRead { + r#type, + id, + attributes: Box::new(attributes), + } + } +} + diff --git a/firefly-iii-api/src/models/webhook_attempt_single.rs b/firefly-iii-api/src/models/webhook_attempt_single.rs new file mode 100644 index 0000000..7e133ae --- /dev/null +++ b/firefly-iii-api/src/models/webhook_attempt_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookAttemptSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl WebhookAttemptSingle { + pub fn new(data: models::WebhookAttemptRead) -> WebhookAttemptSingle { + WebhookAttemptSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/webhook_delivery.rs b/firefly-iii-api/src/models/webhook_delivery.rs new file mode 100644 index 0000000..2219f63 --- /dev/null +++ b/firefly-iii-api/src/models/webhook_delivery.rs @@ -0,0 +1,36 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// WebhookDelivery : Format of the delivered response. +/// Format of the delivered response. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum WebhookDelivery { + #[serde(rename = "JSON")] + Json, + +} + +impl std::fmt::Display for WebhookDelivery { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Json => write!(f, "JSON"), + } + } +} + +impl Default for WebhookDelivery { + fn default() -> WebhookDelivery { + Self::Json + } +} + diff --git a/firefly-iii-api/src/models/webhook_message.rs b/firefly-iii-api/src/models/webhook_message.rs new file mode 100644 index 0000000..f053023 --- /dev/null +++ b/firefly-iii-api/src/models/webhook_message.rs @@ -0,0 +1,50 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookMessage { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + /// If this message is sent yet. + #[serde(rename = "sent", skip_serializing_if = "Option::is_none")] + pub sent: Option, + /// If this message has errored out. + #[serde(rename = "errored", skip_serializing_if = "Option::is_none")] + pub errored: Option, + /// The ID of the webhook this message belongs to. + #[serde(rename = "webhook_id", skip_serializing_if = "Option::is_none")] + pub webhook_id: Option, + /// Long UUID string for identification of this webhook message. + #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")] + pub uuid: Option, + /// The actual message that is sent or will be sent as JSON string. + #[serde(rename = "message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub message: Option>, +} + +impl WebhookMessage { + pub fn new() -> WebhookMessage { + WebhookMessage { + created_at: None, + updated_at: None, + sent: None, + errored: None, + webhook_id: None, + uuid: None, + message: None, + } + } +} + diff --git a/firefly-iii-api/src/models/webhook_message_array.rs b/firefly-iii-api/src/models/webhook_message_array.rs new file mode 100644 index 0000000..94e1715 --- /dev/null +++ b/firefly-iii-api/src/models/webhook_message_array.rs @@ -0,0 +1,30 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookMessageArray { + #[serde(rename = "data")] + pub data: Vec, + #[serde(rename = "meta")] + pub meta: Box, +} + +impl WebhookMessageArray { + pub fn new(data: Vec, meta: models::Meta) -> WebhookMessageArray { + WebhookMessageArray { + data, + meta: Box::new(meta), + } + } +} + diff --git a/firefly-iii-api/src/models/webhook_message_read.rs b/firefly-iii-api/src/models/webhook_message_read.rs new file mode 100644 index 0000000..17718b7 --- /dev/null +++ b/firefly-iii-api/src/models/webhook_message_read.rs @@ -0,0 +1,34 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookMessageRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, +} + +impl WebhookMessageRead { + pub fn new(r#type: String, id: String, attributes: models::WebhookMessage) -> WebhookMessageRead { + WebhookMessageRead { + r#type, + id, + attributes: Box::new(attributes), + } + } +} + diff --git a/firefly-iii-api/src/models/webhook_message_single.rs b/firefly-iii-api/src/models/webhook_message_single.rs new file mode 100644 index 0000000..184fa81 --- /dev/null +++ b/firefly-iii-api/src/models/webhook_message_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookMessageSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl WebhookMessageSingle { + pub fn new(data: models::WebhookMessageRead) -> WebhookMessageSingle { + WebhookMessageSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/webhook_read.rs b/firefly-iii-api/src/models/webhook_read.rs new file mode 100644 index 0000000..4ceac2c --- /dev/null +++ b/firefly-iii-api/src/models/webhook_read.rs @@ -0,0 +1,37 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookRead { + /// Immutable value + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "attributes")] + pub attributes: Box, + #[serde(rename = "links")] + pub links: Box, +} + +impl WebhookRead { + pub fn new(r#type: String, id: String, attributes: models::Webhook, links: models::ObjectLink) -> WebhookRead { + WebhookRead { + r#type, + id, + attributes: Box::new(attributes), + links: Box::new(links), + } + } +} + diff --git a/firefly-iii-api/src/models/webhook_response.rs b/firefly-iii-api/src/models/webhook_response.rs new file mode 100644 index 0000000..830e2e6 --- /dev/null +++ b/firefly-iii-api/src/models/webhook_response.rs @@ -0,0 +1,42 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// WebhookResponse : Indicator for what Firefly III will deliver to the webhook URL. +/// Indicator for what Firefly III will deliver to the webhook URL. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum WebhookResponse { + #[serde(rename = "TRANSACTIONS")] + Transactions, + #[serde(rename = "ACCOUNTS")] + Accounts, + #[serde(rename = "NONE")] + None, + +} + +impl std::fmt::Display for WebhookResponse { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Transactions => write!(f, "TRANSACTIONS"), + Self::Accounts => write!(f, "ACCOUNTS"), + Self::None => write!(f, "NONE"), + } + } +} + +impl Default for WebhookResponse { + fn default() -> WebhookResponse { + Self::Transactions + } +} + diff --git a/firefly-iii-api/src/models/webhook_single.rs b/firefly-iii-api/src/models/webhook_single.rs new file mode 100644 index 0000000..2431b0f --- /dev/null +++ b/firefly-iii-api/src/models/webhook_single.rs @@ -0,0 +1,27 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookSingle { + #[serde(rename = "data")] + pub data: Box, +} + +impl WebhookSingle { + pub fn new(data: models::WebhookRead) -> WebhookSingle { + WebhookSingle { + data: Box::new(data), + } + } +} + diff --git a/firefly-iii-api/src/models/webhook_store.rs b/firefly-iii-api/src/models/webhook_store.rs new file mode 100644 index 0000000..3d82289 --- /dev/null +++ b/firefly-iii-api/src/models/webhook_store.rs @@ -0,0 +1,45 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookStore { + /// Boolean to indicate if the webhook is active + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// A title for the webhook for easy recognition. + #[serde(rename = "title")] + pub title: String, + #[serde(rename = "trigger")] + pub trigger: models::WebhookTrigger, + #[serde(rename = "response")] + pub response: models::WebhookResponse, + #[serde(rename = "delivery")] + pub delivery: models::WebhookDelivery, + /// The URL of the webhook. Has to start with `https`. + #[serde(rename = "url")] + pub url: String, +} + +impl WebhookStore { + pub fn new(title: String, trigger: models::WebhookTrigger, response: models::WebhookResponse, delivery: models::WebhookDelivery, url: String) -> WebhookStore { + WebhookStore { + active: None, + title, + trigger, + response, + delivery, + url, + } + } +} + diff --git a/firefly-iii-api/src/models/webhook_trigger.rs b/firefly-iii-api/src/models/webhook_trigger.rs new file mode 100644 index 0000000..7ee9de7 --- /dev/null +++ b/firefly-iii-api/src/models/webhook_trigger.rs @@ -0,0 +1,42 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// WebhookTrigger : The trigger for the webhook. +/// The trigger for the webhook. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum WebhookTrigger { + #[serde(rename = "STORE_TRANSACTION")] + StoreTransaction, + #[serde(rename = "UPDATE_TRANSACTION")] + UpdateTransaction, + #[serde(rename = "DESTROY_TRANSACTION")] + DestroyTransaction, + +} + +impl std::fmt::Display for WebhookTrigger { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::StoreTransaction => write!(f, "STORE_TRANSACTION"), + Self::UpdateTransaction => write!(f, "UPDATE_TRANSACTION"), + Self::DestroyTransaction => write!(f, "DESTROY_TRANSACTION"), + } + } +} + +impl Default for WebhookTrigger { + fn default() -> WebhookTrigger { + Self::StoreTransaction + } +} + diff --git a/firefly-iii-api/src/models/webhook_update.rs b/firefly-iii-api/src/models/webhook_update.rs new file mode 100644 index 0000000..5486bf4 --- /dev/null +++ b/firefly-iii-api/src/models/webhook_update.rs @@ -0,0 +1,49 @@ +/* + * Firefly III API v2.1.0 + * + * This is the 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. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-09-10T05:07:57+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. + * + * The version of the OpenAPI document: 2.1.0 + * Contact: james@firefly-iii.org + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebhookUpdate { + /// Boolean to indicate if the webhook is active + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// A title for the webhook for easy recognition. + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + /// A 24-character secret for the webhook. It's generated by Firefly III when saving a new webhook. If you submit a new secret through the PUT endpoint it will generate a new secret for the selected webhook, a new secret bearing no relation to whatever you just submitted. + #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] + pub secret: Option, + #[serde(rename = "trigger", skip_serializing_if = "Option::is_none")] + pub trigger: Option, + #[serde(rename = "response", skip_serializing_if = "Option::is_none")] + pub response: Option, + #[serde(rename = "delivery", skip_serializing_if = "Option::is_none")] + pub delivery: Option, + /// The URL of the webhook. Has to start with `https`. + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl WebhookUpdate { + pub fn new() -> WebhookUpdate { + WebhookUpdate { + active: None, + title: None, + secret: None, + trigger: None, + response: None, + delivery: None, + url: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/.gitignore b/gocardless-bankaccount-data-api/.gitignore new file mode 100644 index 0000000..6aa1064 --- /dev/null +++ b/gocardless-bankaccount-data-api/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/gocardless-bankaccount-data-api/.openapi-generator-ignore b/gocardless-bankaccount-data-api/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/gocardless-bankaccount-data-api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/gocardless-bankaccount-data-api/.openapi-generator/FILES b/gocardless-bankaccount-data-api/.openapi-generator/FILES new file mode 100644 index 0000000..43a998c --- /dev/null +++ b/gocardless-bankaccount-data-api/.openapi-generator/FILES @@ -0,0 +1,76 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/Account.md +docs/AccountBalance.md +docs/AccountDetail.md +docs/AccountSchema.md +docs/AccountsApi.md +docs/AgreementsApi.md +docs/BalanceAmountSchema.md +docs/BalanceSchema.md +docs/BankTransaction.md +docs/CurrencyExchangeSchema.md +docs/DetailSchema.md +docs/EndUserAgreement.md +docs/EndUserAgreementRequest.md +docs/EnduserAcceptanceDetailsRequest.md +docs/ErrorResponse.md +docs/InstitutionsApi.md +docs/Integration.md +docs/IntegrationRetrieve.md +docs/JwtObtainPairRequest.md +docs/JwtRefreshRequest.md +docs/OwnerAddressStructuredSchema.md +docs/PaginatedEndUserAgreementList.md +docs/PaginatedRequisitionList.md +docs/Requisition.md +docs/RequisitionRequest.md +docs/RequisitionsApi.md +docs/SpectacularJwtObtain.md +docs/SpectacularJwtRefresh.md +docs/SpectacularRequisition.md +docs/StatusEnum.md +docs/TokenApi.md +docs/TransactionAmountSchema.md +docs/TransactionSchema.md +git_push.sh +src/apis/accounts_api.rs +src/apis/agreements_api.rs +src/apis/configuration.rs +src/apis/institutions_api.rs +src/apis/mod.rs +src/apis/requisitions_api.rs +src/apis/token_api.rs +src/lib.rs +src/models/account.rs +src/models/account_balance.rs +src/models/account_detail.rs +src/models/account_schema.rs +src/models/balance_amount_schema.rs +src/models/balance_schema.rs +src/models/bank_transaction.rs +src/models/currency_exchange_schema.rs +src/models/detail_schema.rs +src/models/end_user_agreement.rs +src/models/end_user_agreement_request.rs +src/models/enduser_acceptance_details_request.rs +src/models/error_response.rs +src/models/integration.rs +src/models/integration_retrieve.rs +src/models/jwt_obtain_pair_request.rs +src/models/jwt_refresh_request.rs +src/models/mod.rs +src/models/owner_address_structured_schema.rs +src/models/paginated_end_user_agreement_list.rs +src/models/paginated_requisition_list.rs +src/models/requisition.rs +src/models/requisition_request.rs +src/models/spectacular_jwt_obtain.rs +src/models/spectacular_jwt_refresh.rs +src/models/spectacular_requisition.rs +src/models/status_enum.rs +src/models/transaction_amount_schema.rs +src/models/transaction_schema.rs diff --git a/gocardless-bankaccount-data-api/.openapi-generator/VERSION b/gocardless-bankaccount-data-api/.openapi-generator/VERSION new file mode 100644 index 0000000..17f2442 --- /dev/null +++ b/gocardless-bankaccount-data-api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.9.0-SNAPSHOT diff --git a/gocardless-bankaccount-data-api/.travis.yml b/gocardless-bankaccount-data-api/.travis.yml new file mode 100644 index 0000000..22761ba --- /dev/null +++ b/gocardless-bankaccount-data-api/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/gocardless-bankaccount-data-api/Cargo.toml b/gocardless-bankaccount-data-api/Cargo.toml new file mode 100644 index 0000000..b4a4692 --- /dev/null +++ b/gocardless-bankaccount-data-api/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "gocardless-bankaccount-data-api" +version = "2.0.0" +authors = ["OpenAPI Generator team and contributors"] +description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" +# Override this license by providing a License Object in the OpenAPI. +license = "Unlicense" +edition = "2021" + +[dependencies] +serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", features = ["json", "multipart"] } +reqwest-middleware = { version = "^0.3", features = ["json", "multipart"] } diff --git a/gocardless-bankaccount-data-api/README.md b/gocardless-bankaccount-data-api/README.md new file mode 100644 index 0000000..c2dc6c0 --- /dev/null +++ b/gocardless-bankaccount-data-api/README.md @@ -0,0 +1,89 @@ +# Rust API client for gocardless-bankaccount-data-api + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 2.0 (v2) +- Package version: 2.0.0 +- Generator version: 7.9.0-SNAPSHOT +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `gocardless-bankaccount-data-api` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +gocardless-bankaccount-data-api = { path = "./gocardless-bankaccount-data-api" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://bankaccountdata.gocardless.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AccountsApi* | [**retrieve_account_balances**](docs/AccountsApi.md#retrieve_account_balances) | **GET** /api/v2/accounts/{id}/balances/ | +*AccountsApi* | [**retrieve_account_details**](docs/AccountsApi.md#retrieve_account_details) | **GET** /api/v2/accounts/{id}/details/ | +*AccountsApi* | [**retrieve_account_metadata**](docs/AccountsApi.md#retrieve_account_metadata) | **GET** /api/v2/accounts/{id}/ | +*AccountsApi* | [**retrieve_account_transactions**](docs/AccountsApi.md#retrieve_account_transactions) | **GET** /api/v2/accounts/{id}/transactions/ | +*AgreementsApi* | [**accept_eua**](docs/AgreementsApi.md#accept_eua) | **PUT** /api/v2/agreements/enduser/{id}/accept/ | +*AgreementsApi* | [**create_eua**](docs/AgreementsApi.md#create_eua) | **POST** /api/v2/agreements/enduser/ | +*AgreementsApi* | [**delete_eua_by_id**](docs/AgreementsApi.md#delete_eua_by_id) | **DELETE** /api/v2/agreements/enduser/{id}/ | +*AgreementsApi* | [**retrieve_all_euas_for_an_end_user**](docs/AgreementsApi.md#retrieve_all_euas_for_an_end_user) | **GET** /api/v2/agreements/enduser/ | +*AgreementsApi* | [**retrieve_eua_by_id**](docs/AgreementsApi.md#retrieve_eua_by_id) | **GET** /api/v2/agreements/enduser/{id}/ | +*InstitutionsApi* | [**retrieve_all_supported_institutions_in_a_given_country**](docs/InstitutionsApi.md#retrieve_all_supported_institutions_in_a_given_country) | **GET** /api/v2/institutions/ | +*InstitutionsApi* | [**retrieve_institution**](docs/InstitutionsApi.md#retrieve_institution) | **GET** /api/v2/institutions/{id}/ | +*RequisitionsApi* | [**create_requisition**](docs/RequisitionsApi.md#create_requisition) | **POST** /api/v2/requisitions/ | +*RequisitionsApi* | [**delete_requisition_by_id**](docs/RequisitionsApi.md#delete_requisition_by_id) | **DELETE** /api/v2/requisitions/{id}/ | +*RequisitionsApi* | [**requisition_by_id**](docs/RequisitionsApi.md#requisition_by_id) | **GET** /api/v2/requisitions/{id}/ | +*RequisitionsApi* | [**retrieve_all_requisitions**](docs/RequisitionsApi.md#retrieve_all_requisitions) | **GET** /api/v2/requisitions/ | +*TokenApi* | [**get_a_new_access_token**](docs/TokenApi.md#get_a_new_access_token) | **POST** /api/v2/token/refresh/ | +*TokenApi* | [**obtain_new_access_slash_refresh_token_pair**](docs/TokenApi.md#obtain_new_access_slash_refresh_token_pair) | **POST** /api/v2/token/new/ | + + +## Documentation For Models + + - [Account](docs/Account.md) + - [AccountBalance](docs/AccountBalance.md) + - [AccountDetail](docs/AccountDetail.md) + - [AccountSchema](docs/AccountSchema.md) + - [BalanceAmountSchema](docs/BalanceAmountSchema.md) + - [BalanceSchema](docs/BalanceSchema.md) + - [BankTransaction](docs/BankTransaction.md) + - [CurrencyExchangeSchema](docs/CurrencyExchangeSchema.md) + - [DetailSchema](docs/DetailSchema.md) + - [EndUserAgreement](docs/EndUserAgreement.md) + - [EndUserAgreementRequest](docs/EndUserAgreementRequest.md) + - [EnduserAcceptanceDetailsRequest](docs/EnduserAcceptanceDetailsRequest.md) + - [ErrorResponse](docs/ErrorResponse.md) + - [Integration](docs/Integration.md) + - [IntegrationRetrieve](docs/IntegrationRetrieve.md) + - [JwtObtainPairRequest](docs/JwtObtainPairRequest.md) + - [JwtRefreshRequest](docs/JwtRefreshRequest.md) + - [OwnerAddressStructuredSchema](docs/OwnerAddressStructuredSchema.md) + - [PaginatedEndUserAgreementList](docs/PaginatedEndUserAgreementList.md) + - [PaginatedRequisitionList](docs/PaginatedRequisitionList.md) + - [Requisition](docs/Requisition.md) + - [RequisitionRequest](docs/RequisitionRequest.md) + - [SpectacularJwtObtain](docs/SpectacularJwtObtain.md) + - [SpectacularJwtRefresh](docs/SpectacularJwtRefresh.md) + - [SpectacularRequisition](docs/SpectacularRequisition.md) + - [StatusEnum](docs/StatusEnum.md) + - [TransactionAmountSchema](docs/TransactionAmountSchema.md) + - [TransactionSchema](docs/TransactionSchema.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + + + diff --git a/gocardless-bankaccount-data-api/docs/Account.md b/gocardless-bankaccount-data-api/docs/Account.md new file mode 100644 index 0000000..02836ce --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/Account.md @@ -0,0 +1,17 @@ +# Account + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | The ID of this Account, used to refer to this account in other API calls. | [optional][readonly] +**created** | Option<**String**> | The date & time at which the account object was created. | [optional][readonly] +**last_accessed** | Option<**String**> | The date & time at which the account object was last accessed. | [optional][readonly] +**iban** | Option<**String**> | The Account IBAN | [optional][readonly] +**status** | Option<**String**> | The processing status of this account. | [optional][readonly] +**institution_id** | Option<**String**> | The ASPSP associated with this account. | [optional][readonly] +**owner_name** | Option<**String**> | The name of the account owner. | [optional][readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/AccountBalance.md b/gocardless-bankaccount-data-api/docs/AccountBalance.md new file mode 100644 index 0000000..ee6a1aa --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/AccountBalance.md @@ -0,0 +1,11 @@ +# AccountBalance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**balances** | Option<[**Vec**](BalanceSchema.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/AccountDetail.md b/gocardless-bankaccount-data-api/docs/AccountDetail.md new file mode 100644 index 0000000..d3fcfea --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/AccountDetail.md @@ -0,0 +1,11 @@ +# AccountDetail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account** | [**models::DetailSchema**](DetailSchema.md) | account | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/AccountSchema.md b/gocardless-bankaccount-data-api/docs/AccountSchema.md new file mode 100644 index 0000000..8de6f63 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/AccountSchema.md @@ -0,0 +1,16 @@ +# AccountSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**iban** | Option<**String**> | iban | [optional] +**bban** | Option<**String**> | bban | [optional] +**pan** | Option<**String**> | pan | [optional] +**masked_pan** | Option<**String**> | maskedPan | [optional] +**msisdn** | Option<**String**> | msisdn | [optional] +**currency** | Option<**String**> | currency | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/AccountsApi.md b/gocardless-bankaccount-data-api/docs/AccountsApi.md new file mode 100644 index 0000000..72a915d --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/AccountsApi.md @@ -0,0 +1,134 @@ +# \AccountsApi + +All URIs are relative to *https://bankaccountdata.gocardless.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**retrieve_account_balances**](AccountsApi.md#retrieve_account_balances) | **GET** /api/v2/accounts/{id}/balances/ | +[**retrieve_account_details**](AccountsApi.md#retrieve_account_details) | **GET** /api/v2/accounts/{id}/details/ | +[**retrieve_account_metadata**](AccountsApi.md#retrieve_account_metadata) | **GET** /api/v2/accounts/{id}/ | +[**retrieve_account_transactions**](AccountsApi.md#retrieve_account_transactions) | **GET** /api/v2/accounts/{id}/transactions/ | + + + +## retrieve_account_balances + +> models::AccountBalance retrieve_account_balances(id) + + +Access account balances. Balances will be returned in Berlin Group PSD2 format. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | | [required] | + +### Return type + +[**models::AccountBalance**](AccountBalance.md) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## retrieve_account_details + +> models::AccountDetail retrieve_account_details(id) + + +Access account details. Account details will be returned in Berlin Group PSD2 format. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | | [required] | + +### Return type + +[**models::AccountDetail**](AccountDetail.md) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## retrieve_account_metadata + +> models::Account retrieve_account_metadata(id) + + +Access account metadata. Information about the account record, such as the processing status and IBAN. Account status is recalculated based on the error count in the latest req. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | | [required] | + +### Return type + +[**models::Account**](Account.md) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## retrieve_account_transactions + +> models::BankTransaction retrieve_account_transactions(id, date_from, date_to) + + +Access account transactions. Transactions will be returned in Berlin Group PSD2 format. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | | [required] | +**date_from** | Option<**String**> | | | +**date_to** | Option<**String**> | | | + +### Return type + +[**models::BankTransaction**](BankTransaction.md) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/gocardless-bankaccount-data-api/docs/AgreementsApi.md b/gocardless-bankaccount-data-api/docs/AgreementsApi.md new file mode 100644 index 0000000..2d48a57 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/AgreementsApi.md @@ -0,0 +1,165 @@ +# \AgreementsApi + +All URIs are relative to *https://bankaccountdata.gocardless.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**accept_eua**](AgreementsApi.md#accept_eua) | **PUT** /api/v2/agreements/enduser/{id}/accept/ | +[**create_eua**](AgreementsApi.md#create_eua) | **POST** /api/v2/agreements/enduser/ | +[**delete_eua_by_id**](AgreementsApi.md#delete_eua_by_id) | **DELETE** /api/v2/agreements/enduser/{id}/ | +[**retrieve_all_euas_for_an_end_user**](AgreementsApi.md#retrieve_all_euas_for_an_end_user) | **GET** /api/v2/agreements/enduser/ | +[**retrieve_eua_by_id**](AgreementsApi.md#retrieve_eua_by_id) | **GET** /api/v2/agreements/enduser/{id}/ | + + + +## accept_eua + +> models::EndUserAgreement accept_eua(id, enduser_acceptance_details_request) + + +Accept an end-user agreement via the API + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **uuid::Uuid** | A UUID string identifying this end user agreement. | [required] | +**enduser_acceptance_details_request** | [**EnduserAcceptanceDetailsRequest**](EnduserAcceptanceDetailsRequest.md) | | [required] | + +### Return type + +[**models::EndUserAgreement**](EndUserAgreement.md) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## create_eua + +> models::EndUserAgreement create_eua(end_user_agreement_request) + + +API endpoints related to end-user agreements. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**end_user_agreement_request** | [**EndUserAgreementRequest**](EndUserAgreementRequest.md) | | [required] | + +### Return type + +[**models::EndUserAgreement**](EndUserAgreement.md) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_eua_by_id + +> delete_eua_by_id(id) + + +Delete an end user agreement + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **uuid::Uuid** | A UUID string identifying this end user agreement. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## retrieve_all_euas_for_an_end_user + +> models::PaginatedEndUserAgreementList retrieve_all_euas_for_an_end_user(limit, offset) + + +API endpoints related to end-user agreements. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**limit** | Option<**i32**> | Number of results to return per page. | |[default to 100] +**offset** | Option<**i32**> | The initial zero-based index from which to return the results. | |[default to 0] + +### Return type + +[**models::PaginatedEndUserAgreementList**](PaginatedEndUserAgreementList.md) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## retrieve_eua_by_id + +> models::EndUserAgreement retrieve_eua_by_id(id) + + +Retrieve end user agreement by ID + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **uuid::Uuid** | A UUID string identifying this end user agreement. | [required] | + +### Return type + +[**models::EndUserAgreement**](EndUserAgreement.md) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/gocardless-bankaccount-data-api/docs/BalanceAmountSchema.md b/gocardless-bankaccount-data-api/docs/BalanceAmountSchema.md new file mode 100644 index 0000000..fd4769f --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/BalanceAmountSchema.md @@ -0,0 +1,12 @@ +# BalanceAmountSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **String** | amount | +**currency** | **String** | currency | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/BalanceSchema.md b/gocardless-bankaccount-data-api/docs/BalanceSchema.md new file mode 100644 index 0000000..8f4b5be --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/BalanceSchema.md @@ -0,0 +1,16 @@ +# BalanceSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**balance_amount** | [**models::BalanceAmountSchema**](BalanceAmountSchema.md) | balanceAmount | +**balance_type** | **String** | balanceType | +**credit_limit_included** | Option<**bool**> | creditLimitIncluded | [optional] +**last_change_date_time** | Option<**String**> | lastChangeDateTime | [optional] +**reference_date** | Option<**String**> | referenceDate | [optional] +**last_committed_transaction** | Option<**String**> | lastCommittedTransaction | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/BankTransaction.md b/gocardless-bankaccount-data-api/docs/BankTransaction.md new file mode 100644 index 0000000..5fce913 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/BankTransaction.md @@ -0,0 +1,12 @@ +# BankTransaction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**booked** | [**Vec**](TransactionSchema.md) | | +**pending** | Option<[**Vec**](TransactionSchema.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/CurrencyExchangeSchema.md b/gocardless-bankaccount-data-api/docs/CurrencyExchangeSchema.md new file mode 100644 index 0000000..cc93816 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/CurrencyExchangeSchema.md @@ -0,0 +1,16 @@ +# CurrencyExchangeSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_currency** | Option<**String**> | sourceCurrency | [optional] +**exchange_rate** | Option<**String**> | exchangeRate | [optional] +**unit_currency** | Option<**String**> | unitCurrency | [optional] +**target_currency** | Option<**String**> | targetCurrency | [optional] +**quotation_date** | Option<**String**> | quotationDate | [optional] +**contract_identification** | Option<**String**> | contractIdentification | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/DetailSchema.md b/gocardless-bankaccount-data-api/docs/DetailSchema.md new file mode 100644 index 0000000..3ab3365 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/DetailSchema.md @@ -0,0 +1,28 @@ +# DetailSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_id** | Option<**String**> | resourceId | [optional] +**iban** | Option<**String**> | iban | [optional] +**bban** | Option<**String**> | bban | [optional] +**msisdn** | Option<**String**> | msisdn | [optional] +**currency** | Option<**String**> | currency | [optional] +**owner_name** | Option<**String**> | ownerName | [optional] +**name** | Option<**String**> | name | [optional] +**display_name** | Option<**String**> | displayName | [optional] +**product** | Option<**String**> | product | [optional] +**cash_account_type** | Option<**String**> | cashAccountType | [optional] +**status** | Option<**String**> | status | [optional] +**bic** | Option<**String**> | bic | [optional] +**linked_accounts** | Option<**String**> | linkedAccounts | [optional] +**masked_pan** | Option<**String**> | maskedPan | [optional] +**usage** | Option<**String**> | usage | [optional] +**details** | Option<**String**> | details | [optional] +**owner_address_unstructured** | Option<**Vec**> | ownerAddressUnstructured | [optional] +**owner_address_structured** | Option<[**models::OwnerAddressStructuredSchema**](OwnerAddressStructuredSchema.md)> | ownerAddressStructured | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/EndUserAgreement.md b/gocardless-bankaccount-data-api/docs/EndUserAgreement.md new file mode 100644 index 0000000..9b25527 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/EndUserAgreement.md @@ -0,0 +1,17 @@ +# EndUserAgreement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | The ID of this End User Agreement, used to refer to this end user agreement in other API calls. | [optional][readonly] +**created** | Option<**String**> | The date & time at which the end user agreement was created. | [optional][readonly] +**institution_id** | **String** | an Institution ID for this EUA | +**max_historical_days** | Option<**i32**> | Maximum number of days of transaction data to retrieve. | [optional][default to 90] +**access_valid_for_days** | Option<**i32**> | Number of days from acceptance that the access can be used. | [optional][default to 90] +**access_scope** | Option<[**Vec**](serde_json::Value.md)> | Array containing one or several values of ['balances', 'details', 'transactions'] | [optional][default to ["balances","details","transactions"]] +**accepted** | Option<**String**> | The date & time at which the end user accepted the agreement. | [optional][readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/EndUserAgreementRequest.md b/gocardless-bankaccount-data-api/docs/EndUserAgreementRequest.md new file mode 100644 index 0000000..5c908b5 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/EndUserAgreementRequest.md @@ -0,0 +1,14 @@ +# EndUserAgreementRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**institution_id** | **String** | an Institution ID for this EUA | +**max_historical_days** | Option<**i32**> | Maximum number of days of transaction data to retrieve. | [optional][default to 90] +**access_valid_for_days** | Option<**i32**> | Number of days from acceptance that the access can be used. | [optional][default to 90] +**access_scope** | Option<[**Vec**](serde_json::Value.md)> | Array containing one or several values of ['balances', 'details', 'transactions'] | [optional][default to ["balances","details","transactions"]] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/EnduserAcceptanceDetailsRequest.md b/gocardless-bankaccount-data-api/docs/EnduserAcceptanceDetailsRequest.md new file mode 100644 index 0000000..ead7a77 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/EnduserAcceptanceDetailsRequest.md @@ -0,0 +1,12 @@ +# EnduserAcceptanceDetailsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_agent** | **String** | | +**ip_address** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/ErrorResponse.md b/gocardless-bankaccount-data-api/docs/ErrorResponse.md new file mode 100644 index 0000000..37d20dd --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/ErrorResponse.md @@ -0,0 +1,14 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**summary** | **String** | | +**detail** | **String** | | +**r#type** | Option<**String**> | | [optional] +**status_code** | **i32** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/InstitutionsApi.md b/gocardless-bankaccount-data-api/docs/InstitutionsApi.md new file mode 100644 index 0000000..4402a01 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/InstitutionsApi.md @@ -0,0 +1,82 @@ +# \InstitutionsApi + +All URIs are relative to *https://bankaccountdata.gocardless.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**retrieve_all_supported_institutions_in_a_given_country**](InstitutionsApi.md#retrieve_all_supported_institutions_in_a_given_country) | **GET** /api/v2/institutions/ | +[**retrieve_institution**](InstitutionsApi.md#retrieve_institution) | **GET** /api/v2/institutions/{id}/ | + + + +## retrieve_all_supported_institutions_in_a_given_country + +> Vec retrieve_all_supported_institutions_in_a_given_country(access_scopes_supported, account_selection_supported, business_accounts_supported, card_accounts_supported, corporate_accounts_supported, country, payment_submission_supported, payments_enabled, pending_transactions_supported, private_accounts_supported, read_debtor_account_supported, read_refund_account_supported, ssn_verification_supported) + + +List all available institutions + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**access_scopes_supported** | Option<**String**> | Boolean value, indicating if access scopes are supported | | +**account_selection_supported** | Option<**String**> | Boolean value, indicating if account selection is supported | | +**business_accounts_supported** | Option<**String**> | Boolean value, indicating if business accounts are supported | | +**card_accounts_supported** | Option<**String**> | Boolean value, indicating if card accounts are supported | | +**corporate_accounts_supported** | Option<**String**> | Boolean value, indicating if corporate accounts are supported | | +**country** | Option<**String**> | ISO 3166 two-character country code | | +**payment_submission_supported** | Option<**String**> | Boolean value, indicating if payment submission is supported | | +**payments_enabled** | Option<**String**> | Boolean value, indicating if payments are supported | | +**pending_transactions_supported** | Option<**String**> | Boolean value, indicating if pending transactions are supported | | +**private_accounts_supported** | Option<**String**> | Boolean value, indicating if private accounts are supported | | +**read_debtor_account_supported** | Option<**String**> | Boolean value, indicating if debtor account can be read before submitting payment | | +**read_refund_account_supported** | Option<**String**> | Boolean value, indicating if read refund account is supported | | +**ssn_verification_supported** | Option<**String**> | Boolean value, indicating if ssn verification is supported | | + +### Return type + +[**Vec**](Integration.md) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## retrieve_institution + +> models::IntegrationRetrieve retrieve_institution(id) + + +Get details about a specific Institution and its supported features + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | | [required] | + +### Return type + +[**models::IntegrationRetrieve**](IntegrationRetrieve.md) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/gocardless-bankaccount-data-api/docs/Integration.md b/gocardless-bankaccount-data-api/docs/Integration.md new file mode 100644 index 0000000..7fc8482 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/Integration.md @@ -0,0 +1,16 @@ +# Integration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | | +**bic** | Option<**String**> | | [optional] +**transaction_total_days** | Option<**String**> | | [optional][default to 90] +**countries** | **Vec** | | +**logo** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/IntegrationRetrieve.md b/gocardless-bankaccount-data-api/docs/IntegrationRetrieve.md new file mode 100644 index 0000000..46ee90a --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/IntegrationRetrieve.md @@ -0,0 +1,19 @@ +# IntegrationRetrieve + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | | +**bic** | Option<**String**> | | [optional] +**transaction_total_days** | Option<**String**> | | [optional][default to 90] +**countries** | **Vec** | | +**logo** | **String** | | +**supported_payments** | [**std::collections::HashMap**](serde_json::Value.md) | | +**supported_features** | [**Vec**](serde_json::Value.md) | | +**identification_codes** | [**Vec**](serde_json::Value.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/JwtObtainPairRequest.md b/gocardless-bankaccount-data-api/docs/JwtObtainPairRequest.md new file mode 100644 index 0000000..eb268c7 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/JwtObtainPairRequest.md @@ -0,0 +1,12 @@ +# JwtObtainPairRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**secret_id** | **String** | Secret id from /user-secrets/ | +**secret_key** | **String** | Secret key from /user-secrets/ | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/JwtRefreshRequest.md b/gocardless-bankaccount-data-api/docs/JwtRefreshRequest.md new file mode 100644 index 0000000..de3fdea --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/JwtRefreshRequest.md @@ -0,0 +1,11 @@ +# JwtRefreshRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**refresh** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/OwnerAddressStructuredSchema.md b/gocardless-bankaccount-data-api/docs/OwnerAddressStructuredSchema.md new file mode 100644 index 0000000..78ea730 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/OwnerAddressStructuredSchema.md @@ -0,0 +1,15 @@ +# OwnerAddressStructuredSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**street_name** | Option<**String**> | streetName | [optional] +**building_number** | Option<**String**> | buildingNumber | [optional] +**town_name** | Option<**String**> | townName | [optional] +**post_code** | Option<**String**> | postCode | [optional] +**country** | Option<**String**> | country | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/PaginatedEndUserAgreementList.md b/gocardless-bankaccount-data-api/docs/PaginatedEndUserAgreementList.md new file mode 100644 index 0000000..3dce3dc --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/PaginatedEndUserAgreementList.md @@ -0,0 +1,14 @@ +# PaginatedEndUserAgreementList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **i32** | | +**next** | Option<**String**> | | [optional] +**previous** | Option<**String**> | | [optional] +**results** | [**Vec**](EndUserAgreement.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/PaginatedRequisitionList.md b/gocardless-bankaccount-data-api/docs/PaginatedRequisitionList.md new file mode 100644 index 0000000..7a62cca --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/PaginatedRequisitionList.md @@ -0,0 +1,14 @@ +# PaginatedRequisitionList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **i32** | | +**next** | Option<**String**> | | [optional] +**previous** | Option<**String**> | | [optional] +**results** | [**Vec**](Requisition.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/Requisition.md b/gocardless-bankaccount-data-api/docs/Requisition.md new file mode 100644 index 0000000..b2f4d08 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/Requisition.md @@ -0,0 +1,23 @@ +# Requisition + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | | [optional][readonly] +**created** | Option<**String**> | The date & time at which the requisition was created. | [optional][readonly] +**redirect** | Option<**String**> | redirect URL to your application after end-user authorization with ASPSP | +**status** | Option<[**models::StatusEnum**](StatusEnum.md)> | status of this requisition | [optional][readonly] +**institution_id** | **String** | an Institution ID for this Requisition | +**agreement** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | EUA associated with this requisition | [optional] +**reference** | Option<**String**> | additional ID to identify the end user | [optional] +**accounts** | Option<[**Vec**](uuid::Uuid.md)> | array of account IDs retrieved within a scope of this requisition | [optional][readonly] +**user_language** | Option<**String**> | A two-letter country code (ISO 639-1) | [optional] +**link** | Option<**String**> | link to initiate authorization with Institution | [optional][readonly][default to https://ob.gocardless.com/psd2/start/3fa85f64-5717-4562-b3fc-2c963f66afa6/{$INSTITUTION_ID}] +**ssn** | Option<**String**> | optional SSN field to verify ownership of the account | [optional] +**account_selection** | Option<**bool**> | option to enable account selection view for the end user | [optional][default to false] +**redirect_immediate** | Option<**bool**> | enable redirect back to the client after account list received | [optional][default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/RequisitionRequest.md b/gocardless-bankaccount-data-api/docs/RequisitionRequest.md new file mode 100644 index 0000000..85dd10a --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/RequisitionRequest.md @@ -0,0 +1,18 @@ +# RequisitionRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**redirect** | Option<**String**> | redirect URL to your application after end-user authorization with ASPSP | +**institution_id** | **String** | an Institution ID for this Requisition | +**agreement** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | EUA associated with this requisition | [optional] +**reference** | Option<**String**> | additional ID to identify the end user | [optional] +**user_language** | Option<**String**> | A two-letter country code (ISO 639-1) | [optional] +**ssn** | Option<**String**> | optional SSN field to verify ownership of the account | [optional] +**account_selection** | Option<**bool**> | option to enable account selection view for the end user | [optional][default to false] +**redirect_immediate** | Option<**bool**> | enable redirect back to the client after account list received | [optional][default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/RequisitionsApi.md b/gocardless-bankaccount-data-api/docs/RequisitionsApi.md new file mode 100644 index 0000000..1e86a78 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/RequisitionsApi.md @@ -0,0 +1,133 @@ +# \RequisitionsApi + +All URIs are relative to *https://bankaccountdata.gocardless.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_requisition**](RequisitionsApi.md#create_requisition) | **POST** /api/v2/requisitions/ | +[**delete_requisition_by_id**](RequisitionsApi.md#delete_requisition_by_id) | **DELETE** /api/v2/requisitions/{id}/ | +[**requisition_by_id**](RequisitionsApi.md#requisition_by_id) | **GET** /api/v2/requisitions/{id}/ | +[**retrieve_all_requisitions**](RequisitionsApi.md#retrieve_all_requisitions) | **GET** /api/v2/requisitions/ | + + + +## create_requisition + +> models::SpectacularRequisition create_requisition(requisition_request) + + +Create a new requisition + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**requisition_request** | [**RequisitionRequest**](RequisitionRequest.md) | | [required] | + +### Return type + +[**models::SpectacularRequisition**](SpectacularRequisition.md) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_requisition_by_id + +> delete_requisition_by_id(id) + + +Delete requisition and its end user agreement + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **uuid::Uuid** | A UUID string identifying this requisition. | [required] | + +### Return type + + (empty response body) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## requisition_by_id + +> models::Requisition requisition_by_id(id) + + +Retrieve a requisition by ID + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **uuid::Uuid** | A UUID string identifying this requisition. | [required] | + +### Return type + +[**models::Requisition**](Requisition.md) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## retrieve_all_requisitions + +> models::PaginatedRequisitionList retrieve_all_requisitions(limit, offset) + + +Retrieve all requisitions belonging to the company + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**limit** | Option<**i32**> | Number of results to return per page. | |[default to 100] +**offset** | Option<**i32**> | The initial zero-based index from which to return the results. | |[default to 0] + +### Return type + +[**models::PaginatedRequisitionList**](PaginatedRequisitionList.md) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/gocardless-bankaccount-data-api/docs/SpectacularJwtObtain.md b/gocardless-bankaccount-data-api/docs/SpectacularJwtObtain.md new file mode 100644 index 0000000..7c2c17e --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/SpectacularJwtObtain.md @@ -0,0 +1,14 @@ +# SpectacularJwtObtain + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access** | Option<**String**> | Your access token | [optional][readonly] +**access_expires** | Option<**i32**> | Access token expires in seconds | [optional][readonly][default to 86400] +**refresh** | Option<**String**> | Your refresh token | [optional][readonly] +**refresh_expires** | Option<**i32**> | Refresh token expires in seconds | [optional][readonly][default to 2592000] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/SpectacularJwtRefresh.md b/gocardless-bankaccount-data-api/docs/SpectacularJwtRefresh.md new file mode 100644 index 0000000..1c486d2 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/SpectacularJwtRefresh.md @@ -0,0 +1,12 @@ +# SpectacularJwtRefresh + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access** | Option<**String**> | Your access token | [optional][readonly] +**access_expires** | Option<**i32**> | Access token expires in seconds | [optional][readonly][default to 86400] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/SpectacularRequisition.md b/gocardless-bankaccount-data-api/docs/SpectacularRequisition.md new file mode 100644 index 0000000..cad7963 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/SpectacularRequisition.md @@ -0,0 +1,23 @@ +# SpectacularRequisition + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | | [optional][readonly] +**created** | Option<**String**> | The date & time at which the requisition was created. | [optional][readonly] +**redirect** | Option<**String**> | redirect URL to your application after end-user authorization with ASPSP | +**status** | Option<[**models::StatusEnum**](StatusEnum.md)> | status of this requisition | [optional][readonly] +**institution_id** | **String** | an Institution ID for this Requisition | +**agreement** | Option<[**uuid::Uuid**](uuid::Uuid.md)> | EUA associated with this requisition | [optional] +**reference** | Option<**String**> | additional ID to identify the end user | [optional] +**accounts** | Option<[**Vec**](serde_json::Value.md)> | array of account IDs retrieved within a scope of this requisition | [optional][readonly][default to []] +**user_language** | Option<**String**> | A two-letter country code (ISO 639-1) | [optional] +**link** | Option<**String**> | link to initiate authorization with Institution | [optional][readonly][default to https://ob.gocardless.com/psd2/start/3fa85f64-5717-4562-b3fc-2c963f66afa6/{$INSTITUTION_ID}] +**ssn** | Option<**String**> | optional SSN field to verify ownership of the account | [optional] +**account_selection** | Option<**bool**> | option to enable account selection view for the end user | [optional][default to false] +**redirect_immediate** | Option<**bool**> | enable redirect back to the client after account list received | [optional][default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/StatusEnum.md b/gocardless-bankaccount-data-api/docs/StatusEnum.md new file mode 100644 index 0000000..1a337ec --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/StatusEnum.md @@ -0,0 +1,22 @@ +# StatusEnum + +## Enum Variants + +| Name | Value | +|---- | -----| +| Cr | CR | +| Id | ID | +| Ln | LN | +| Rj | RJ | +| Er | ER | +| Su | SU | +| Ex | EX | +| Gc | GC | +| Ua | UA | +| Ga | GA | +| Sa | SA | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/TokenApi.md b/gocardless-bankaccount-data-api/docs/TokenApi.md new file mode 100644 index 0000000..55b72b9 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/TokenApi.md @@ -0,0 +1,70 @@ +# \TokenApi + +All URIs are relative to *https://bankaccountdata.gocardless.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_a_new_access_token**](TokenApi.md#get_a_new_access_token) | **POST** /api/v2/token/refresh/ | +[**obtain_new_access_slash_refresh_token_pair**](TokenApi.md#obtain_new_access_slash_refresh_token_pair) | **POST** /api/v2/token/new/ | + + + +## get_a_new_access_token + +> models::SpectacularJwtRefresh get_a_new_access_token(jwt_refresh_request) + + +Refresh access token + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**jwt_refresh_request** | [**JwtRefreshRequest**](JwtRefreshRequest.md) | | [required] | + +### Return type + +[**models::SpectacularJwtRefresh**](SpectacularJWTRefresh.md) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## obtain_new_access_slash_refresh_token_pair + +> models::SpectacularJwtObtain obtain_new_access_slash_refresh_token_pair(jwt_obtain_pair_request) + + +Obtain JWT pair + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**jwt_obtain_pair_request** | [**JwtObtainPairRequest**](JwtObtainPairRequest.md) | | [required] | + +### Return type + +[**models::SpectacularJwtObtain**](SpectacularJWTObtain.md) + +### Authorization + +[jwtAuth](../README.md#jwtAuth) + +### HTTP request headers + +- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/gocardless-bankaccount-data-api/docs/TransactionAmountSchema.md b/gocardless-bankaccount-data-api/docs/TransactionAmountSchema.md new file mode 100644 index 0000000..8fc1b33 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/TransactionAmountSchema.md @@ -0,0 +1,12 @@ +# TransactionAmountSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **String** | amount | +**currency** | **String** | currency | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/docs/TransactionSchema.md b/gocardless-bankaccount-data-api/docs/TransactionSchema.md new file mode 100644 index 0000000..9c4f0b0 --- /dev/null +++ b/gocardless-bankaccount-data-api/docs/TransactionSchema.md @@ -0,0 +1,37 @@ +# TransactionSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transaction_id** | Option<**String**> | transactionId | [optional] +**entry_reference** | Option<**String**> | entryReference | [optional] +**end_to_end_id** | Option<**String**> | endToEndId | [optional] +**mandate_id** | Option<**String**> | mandateId | [optional] +**check_id** | Option<**String**> | checkId | [optional] +**creditor_id** | Option<**String**> | creditorId | [optional] +**booking_date** | Option<**String**> | bookingDate | [optional] +**value_date** | Option<**String**> | valueDate | [optional] +**booking_date_time** | Option<**String**> | bookingDateTime | [optional] +**value_date_time** | Option<**String**> | valueDateTime | [optional] +**transaction_amount** | [**models::TransactionAmountSchema**](TransactionAmountSchema.md) | transactionAmount | +**currency_exchange** | Option<[**Vec**](CurrencyExchangeSchema.md)> | | [optional] +**creditor_name** | Option<**String**> | creditorName | [optional] +**creditor_account** | Option<[**models::AccountSchema**](AccountSchema.md)> | creditorAccount | [optional] +**ultimate_creditor** | Option<**String**> | ultimateCreditor | [optional] +**debtor_name** | Option<**String**> | debtorName | [optional] +**debtor_account** | Option<[**models::AccountSchema**](AccountSchema.md)> | debtorAccount | [optional] +**ultimate_debtor** | Option<**String**> | ultimateDebtor | [optional] +**remittance_information_unstructured** | Option<**String**> | remittanceInformationUnstructured | [optional] +**remittance_information_unstructured_array** | Option<**Vec**> | remittanceInformationUnstructuredArray | [optional] +**remittance_information_structured** | Option<**String**> | remittanceInformationStructured | [optional] +**remittance_information_structured_array** | Option<**Vec**> | remittanceInformationStructuredArray | [optional] +**additional_information** | Option<**String**> | additionalInformation | [optional] +**purpose_code** | Option<**String**> | purposeCode | [optional] +**bank_transaction_code** | Option<**String**> | bankTransactionCode | [optional] +**proprietary_bank_transaction_code** | Option<**String**> | proprietaryBankTransactionCode | [optional] +**internal_transaction_id** | Option<**String**> | internalTransactionId | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/gocardless-bankaccount-data-api/git_push.sh b/gocardless-bankaccount-data-api/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/gocardless-bankaccount-data-api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/gocardless-bankaccount-data-api/src/apis/accounts_api.rs b/gocardless-bankaccount-data-api/src/apis/accounts_api.rs new file mode 100644 index 0000000..4fe7feb --- /dev/null +++ b/gocardless-bankaccount-data-api/src/apis/accounts_api.rs @@ -0,0 +1,204 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`retrieve_account_balances`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RetrieveAccountBalancesError { + Status404(models::ErrorResponse), + Status429(models::ErrorResponse), + Status401(models::ErrorResponse), + Status403(models::ErrorResponse), + Status400(models::ErrorResponse), + Status500(models::ErrorResponse), + Status409(models::ErrorResponse), + Status503(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`retrieve_account_details`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RetrieveAccountDetailsError { + Status404(models::ErrorResponse), + Status429(models::ErrorResponse), + Status401(models::ErrorResponse), + Status403(models::ErrorResponse), + Status400(models::ErrorResponse), + Status500(models::ErrorResponse), + Status409(models::ErrorResponse), + Status503(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`retrieve_account_metadata`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RetrieveAccountMetadataError { + Status404(models::ErrorResponse), + Status429(models::ErrorResponse), + Status401(models::ErrorResponse), + Status403(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`retrieve_account_transactions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RetrieveAccountTransactionsError { + Status404(models::ErrorResponse), + Status429(models::ErrorResponse), + Status401(models::ErrorResponse), + Status403(models::ErrorResponse), + Status400(models::ErrorResponse), + Status500(models::ErrorResponse), + Status409(models::ErrorResponse), + Status503(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + + +/// Access account balances. Balances will be returned in Berlin Group PSD2 format. +pub async fn retrieve_account_balances(configuration: &configuration::Configuration, id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/accounts/{id}/balances/", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Access account details. Account details will be returned in Berlin Group PSD2 format. +pub async fn retrieve_account_details(configuration: &configuration::Configuration, id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/accounts/{id}/details/", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Access account metadata. Information about the account record, such as the processing status and IBAN. Account status is recalculated based on the error count in the latest req. +pub async fn retrieve_account_metadata(configuration: &configuration::Configuration, id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/accounts/{id}/", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Access account transactions. Transactions will be returned in Berlin Group PSD2 format. +pub async fn retrieve_account_transactions(configuration: &configuration::Configuration, id: &str, date_from: Option, date_to: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/accounts/{id}/transactions/", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = date_from { + local_var_req_builder = local_var_req_builder.query(&[("date_from", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = date_to { + local_var_req_builder = local_var_req_builder.query(&[("date_to", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/gocardless-bankaccount-data-api/src/apis/agreements_api.rs b/gocardless-bankaccount-data-api/src/apis/agreements_api.rs new file mode 100644 index 0000000..fb5ea25 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/apis/agreements_api.rs @@ -0,0 +1,241 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`accept_eua`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AcceptEuaError { + Status405(models::ErrorResponse), + Status403(models::ErrorResponse), + Status400(models::ErrorResponse), + Status404(models::ErrorResponse), + Status429(models::ErrorResponse), + Status401(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_eua`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateEuaError { + Status400(models::ErrorResponse), + Status429(models::ErrorResponse), + Status402(models::ErrorResponse), + Status401(models::ErrorResponse), + Status403(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_eua_by_id`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteEuaByIdError { + Status400(models::ErrorResponse), + Status404(models::ErrorResponse), + Status429(models::ErrorResponse), + Status401(models::ErrorResponse), + Status403(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`retrieve_all_euas_for_an_end_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RetrieveAllEuasForAnEndUserError { + Status404(models::ErrorResponse), + Status429(models::ErrorResponse), + Status401(models::ErrorResponse), + Status403(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`retrieve_eua_by_id`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RetrieveEuaByIdError { + Status404(models::ErrorResponse), + Status400(models::ErrorResponse), + Status429(models::ErrorResponse), + Status401(models::ErrorResponse), + Status403(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + + +/// Accept an end-user agreement via the API +pub async fn accept_eua(configuration: &configuration::Configuration, id: &str, enduser_acceptance_details_request: models::EnduserAcceptanceDetailsRequest) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/agreements/enduser/{id}/accept/", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&enduser_acceptance_details_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// API endpoints related to end-user agreements. +pub async fn create_eua(configuration: &configuration::Configuration, end_user_agreement_request: models::EndUserAgreementRequest) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/agreements/enduser/", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&end_user_agreement_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete an end user agreement +pub async fn delete_eua_by_id(configuration: &configuration::Configuration, id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/agreements/enduser/{id}/", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// API endpoints related to end-user agreements. +pub async fn retrieve_all_euas_for_an_end_user(configuration: &configuration::Configuration, limit: Option, offset: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/agreements/enduser/", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieve end user agreement by ID +pub async fn retrieve_eua_by_id(configuration: &configuration::Configuration, id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/agreements/enduser/{id}/", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/gocardless-bankaccount-data-api/src/apis/configuration.rs b/gocardless-bankaccount-data-api/src/apis/configuration.rs new file mode 100644 index 0000000..2610b1f --- /dev/null +++ b/gocardless-bankaccount-data-api/src/apis/configuration.rs @@ -0,0 +1,53 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest_middleware::ClientWithMiddleware, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "https://bankaccountdata.gocardless.com".to_owned(), + user_agent: Some("OpenAPI-Generator/2.0 (v2)/rust".to_owned()), + client: reqwest_middleware::ClientBuilder::new(reqwest::Client::new()).build(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + + } + } +} diff --git a/gocardless-bankaccount-data-api/src/apis/institutions_api.rs b/gocardless-bankaccount-data-api/src/apis/institutions_api.rs new file mode 100644 index 0000000..e1d0c6b --- /dev/null +++ b/gocardless-bankaccount-data-api/src/apis/institutions_api.rs @@ -0,0 +1,142 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`retrieve_all_supported_institutions_in_a_given_country`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RetrieveAllSupportedInstitutionsInAGivenCountryError { + Status400(models::ErrorResponse), + Status404(models::ErrorResponse), + Status429(models::ErrorResponse), + Status401(models::ErrorResponse), + Status403(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`retrieve_institution`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RetrieveInstitutionError { + Status404(models::ErrorResponse), + Status429(models::ErrorResponse), + Status401(models::ErrorResponse), + Status403(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + + +/// List all available institutions +pub async fn retrieve_all_supported_institutions_in_a_given_country(configuration: &configuration::Configuration, access_scopes_supported: Option<&str>, account_selection_supported: Option<&str>, business_accounts_supported: Option<&str>, card_accounts_supported: Option<&str>, corporate_accounts_supported: Option<&str>, country: Option<&str>, payment_submission_supported: Option<&str>, payments_enabled: Option<&str>, pending_transactions_supported: Option<&str>, private_accounts_supported: Option<&str>, read_debtor_account_supported: Option<&str>, read_refund_account_supported: Option<&str>, ssn_verification_supported: Option<&str>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/institutions/", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = access_scopes_supported { + local_var_req_builder = local_var_req_builder.query(&[("access_scopes_supported", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = account_selection_supported { + local_var_req_builder = local_var_req_builder.query(&[("account_selection_supported", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = business_accounts_supported { + local_var_req_builder = local_var_req_builder.query(&[("business_accounts_supported", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = card_accounts_supported { + local_var_req_builder = local_var_req_builder.query(&[("card_accounts_supported", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = corporate_accounts_supported { + local_var_req_builder = local_var_req_builder.query(&[("corporate_accounts_supported", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = country { + local_var_req_builder = local_var_req_builder.query(&[("country", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = payment_submission_supported { + local_var_req_builder = local_var_req_builder.query(&[("payment_submission_supported", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = payments_enabled { + local_var_req_builder = local_var_req_builder.query(&[("payments_enabled", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = pending_transactions_supported { + local_var_req_builder = local_var_req_builder.query(&[("pending_transactions_supported", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = private_accounts_supported { + local_var_req_builder = local_var_req_builder.query(&[("private_accounts_supported", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = read_debtor_account_supported { + local_var_req_builder = local_var_req_builder.query(&[("read_debtor_account_supported", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = read_refund_account_supported { + local_var_req_builder = local_var_req_builder.query(&[("read_refund_account_supported", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = ssn_verification_supported { + local_var_req_builder = local_var_req_builder.query(&[("ssn_verification_supported", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get details about a specific Institution and its supported features +pub async fn retrieve_institution(configuration: &configuration::Configuration, id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/institutions/{id}/", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/gocardless-bankaccount-data-api/src/apis/mod.rs b/gocardless-bankaccount-data-api/src/apis/mod.rs new file mode 100644 index 0000000..f80faeb --- /dev/null +++ b/gocardless-bankaccount-data-api/src/apis/mod.rs @@ -0,0 +1,108 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + ReqwestMiddleware(reqwest_middleware::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::ReqwestMiddleware(e) => ("reqwest-middleware", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::ReqwestMiddleware(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: reqwest_middleware::Error) -> Self { + Error::ReqwestMiddleware(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod accounts_api; +pub mod agreements_api; +pub mod institutions_api; +pub mod requisitions_api; +pub mod token_api; + +pub mod configuration; diff --git a/gocardless-bankaccount-data-api/src/apis/requisitions_api.rs b/gocardless-bankaccount-data-api/src/apis/requisitions_api.rs new file mode 100644 index 0000000..7713ac6 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/apis/requisitions_api.rs @@ -0,0 +1,198 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`create_requisition`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateRequisitionError { + Status400(models::ErrorResponse), + Status404(models::ErrorResponse), + Status429(models::ErrorResponse), + Status402(models::ErrorResponse), + Status401(models::ErrorResponse), + Status403(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_requisition_by_id`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteRequisitionByIdError { + Status400(models::ErrorResponse), + Status404(models::ErrorResponse), + Status429(models::ErrorResponse), + Status401(models::ErrorResponse), + Status403(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`requisition_by_id`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RequisitionByIdError { + Status404(models::ErrorResponse), + Status400(models::ErrorResponse), + Status429(models::ErrorResponse), + Status401(models::ErrorResponse), + Status403(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`retrieve_all_requisitions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RetrieveAllRequisitionsError { + Status404(models::ErrorResponse), + Status400(models::ErrorResponse), + Status429(models::ErrorResponse), + Status401(models::ErrorResponse), + Status403(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + + +/// Create a new requisition +pub async fn create_requisition(configuration: &configuration::Configuration, requisition_request: models::RequisitionRequest) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/requisitions/", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&requisition_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete requisition and its end user agreement +pub async fn delete_requisition_by_id(configuration: &configuration::Configuration, id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/requisitions/{id}/", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieve a requisition by ID +pub async fn requisition_by_id(configuration: &configuration::Configuration, id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/requisitions/{id}/", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Retrieve all requisitions belonging to the company +pub async fn retrieve_all_requisitions(configuration: &configuration::Configuration, limit: Option, offset: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/requisitions/", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = offset { + local_var_req_builder = local_var_req_builder.query(&[("offset", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/gocardless-bankaccount-data-api/src/apis/token_api.rs b/gocardless-bankaccount-data-api/src/apis/token_api.rs new file mode 100644 index 0000000..5c23559 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/apis/token_api.rs @@ -0,0 +1,102 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_a_new_access_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetANewAccessTokenError { + Status403(models::ErrorResponse), + Status401(models::ErrorResponse), + Status429(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`obtain_new_access_slash_refresh_token_pair`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ObtainNewAccessSlashRefreshTokenPairError { + Status401(models::ErrorResponse), + Status403(models::ErrorResponse), + Status429(models::ErrorResponse), + UnknownValue(serde_json::Value), +} + + +/// Refresh access token +pub async fn get_a_new_access_token(configuration: &configuration::Configuration, jwt_refresh_request: models::JwtRefreshRequest) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/token/refresh/", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&jwt_refresh_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Obtain JWT pair +pub async fn obtain_new_access_slash_refresh_token_pair(configuration: &configuration::Configuration, jwt_obtain_pair_request: models::JwtObtainPairRequest) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v2/token/new/", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&jwt_obtain_pair_request); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/gocardless-bankaccount-data-api/src/lib.rs b/gocardless-bankaccount-data-api/src/lib.rs new file mode 100644 index 0000000..e152062 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate serde_repr; +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/gocardless-bankaccount-data-api/src/models/account.rs b/gocardless-bankaccount-data-api/src/models/account.rs new file mode 100644 index 0000000..57ea72a --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/account.rs @@ -0,0 +1,54 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// Account : AccountSerializer. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Account { + /// The ID of this Account, used to refer to this account in other API calls. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// The date & time at which the account object was created. + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + /// The date & time at which the account object was last accessed. + #[serde(rename = "last_accessed", skip_serializing_if = "Option::is_none")] + pub last_accessed: Option, + /// The Account IBAN + #[serde(rename = "iban", skip_serializing_if = "Option::is_none")] + pub iban: Option, + /// The processing status of this account. + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// The ASPSP associated with this account. + #[serde(rename = "institution_id", skip_serializing_if = "Option::is_none")] + pub institution_id: Option, + /// The name of the account owner. + #[serde(rename = "owner_name", skip_serializing_if = "Option::is_none")] + pub owner_name: Option, +} + +impl Account { + /// AccountSerializer. + pub fn new() -> Account { + Account { + id: None, + created: None, + last_accessed: None, + iban: None, + status: None, + institution_id: None, + owner_name: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/account_balance.rs b/gocardless-bankaccount-data-api/src/models/account_balance.rs new file mode 100644 index 0000000..05efe4b --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/account_balance.rs @@ -0,0 +1,29 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// AccountBalance : AccountBalanceSerializer. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AccountBalance { + #[serde(rename = "balances", skip_serializing_if = "Option::is_none")] + pub balances: Option>, +} + +impl AccountBalance { + /// AccountBalanceSerializer. + pub fn new() -> AccountBalance { + AccountBalance { + balances: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/account_detail.rs b/gocardless-bankaccount-data-api/src/models/account_detail.rs new file mode 100644 index 0000000..604fe79 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/account_detail.rs @@ -0,0 +1,30 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// AccountDetail : AccountDetailSerializer. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AccountDetail { + /// account + #[serde(rename = "account")] + pub account: models::DetailSchema, +} + +impl AccountDetail { + /// AccountDetailSerializer. + pub fn new(account: models::DetailSchema) -> AccountDetail { + AccountDetail { + account, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/account_schema.rs b/gocardless-bankaccount-data-api/src/models/account_schema.rs new file mode 100644 index 0000000..f9feaf2 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/account_schema.rs @@ -0,0 +1,50 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// AccountSchema : AccountSchema. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AccountSchema { + /// iban + #[serde(rename = "iban", skip_serializing_if = "Option::is_none")] + pub iban: Option, + /// bban + #[serde(rename = "bban", skip_serializing_if = "Option::is_none")] + pub bban: Option, + /// pan + #[serde(rename = "pan", skip_serializing_if = "Option::is_none")] + pub pan: Option, + /// maskedPan + #[serde(rename = "maskedPan", skip_serializing_if = "Option::is_none")] + pub masked_pan: Option, + /// msisdn + #[serde(rename = "msisdn", skip_serializing_if = "Option::is_none")] + pub msisdn: Option, + /// currency + #[serde(rename = "currency", skip_serializing_if = "Option::is_none")] + pub currency: Option, +} + +impl AccountSchema { + /// AccountSchema. + pub fn new() -> AccountSchema { + AccountSchema { + iban: None, + bban: None, + pan: None, + masked_pan: None, + msisdn: None, + currency: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/balance_amount_schema.rs b/gocardless-bankaccount-data-api/src/models/balance_amount_schema.rs new file mode 100644 index 0000000..627a138 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/balance_amount_schema.rs @@ -0,0 +1,34 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// BalanceAmountSchema : BalanceAmountSchema. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BalanceAmountSchema { + /// amount + #[serde(rename = "amount")] + pub amount: String, + /// currency + #[serde(rename = "currency")] + pub currency: String, +} + +impl BalanceAmountSchema { + /// BalanceAmountSchema. + pub fn new(amount: String, currency: String) -> BalanceAmountSchema { + BalanceAmountSchema { + amount, + currency, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/balance_schema.rs b/gocardless-bankaccount-data-api/src/models/balance_schema.rs new file mode 100644 index 0000000..47cbe9d --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/balance_schema.rs @@ -0,0 +1,50 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// BalanceSchema : BalanceSchema. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BalanceSchema { + /// balanceAmount + #[serde(rename = "balanceAmount")] + pub balance_amount: models::BalanceAmountSchema, + /// balanceType + #[serde(rename = "balanceType")] + pub balance_type: String, + /// creditLimitIncluded + #[serde(rename = "creditLimitIncluded", skip_serializing_if = "Option::is_none")] + pub credit_limit_included: Option, + /// lastChangeDateTime + #[serde(rename = "lastChangeDateTime", skip_serializing_if = "Option::is_none")] + pub last_change_date_time: Option, + /// referenceDate + #[serde(rename = "referenceDate", skip_serializing_if = "Option::is_none")] + pub reference_date: Option, + /// lastCommittedTransaction + #[serde(rename = "lastCommittedTransaction", skip_serializing_if = "Option::is_none")] + pub last_committed_transaction: Option, +} + +impl BalanceSchema { + /// BalanceSchema. + pub fn new(balance_amount: models::BalanceAmountSchema, balance_type: String) -> BalanceSchema { + BalanceSchema { + balance_amount, + balance_type, + credit_limit_included: None, + last_change_date_time: None, + reference_date: None, + last_committed_transaction: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/bank_transaction.rs b/gocardless-bankaccount-data-api/src/models/bank_transaction.rs new file mode 100644 index 0000000..2c25e8d --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/bank_transaction.rs @@ -0,0 +1,32 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// BankTransaction : BankTransactionSerializer. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BankTransaction { + #[serde(rename = "booked")] + pub booked: Vec, + #[serde(rename = "pending", skip_serializing_if = "Option::is_none")] + pub pending: Option>, +} + +impl BankTransaction { + /// BankTransactionSerializer. + pub fn new(booked: Vec) -> BankTransaction { + BankTransaction { + booked, + pending: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/currency_exchange_schema.rs b/gocardless-bankaccount-data-api/src/models/currency_exchange_schema.rs new file mode 100644 index 0000000..606db24 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/currency_exchange_schema.rs @@ -0,0 +1,50 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// CurrencyExchangeSchema : CurrencyExchangeSchema. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CurrencyExchangeSchema { + /// sourceCurrency + #[serde(rename = "sourceCurrency", skip_serializing_if = "Option::is_none")] + pub source_currency: Option, + /// exchangeRate + #[serde(rename = "exchangeRate", skip_serializing_if = "Option::is_none")] + pub exchange_rate: Option, + /// unitCurrency + #[serde(rename = "unitCurrency", skip_serializing_if = "Option::is_none")] + pub unit_currency: Option, + /// targetCurrency + #[serde(rename = "targetCurrency", skip_serializing_if = "Option::is_none")] + pub target_currency: Option, + /// quotationDate + #[serde(rename = "quotationDate", skip_serializing_if = "Option::is_none")] + pub quotation_date: Option, + /// contractIdentification + #[serde(rename = "contractIdentification", skip_serializing_if = "Option::is_none")] + pub contract_identification: Option, +} + +impl CurrencyExchangeSchema { + /// CurrencyExchangeSchema. + pub fn new() -> CurrencyExchangeSchema { + CurrencyExchangeSchema { + source_currency: None, + exchange_rate: None, + unit_currency: None, + target_currency: None, + quotation_date: None, + contract_identification: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/detail_schema.rs b/gocardless-bankaccount-data-api/src/models/detail_schema.rs new file mode 100644 index 0000000..2333b01 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/detail_schema.rs @@ -0,0 +1,98 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// DetailSchema : DetailSchema. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DetailSchema { + /// resourceId + #[serde(rename = "resourceId", skip_serializing_if = "Option::is_none")] + pub resource_id: Option, + /// iban + #[serde(rename = "iban", skip_serializing_if = "Option::is_none")] + pub iban: Option, + /// bban + #[serde(rename = "bban", skip_serializing_if = "Option::is_none")] + pub bban: Option, + /// msisdn + #[serde(rename = "msisdn", skip_serializing_if = "Option::is_none")] + pub msisdn: Option, + /// currency + #[serde(rename = "currency", skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// ownerName + #[serde(rename = "ownerName", skip_serializing_if = "Option::is_none")] + pub owner_name: Option, + /// name + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// displayName + #[serde(rename = "displayName", skip_serializing_if = "Option::is_none")] + pub display_name: Option, + /// product + #[serde(rename = "product", skip_serializing_if = "Option::is_none")] + pub product: Option, + /// cashAccountType + #[serde(rename = "cashAccountType", skip_serializing_if = "Option::is_none")] + pub cash_account_type: Option, + /// status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// bic + #[serde(rename = "bic", skip_serializing_if = "Option::is_none")] + pub bic: Option, + /// linkedAccounts + #[serde(rename = "linkedAccounts", skip_serializing_if = "Option::is_none")] + pub linked_accounts: Option, + /// maskedPan + #[serde(rename = "maskedPan", skip_serializing_if = "Option::is_none")] + pub masked_pan: Option, + /// usage + #[serde(rename = "usage", skip_serializing_if = "Option::is_none")] + pub usage: Option, + /// details + #[serde(rename = "details", skip_serializing_if = "Option::is_none")] + pub details: Option, + /// ownerAddressUnstructured + #[serde(rename = "ownerAddressUnstructured", skip_serializing_if = "Option::is_none")] + pub owner_address_unstructured: Option>, + /// ownerAddressStructured + #[serde(rename = "ownerAddressStructured", skip_serializing_if = "Option::is_none")] + pub owner_address_structured: Option, +} + +impl DetailSchema { + /// DetailSchema. + pub fn new() -> DetailSchema { + DetailSchema { + resource_id: None, + iban: None, + bban: None, + msisdn: None, + currency: None, + owner_name: None, + name: None, + display_name: None, + product: None, + cash_account_type: None, + status: None, + bic: None, + linked_accounts: None, + masked_pan: None, + usage: None, + details: None, + owner_address_unstructured: None, + owner_address_structured: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/end_user_agreement.rs b/gocardless-bankaccount-data-api/src/models/end_user_agreement.rs new file mode 100644 index 0000000..3663237 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/end_user_agreement.rs @@ -0,0 +1,54 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// EndUserAgreement : Represents an end-user agreement. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EndUserAgreement { + /// The ID of this End User Agreement, used to refer to this end user agreement in other API calls. + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// The date & time at which the end user agreement was created. + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + /// an Institution ID for this EUA + #[serde(rename = "institution_id")] + pub institution_id: String, + /// Maximum number of days of transaction data to retrieve. + #[serde(rename = "max_historical_days", skip_serializing_if = "Option::is_none")] + pub max_historical_days: Option, + /// Number of days from acceptance that the access can be used. + #[serde(rename = "access_valid_for_days", skip_serializing_if = "Option::is_none")] + pub access_valid_for_days: Option, + /// Array containing one or several values of ['balances', 'details', 'transactions'] + #[serde(rename = "access_scope", skip_serializing_if = "Option::is_none")] + pub access_scope: Option>, + /// The date & time at which the end user accepted the agreement. + #[serde(rename = "accepted", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub accepted: Option>, +} + +impl EndUserAgreement { + /// Represents an end-user agreement. + pub fn new(institution_id: String) -> EndUserAgreement { + EndUserAgreement { + id: None, + created: None, + institution_id, + max_historical_days: None, + access_valid_for_days: None, + access_scope: None, + accepted: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/end_user_agreement_request.rs b/gocardless-bankaccount-data-api/src/models/end_user_agreement_request.rs new file mode 100644 index 0000000..cbfd390 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/end_user_agreement_request.rs @@ -0,0 +1,42 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// EndUserAgreementRequest : Represents an end-user agreement. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EndUserAgreementRequest { + /// an Institution ID for this EUA + #[serde(rename = "institution_id")] + pub institution_id: String, + /// Maximum number of days of transaction data to retrieve. + #[serde(rename = "max_historical_days", skip_serializing_if = "Option::is_none")] + pub max_historical_days: Option, + /// Number of days from acceptance that the access can be used. + #[serde(rename = "access_valid_for_days", skip_serializing_if = "Option::is_none")] + pub access_valid_for_days: Option, + /// Array containing one or several values of ['balances', 'details', 'transactions'] + #[serde(rename = "access_scope", skip_serializing_if = "Option::is_none")] + pub access_scope: Option>, +} + +impl EndUserAgreementRequest { + /// Represents an end-user agreement. + pub fn new(institution_id: String) -> EndUserAgreementRequest { + EndUserAgreementRequest { + institution_id, + max_historical_days: None, + access_valid_for_days: None, + access_scope: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/enduser_acceptance_details_request.rs b/gocardless-bankaccount-data-api/src/models/enduser_acceptance_details_request.rs new file mode 100644 index 0000000..8738f33 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/enduser_acceptance_details_request.rs @@ -0,0 +1,32 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// EnduserAcceptanceDetailsRequest : Represents end-user details. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EnduserAcceptanceDetailsRequest { + #[serde(rename = "user_agent")] + pub user_agent: String, + #[serde(rename = "ip_address")] + pub ip_address: String, +} + +impl EnduserAcceptanceDetailsRequest { + /// Represents end-user details. + pub fn new(user_agent: String, ip_address: String) -> EnduserAcceptanceDetailsRequest { + EnduserAcceptanceDetailsRequest { + user_agent, + ip_address, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/error_response.rs b/gocardless-bankaccount-data-api/src/models/error_response.rs new file mode 100644 index 0000000..d03a321 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/error_response.rs @@ -0,0 +1,36 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ErrorResponse { + #[serde(rename = "summary")] + pub summary: String, + #[serde(rename = "detail")] + pub detail: String, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "status_code")] + pub status_code: i32, +} + +impl ErrorResponse { + pub fn new(summary: String, detail: String, status_code: i32) -> ErrorResponse { + ErrorResponse { + summary, + detail, + r#type: None, + status_code, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/integration.rs b/gocardless-bankaccount-data-api/src/models/integration.rs new file mode 100644 index 0000000..c0068cc --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/integration.rs @@ -0,0 +1,44 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// Integration : Represents an Integration. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Integration { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "bic", skip_serializing_if = "Option::is_none")] + pub bic: Option, + #[serde(rename = "transaction_total_days", skip_serializing_if = "Option::is_none")] + pub transaction_total_days: Option, + #[serde(rename = "countries")] + pub countries: Vec, + #[serde(rename = "logo")] + pub logo: String, +} + +impl Integration { + /// Represents an Integration. + pub fn new(id: String, name: String, countries: Vec, logo: String) -> Integration { + Integration { + id, + name, + bic: None, + transaction_total_days: None, + countries, + logo, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/integration_retrieve.rs b/gocardless-bankaccount-data-api/src/models/integration_retrieve.rs new file mode 100644 index 0000000..668efda --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/integration_retrieve.rs @@ -0,0 +1,53 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// IntegrationRetrieve : IntegrationSerializer for Retrieve endpoint. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IntegrationRetrieve { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "bic", skip_serializing_if = "Option::is_none")] + pub bic: Option, + #[serde(rename = "transaction_total_days", skip_serializing_if = "Option::is_none")] + pub transaction_total_days: Option, + #[serde(rename = "countries")] + pub countries: Vec, + #[serde(rename = "logo")] + pub logo: String, + #[serde(rename = "supported_payments")] + pub supported_payments: std::collections::HashMap, + #[serde(rename = "supported_features")] + pub supported_features: Vec, + #[serde(rename = "identification_codes")] + pub identification_codes: Vec, +} + +impl IntegrationRetrieve { + /// IntegrationSerializer for Retrieve endpoint. + pub fn new(id: String, name: String, countries: Vec, logo: String, supported_payments: std::collections::HashMap, supported_features: Vec, identification_codes: Vec) -> IntegrationRetrieve { + IntegrationRetrieve { + id, + name, + bic: None, + transaction_total_days: None, + countries, + logo, + supported_payments, + supported_features, + identification_codes, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/jwt_obtain_pair_request.rs b/gocardless-bankaccount-data-api/src/models/jwt_obtain_pair_request.rs new file mode 100644 index 0000000..2a26e58 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/jwt_obtain_pair_request.rs @@ -0,0 +1,34 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// JwtObtainPairRequest : Obtain JWT pair. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct JwtObtainPairRequest { + /// Secret id from /user-secrets/ + #[serde(rename = "secret_id")] + pub secret_id: String, + /// Secret key from /user-secrets/ + #[serde(rename = "secret_key")] + pub secret_key: String, +} + +impl JwtObtainPairRequest { + /// Obtain JWT pair. + pub fn new(secret_id: String, secret_key: String) -> JwtObtainPairRequest { + JwtObtainPairRequest { + secret_id, + secret_key, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/jwt_refresh_request.rs b/gocardless-bankaccount-data-api/src/models/jwt_refresh_request.rs new file mode 100644 index 0000000..0fb968d --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/jwt_refresh_request.rs @@ -0,0 +1,29 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// JwtRefreshRequest : Refresh access token. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct JwtRefreshRequest { + #[serde(rename = "refresh")] + pub refresh: String, +} + +impl JwtRefreshRequest { + /// Refresh access token. + pub fn new(refresh: String) -> JwtRefreshRequest { + JwtRefreshRequest { + refresh, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/mod.rs b/gocardless-bankaccount-data-api/src/models/mod.rs new file mode 100644 index 0000000..4c967c9 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/mod.rs @@ -0,0 +1,56 @@ +pub mod account; +pub use self::account::Account; +pub mod account_balance; +pub use self::account_balance::AccountBalance; +pub mod account_detail; +pub use self::account_detail::AccountDetail; +pub mod account_schema; +pub use self::account_schema::AccountSchema; +pub mod balance_amount_schema; +pub use self::balance_amount_schema::BalanceAmountSchema; +pub mod balance_schema; +pub use self::balance_schema::BalanceSchema; +pub mod bank_transaction; +pub use self::bank_transaction::BankTransaction; +pub mod currency_exchange_schema; +pub use self::currency_exchange_schema::CurrencyExchangeSchema; +pub mod detail_schema; +pub use self::detail_schema::DetailSchema; +pub mod end_user_agreement; +pub use self::end_user_agreement::EndUserAgreement; +pub mod end_user_agreement_request; +pub use self::end_user_agreement_request::EndUserAgreementRequest; +pub mod enduser_acceptance_details_request; +pub use self::enduser_acceptance_details_request::EnduserAcceptanceDetailsRequest; +pub mod error_response; +pub use self::error_response::ErrorResponse; +pub mod integration; +pub use self::integration::Integration; +pub mod integration_retrieve; +pub use self::integration_retrieve::IntegrationRetrieve; +pub mod jwt_obtain_pair_request; +pub use self::jwt_obtain_pair_request::JwtObtainPairRequest; +pub mod jwt_refresh_request; +pub use self::jwt_refresh_request::JwtRefreshRequest; +pub mod owner_address_structured_schema; +pub use self::owner_address_structured_schema::OwnerAddressStructuredSchema; +pub mod paginated_end_user_agreement_list; +pub use self::paginated_end_user_agreement_list::PaginatedEndUserAgreementList; +pub mod paginated_requisition_list; +pub use self::paginated_requisition_list::PaginatedRequisitionList; +pub mod requisition; +pub use self::requisition::Requisition; +pub mod requisition_request; +pub use self::requisition_request::RequisitionRequest; +pub mod spectacular_jwt_obtain; +pub use self::spectacular_jwt_obtain::SpectacularJwtObtain; +pub mod spectacular_jwt_refresh; +pub use self::spectacular_jwt_refresh::SpectacularJwtRefresh; +pub mod spectacular_requisition; +pub use self::spectacular_requisition::SpectacularRequisition; +pub mod status_enum; +pub use self::status_enum::StatusEnum; +pub mod transaction_amount_schema; +pub use self::transaction_amount_schema::TransactionAmountSchema; +pub mod transaction_schema; +pub use self::transaction_schema::TransactionSchema; diff --git a/gocardless-bankaccount-data-api/src/models/owner_address_structured_schema.rs b/gocardless-bankaccount-data-api/src/models/owner_address_structured_schema.rs new file mode 100644 index 0000000..a1c5e18 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/owner_address_structured_schema.rs @@ -0,0 +1,46 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// OwnerAddressStructuredSchema : OwnerAddressStructuredSchema. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OwnerAddressStructuredSchema { + /// streetName + #[serde(rename = "streetName", skip_serializing_if = "Option::is_none")] + pub street_name: Option, + /// buildingNumber + #[serde(rename = "buildingNumber", skip_serializing_if = "Option::is_none")] + pub building_number: Option, + /// townName + #[serde(rename = "townName", skip_serializing_if = "Option::is_none")] + pub town_name: Option, + /// postCode + #[serde(rename = "postCode", skip_serializing_if = "Option::is_none")] + pub post_code: Option, + /// country + #[serde(rename = "country", skip_serializing_if = "Option::is_none")] + pub country: Option, +} + +impl OwnerAddressStructuredSchema { + /// OwnerAddressStructuredSchema. + pub fn new() -> OwnerAddressStructuredSchema { + OwnerAddressStructuredSchema { + street_name: None, + building_number: None, + town_name: None, + post_code: None, + country: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/paginated_end_user_agreement_list.rs b/gocardless-bankaccount-data-api/src/models/paginated_end_user_agreement_list.rs new file mode 100644 index 0000000..bb0e7a0 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/paginated_end_user_agreement_list.rs @@ -0,0 +1,36 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedEndUserAgreementList { + #[serde(rename = "count")] + pub count: i32, + #[serde(rename = "next", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub next: Option>, + #[serde(rename = "previous", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub previous: Option>, + #[serde(rename = "results")] + pub results: Vec, +} + +impl PaginatedEndUserAgreementList { + pub fn new(count: i32, results: Vec) -> PaginatedEndUserAgreementList { + PaginatedEndUserAgreementList { + count, + next: None, + previous: None, + results, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/paginated_requisition_list.rs b/gocardless-bankaccount-data-api/src/models/paginated_requisition_list.rs new file mode 100644 index 0000000..c19382f --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/paginated_requisition_list.rs @@ -0,0 +1,36 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedRequisitionList { + #[serde(rename = "count")] + pub count: i32, + #[serde(rename = "next", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub next: Option>, + #[serde(rename = "previous", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub previous: Option>, + #[serde(rename = "results")] + pub results: Vec, +} + +impl PaginatedRequisitionList { + pub fn new(count: i32, results: Vec) -> PaginatedRequisitionList { + PaginatedRequisitionList { + count, + next: None, + previous: None, + results, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/requisition.rs b/gocardless-bankaccount-data-api/src/models/requisition.rs new file mode 100644 index 0000000..c992cf7 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/requisition.rs @@ -0,0 +1,77 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// Requisition : RequisitionSerializer. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Requisition { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// The date & time at which the requisition was created. + #[serde(rename = "created", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub created: Option>, + /// redirect URL to your application after end-user authorization with ASPSP + #[serde(rename = "redirect", deserialize_with = "Option::deserialize")] + pub redirect: Option, + /// status of this requisition + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// an Institution ID for this Requisition + #[serde(rename = "institution_id")] + pub institution_id: String, + /// EUA associated with this requisition + #[serde(rename = "agreement", skip_serializing_if = "Option::is_none")] + pub agreement: Option, + /// additional ID to identify the end user + #[serde(rename = "reference", skip_serializing_if = "Option::is_none")] + pub reference: Option, + /// array of account IDs retrieved within a scope of this requisition + #[serde(rename = "accounts", skip_serializing_if = "Option::is_none")] + pub accounts: Option>, + /// A two-letter country code (ISO 639-1) + #[serde(rename = "user_language", skip_serializing_if = "Option::is_none")] + pub user_language: Option, + /// link to initiate authorization with Institution + #[serde(rename = "link", skip_serializing_if = "Option::is_none")] + pub link: Option, + /// optional SSN field to verify ownership of the account + #[serde(rename = "ssn", skip_serializing_if = "Option::is_none")] + pub ssn: Option, + /// option to enable account selection view for the end user + #[serde(rename = "account_selection", skip_serializing_if = "Option::is_none")] + pub account_selection: Option, + /// enable redirect back to the client after account list received + #[serde(rename = "redirect_immediate", skip_serializing_if = "Option::is_none")] + pub redirect_immediate: Option, +} + +impl Requisition { + /// RequisitionSerializer. + pub fn new(redirect: Option, institution_id: String) -> Requisition { + Requisition { + id: None, + created: None, + redirect, + status: None, + institution_id, + agreement: None, + reference: None, + accounts: None, + user_language: None, + link: None, + ssn: None, + account_selection: None, + redirect_immediate: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/requisition_request.rs b/gocardless-bankaccount-data-api/src/models/requisition_request.rs new file mode 100644 index 0000000..0275388 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/requisition_request.rs @@ -0,0 +1,58 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// RequisitionRequest : RequisitionSerializer. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RequisitionRequest { + /// redirect URL to your application after end-user authorization with ASPSP + #[serde(rename = "redirect", deserialize_with = "Option::deserialize")] + pub redirect: Option, + /// an Institution ID for this Requisition + #[serde(rename = "institution_id")] + pub institution_id: String, + /// EUA associated with this requisition + #[serde(rename = "agreement", skip_serializing_if = "Option::is_none")] + pub agreement: Option, + /// additional ID to identify the end user + #[serde(rename = "reference", skip_serializing_if = "Option::is_none")] + pub reference: Option, + /// A two-letter country code (ISO 639-1) + #[serde(rename = "user_language", skip_serializing_if = "Option::is_none")] + pub user_language: Option, + /// optional SSN field to verify ownership of the account + #[serde(rename = "ssn", skip_serializing_if = "Option::is_none")] + pub ssn: Option, + /// option to enable account selection view for the end user + #[serde(rename = "account_selection", skip_serializing_if = "Option::is_none")] + pub account_selection: Option, + /// enable redirect back to the client after account list received + #[serde(rename = "redirect_immediate", skip_serializing_if = "Option::is_none")] + pub redirect_immediate: Option, +} + +impl RequisitionRequest { + /// RequisitionSerializer. + pub fn new(redirect: Option, institution_id: String) -> RequisitionRequest { + RequisitionRequest { + redirect, + institution_id, + agreement: None, + reference: None, + user_language: None, + ssn: None, + account_selection: None, + redirect_immediate: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/spectacular_jwt_obtain.rs b/gocardless-bankaccount-data-api/src/models/spectacular_jwt_obtain.rs new file mode 100644 index 0000000..03eaaab --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/spectacular_jwt_obtain.rs @@ -0,0 +1,42 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// SpectacularJwtObtain : Obtain new JWT pair. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SpectacularJwtObtain { + /// Your access token + #[serde(rename = "access", skip_serializing_if = "Option::is_none")] + pub access: Option, + /// Access token expires in seconds + #[serde(rename = "access_expires", skip_serializing_if = "Option::is_none")] + pub access_expires: Option, + /// Your refresh token + #[serde(rename = "refresh", skip_serializing_if = "Option::is_none")] + pub refresh: Option, + /// Refresh token expires in seconds + #[serde(rename = "refresh_expires", skip_serializing_if = "Option::is_none")] + pub refresh_expires: Option, +} + +impl SpectacularJwtObtain { + /// Obtain new JWT pair. + pub fn new() -> SpectacularJwtObtain { + SpectacularJwtObtain { + access: None, + access_expires: None, + refresh: None, + refresh_expires: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/spectacular_jwt_refresh.rs b/gocardless-bankaccount-data-api/src/models/spectacular_jwt_refresh.rs new file mode 100644 index 0000000..a68736e --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/spectacular_jwt_refresh.rs @@ -0,0 +1,34 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// SpectacularJwtRefresh : Refresh Access token. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SpectacularJwtRefresh { + /// Your access token + #[serde(rename = "access", skip_serializing_if = "Option::is_none")] + pub access: Option, + /// Access token expires in seconds + #[serde(rename = "access_expires", skip_serializing_if = "Option::is_none")] + pub access_expires: Option, +} + +impl SpectacularJwtRefresh { + /// Refresh Access token. + pub fn new() -> SpectacularJwtRefresh { + SpectacularJwtRefresh { + access: None, + access_expires: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/spectacular_requisition.rs b/gocardless-bankaccount-data-api/src/models/spectacular_requisition.rs new file mode 100644 index 0000000..e644296 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/spectacular_requisition.rs @@ -0,0 +1,77 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// SpectacularRequisition : Create requisition. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SpectacularRequisition { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// The date & time at which the requisition was created. + #[serde(rename = "created", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub created: Option>, + /// redirect URL to your application after end-user authorization with ASPSP + #[serde(rename = "redirect", deserialize_with = "Option::deserialize")] + pub redirect: Option, + /// status of this requisition + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// an Institution ID for this Requisition + #[serde(rename = "institution_id")] + pub institution_id: String, + /// EUA associated with this requisition + #[serde(rename = "agreement", skip_serializing_if = "Option::is_none")] + pub agreement: Option, + /// additional ID to identify the end user + #[serde(rename = "reference", skip_serializing_if = "Option::is_none")] + pub reference: Option, + /// array of account IDs retrieved within a scope of this requisition + #[serde(rename = "accounts", skip_serializing_if = "Option::is_none")] + pub accounts: Option>, + /// A two-letter country code (ISO 639-1) + #[serde(rename = "user_language", skip_serializing_if = "Option::is_none")] + pub user_language: Option, + /// link to initiate authorization with Institution + #[serde(rename = "link", skip_serializing_if = "Option::is_none")] + pub link: Option, + /// optional SSN field to verify ownership of the account + #[serde(rename = "ssn", skip_serializing_if = "Option::is_none")] + pub ssn: Option, + /// option to enable account selection view for the end user + #[serde(rename = "account_selection", skip_serializing_if = "Option::is_none")] + pub account_selection: Option, + /// enable redirect back to the client after account list received + #[serde(rename = "redirect_immediate", skip_serializing_if = "Option::is_none")] + pub redirect_immediate: Option, +} + +impl SpectacularRequisition { + /// Create requisition. + pub fn new(redirect: Option, institution_id: String) -> SpectacularRequisition { + SpectacularRequisition { + id: None, + created: None, + redirect, + status: None, + institution_id, + agreement: None, + reference: None, + accounts: None, + user_language: None, + link: None, + ssn: None, + account_selection: None, + redirect_immediate: None, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/status_enum.rs b/gocardless-bankaccount-data-api/src/models/status_enum.rs new file mode 100644 index 0000000..883c84e --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/status_enum.rs @@ -0,0 +1,65 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum StatusEnum { + #[serde(rename = "CR")] + Cr, + #[serde(rename = "ID")] + Id, + #[serde(rename = "LN")] + Ln, + #[serde(rename = "RJ")] + Rj, + #[serde(rename = "ER")] + Er, + #[serde(rename = "SU")] + Su, + #[serde(rename = "EX")] + Ex, + #[serde(rename = "GC")] + Gc, + #[serde(rename = "UA")] + Ua, + #[serde(rename = "GA")] + Ga, + #[serde(rename = "SA")] + Sa, + +} + +impl std::fmt::Display for StatusEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Cr => write!(f, "CR"), + Self::Id => write!(f, "ID"), + Self::Ln => write!(f, "LN"), + Self::Rj => write!(f, "RJ"), + Self::Er => write!(f, "ER"), + Self::Su => write!(f, "SU"), + Self::Ex => write!(f, "EX"), + Self::Gc => write!(f, "GC"), + Self::Ua => write!(f, "UA"), + Self::Ga => write!(f, "GA"), + Self::Sa => write!(f, "SA"), + } + } +} + +impl Default for StatusEnum { + fn default() -> StatusEnum { + Self::Cr + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/transaction_amount_schema.rs b/gocardless-bankaccount-data-api/src/models/transaction_amount_schema.rs new file mode 100644 index 0000000..81f5bfb --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/transaction_amount_schema.rs @@ -0,0 +1,34 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// TransactionAmountSchema : TransactionAmountSchema. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionAmountSchema { + /// amount + #[serde(rename = "amount")] + pub amount: String, + /// currency + #[serde(rename = "currency")] + pub currency: String, +} + +impl TransactionAmountSchema { + /// TransactionAmountSchema. + pub fn new(amount: String, currency: String) -> TransactionAmountSchema { + TransactionAmountSchema { + amount, + currency, + } + } +} + diff --git a/gocardless-bankaccount-data-api/src/models/transaction_schema.rs b/gocardless-bankaccount-data-api/src/models/transaction_schema.rs new file mode 100644 index 0000000..b54e160 --- /dev/null +++ b/gocardless-bankaccount-data-api/src/models/transaction_schema.rs @@ -0,0 +1,133 @@ +/* + * GoCardless Bank Account Data API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.0 (v2) + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// TransactionSchema : TransactionSchema. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionSchema { + /// transactionId + #[serde(rename = "transactionId", skip_serializing_if = "Option::is_none")] + pub transaction_id: Option, + /// entryReference + #[serde(rename = "entryReference", skip_serializing_if = "Option::is_none")] + pub entry_reference: Option, + /// endToEndId + #[serde(rename = "endToEndId", skip_serializing_if = "Option::is_none")] + pub end_to_end_id: Option, + /// mandateId + #[serde(rename = "mandateId", skip_serializing_if = "Option::is_none")] + pub mandate_id: Option, + /// checkId + #[serde(rename = "checkId", skip_serializing_if = "Option::is_none")] + pub check_id: Option, + /// creditorId + #[serde(rename = "creditorId", skip_serializing_if = "Option::is_none")] + pub creditor_id: Option, + /// bookingDate + #[serde(rename = "bookingDate", skip_serializing_if = "Option::is_none")] + pub booking_date: Option, + /// valueDate + #[serde(rename = "valueDate", skip_serializing_if = "Option::is_none")] + pub value_date: Option, + /// bookingDateTime + #[serde(rename = "bookingDateTime", skip_serializing_if = "Option::is_none")] + pub booking_date_time: Option, + /// valueDateTime + #[serde(rename = "valueDateTime", skip_serializing_if = "Option::is_none")] + pub value_date_time: Option, + /// transactionAmount + #[serde(rename = "transactionAmount")] + pub transaction_amount: models::TransactionAmountSchema, + #[serde(rename = "currencyExchange", skip_serializing_if = "Option::is_none")] + pub currency_exchange: Option>, + /// creditorName + #[serde(rename = "creditorName", skip_serializing_if = "Option::is_none")] + pub creditor_name: Option, + /// creditorAccount + #[serde(rename = "creditorAccount", skip_serializing_if = "Option::is_none")] + pub creditor_account: Option, + /// ultimateCreditor + #[serde(rename = "ultimateCreditor", skip_serializing_if = "Option::is_none")] + pub ultimate_creditor: Option, + /// debtorName + #[serde(rename = "debtorName", skip_serializing_if = "Option::is_none")] + pub debtor_name: Option, + /// debtorAccount + #[serde(rename = "debtorAccount", skip_serializing_if = "Option::is_none")] + pub debtor_account: Option, + /// ultimateDebtor + #[serde(rename = "ultimateDebtor", skip_serializing_if = "Option::is_none")] + pub ultimate_debtor: Option, + /// remittanceInformationUnstructured + #[serde(rename = "remittanceInformationUnstructured", skip_serializing_if = "Option::is_none")] + pub remittance_information_unstructured: Option, + /// remittanceInformationUnstructuredArray + #[serde(rename = "remittanceInformationUnstructuredArray", skip_serializing_if = "Option::is_none")] + pub remittance_information_unstructured_array: Option>, + /// remittanceInformationStructured + #[serde(rename = "remittanceInformationStructured", skip_serializing_if = "Option::is_none")] + pub remittance_information_structured: Option, + /// remittanceInformationStructuredArray + #[serde(rename = "remittanceInformationStructuredArray", skip_serializing_if = "Option::is_none")] + pub remittance_information_structured_array: Option>, + /// additionalInformation + #[serde(rename = "additionalInformation", skip_serializing_if = "Option::is_none")] + pub additional_information: Option, + /// purposeCode + #[serde(rename = "purposeCode", skip_serializing_if = "Option::is_none")] + pub purpose_code: Option, + /// bankTransactionCode + #[serde(rename = "bankTransactionCode", skip_serializing_if = "Option::is_none")] + pub bank_transaction_code: Option, + /// proprietaryBankTransactionCode + #[serde(rename = "proprietaryBankTransactionCode", skip_serializing_if = "Option::is_none")] + pub proprietary_bank_transaction_code: Option, + /// internalTransactionId + #[serde(rename = "internalTransactionId", skip_serializing_if = "Option::is_none")] + pub internal_transaction_id: Option, +} + +impl TransactionSchema { + /// TransactionSchema. + pub fn new(transaction_amount: models::TransactionAmountSchema) -> TransactionSchema { + TransactionSchema { + transaction_id: None, + entry_reference: None, + end_to_end_id: None, + mandate_id: None, + check_id: None, + creditor_id: None, + booking_date: None, + value_date: None, + booking_date_time: None, + value_date_time: None, + transaction_amount, + currency_exchange: None, + creditor_name: None, + creditor_account: None, + ultimate_creditor: None, + debtor_name: None, + debtor_account: None, + ultimate_debtor: None, + remittance_information_unstructured: None, + remittance_information_unstructured_array: None, + remittance_information_structured: None, + remittance_information_structured_array: None, + additional_information: None, + purpose_code: None, + bank_transaction_code: None, + proprietary_bank_transaction_code: None, + internal_transaction_id: None, + } + } +} + diff --git a/gocardless_bank_account_data_api_v2.json b/gocardless_bank_account_data_api_v2.json new file mode 100644 index 0000000..47219f1 --- /dev/null +++ b/gocardless_bank_account_data_api_v2.json @@ -0,0 +1,4641 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "GoCardless Bank Account Data API", + "version": "2.0 (v2)" + }, + "paths": { + "/api/v2/accounts/{id}/": { + "get": { + "operationId": "retrieve account metadata", + "description": "Access account metadata.\n\nInformation about the account record, such as the processing status and IBAN.\n\nAccount status is recalculated based on the error count in the latest req.", + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string" + }, + "required": true + } + ], + "tags": [ + "accounts" + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Account" + } + } + }, + "description": "Sample account metadata" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NotFoundError": { + "value": { + "detail": "Not found.", + "summary": "Not found.", + "status_code": 404 + }, + "summary": "Not found error", + "description": "Not found error" + }, + "AccountNotFoundError": { + "value": { + "summary": "Account ID $ACC_ID not found", + "detail": "Please check whether you specified a valid Account ID", + "status_code": 404 + }, + "summary": "Account not found error", + "description": "Account not found" + } + } + } + }, + "description": "Account not found" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + } + } + } + }, + "description": "Nordigen rate limit exceeded" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + } + } + } + }, + "description": "Token is invalid or expired" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + } + } + } + }, + "description": "IP address not whitelisted" + } + } + } + }, + "/api/v2/accounts/{id}/balances/": { + "get": { + "operationId": "retrieve account balances", + "description": "Access account balances.\n\nBalances will be returned in Berlin Group PSD2 format.", + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string" + }, + "required": true + } + ], + "tags": [ + "accounts" + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountBalance" + }, + "examples": { + "RetrieveAccountBalances": { + "value": { + "balances": [ + { + "balanceAmount": { + "amount": "657.49", + "currency": "string" + }, + "balanceType": "string", + "referenceDate": "2021-11-22" + }, + { + "balanceAmount": { + "amount": "185.67", + "currency": "string" + }, + "balanceType": "string", + "referenceDate": "2021-11-19" + } + ] + }, + "summary": "Account balances", + "description": "Sample account balances" + } + } + } + }, + "description": "Sample account balances" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NotFoundError": { + "value": { + "detail": "Not found.", + "summary": "Not found.", + "status_code": 404 + }, + "summary": "Not found error", + "description": "Not found error" + }, + "AccountNotFoundError": { + "value": { + "summary": "Account ID $ACC_ID not found", + "detail": "Please check whether you specified a valid Account ID", + "status_code": 404 + }, + "summary": "Account not found error", + "description": "Account not found" + } + } + } + }, + "description": "Account not found" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + }, + "RateLimitError": { + "value": { + "summary": "Couldn't update account balances", + "detail": "Daily request limit set by the Institution has been exceeded.", + "type": "RateLimitError", + "status_code": 429 + }, + "summary": "Rate Limit Error", + "description": "RateLimitError" + } + } + } + }, + "description": "RateLimitError" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + }, + "AccessExpiredError": { + "value": { + "summary": "Couldn't update account balances", + "detail": "Access has expired or it has been revoked. To restore access reconnect the account.", + "type": "AccessExpiredError", + "status_code": 401 + }, + "summary": "Access Expired Error", + "description": "AccessExpiredError" + }, + "AccountInactiveError": { + "value": { + "summary": "Couldn't update account balances", + "detail": "Account has been deactivated or it no longer exists.", + "type": "AccountInactiveError", + "status_code": 401 + }, + "summary": "Account Inactive Error", + "description": "AccountInactiveError" + } + } + } + }, + "description": "AccountInactiveError" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + }, + "AccountEUAScopeError": { + "value": { + "summary": "End User Agreement (EUA) access scope error", + "detail": "EUA doesn't allow access to account balances. Check EUA access scope. Or create new EUA with correct access scope", + "status_code": 403 + }, + "summary": "Account EUA scope error", + "description": "EUA doesn't allow access to account balances." + }, + "AccountValidEUAError": { + "value": { + "summary": "No valid End User Agreement", + "detail": "Account exists but there is no valid End User Agreement permitting you to access it", + "status_code": 403 + }, + "summary": "Account valid EUA error", + "description": "Account has no valid End User Agreement" + }, + "AccountAccessForbidden": { + "value": { + "summary": "Couldn't update account balances", + "detail": "Access to account is forbidden. The user might not have the necessary permissions.", + "type": "AccountAccessForbidden", + "status_code": 403 + }, + "summary": "Account Access Forbidden", + "description": "AccountAccessForbidden" + } + } + } + }, + "description": "AccountAccessForbidden" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidID": { + "value": { + "summary": "Invalid Account ID", + "detail": "$ACCOUNT_ID is not a valid Account UUID. ", + "status_code": 400 + }, + "summary": "Invalid ID", + "description": "Invalid Account ID" + } + } + } + }, + "description": "Invalid Account ID" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "UnknownRequestError": { + "value": { + "summary": "Couldn't update account balances", + "detail": "Request to Institution returned an error", + "type": "UnknownRequestError", + "status_code": 500 + }, + "summary": "Unknown Request Error", + "description": "Couldn't update account balances" + } + } + } + }, + "description": "Couldn't update account balances" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "AccountSuspendedError": { + "value": { + "summary": "Account suspended", + "detail": "This account or its requisition was suspended due to numerous errors that occurred while accessing it.", + "status_code": 409 + }, + "summary": "Account suspended error", + "description": "Account or its requisition suspended" + }, + "AccountStateError": { + "value": { + "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "created": "2024-10-04 18:06:13.681544+00:00", + "last_accessed": "2024-10-04 18:06:13.681558+00:00", + "iban": "string", + "aspsp_identifier": "string", + "status": "ERROR" + }, + "summary": "Account state error", + "description": "Account state does not support this operation" + } + } + } + }, + "description": "Account state does not support this operation" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "ServiceError": { + "value": { + "summary": "Couldn't update account balances", + "detail": "Institution service unavailable", + "type": "ServiceError", + "status_code": 503 + }, + "summary": "Service Error", + "description": "ServiceError" + }, + "ConnectionError": { + "value": { + "summary": "Couldn't update account balances", + "detail": "Couldn't connect to Institution", + "type": "ConnectionError", + "status_code": 503 + }, + "summary": "Connection Error", + "description": "ConnectionError" + } + } + } + }, + "description": "ConnectionError" + } + } + } + }, + "/api/v2/accounts/{id}/details/": { + "get": { + "operationId": "retrieve account details", + "description": "Access account details.\n\nAccount details will be returned in Berlin Group PSD2 format.", + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string" + }, + "required": true + } + ], + "tags": [ + "accounts" + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountDetail" + }, + "examples": { + "RetrieveAccountDetails": { + "value": { + "account": { + "resourceId": "string", + "iban": "string", + "currency": "string", + "ownerName": "string", + "name": "string", + "product": "string", + "cashAccountType": "string" + } + }, + "summary": "Sample account details", + "description": "Sample account details" + } + } + } + }, + "description": "Sample account details" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NotFoundError": { + "value": { + "detail": "Not found.", + "summary": "Not found.", + "status_code": 404 + }, + "summary": "Not found error", + "description": "Not found error" + }, + "AccountNotFoundError": { + "value": { + "summary": "Account ID $ACC_ID not found", + "detail": "Please check whether you specified a valid Account ID", + "status_code": 404 + }, + "summary": "Account not found error", + "description": "Account not found" + } + } + } + }, + "description": "Account not found" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + }, + "RateLimitError": { + "value": { + "summary": "Couldn't update account details", + "detail": "Daily request limit set by the Institution has been exceeded.", + "type": "RateLimitError", + "status_code": 429 + }, + "summary": "Rate Limit Error", + "description": "RateLimitError" + } + } + } + }, + "description": "RateLimitError" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + }, + "AccessExpiredError": { + "value": { + "summary": "Couldn't update account details", + "detail": "Access has expired or it has been revoked. To restore access reconnect the account.", + "type": "AccessExpiredError", + "status_code": 401 + }, + "summary": "Access Expired Error", + "description": "AccessExpiredError" + }, + "AccountInactiveError": { + "value": { + "summary": "Couldn't update account details", + "detail": "Account has been deactivated or it no longer exists.", + "type": "AccountInactiveError", + "status_code": 401 + }, + "summary": "Account Inactive Error", + "description": "AccountInactiveError" + } + } + } + }, + "description": "AccountInactiveError" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + }, + "AccountEUAScopeError": { + "value": { + "summary": "End User Agreement (EUA) access scope error", + "detail": "EUA doesn't allow access to account details. Check EUA access scope. Or create new EUA with correct access scope", + "status_code": 403 + }, + "summary": "Account EUA scope error", + "description": "EUA doesn't allow access to account details." + }, + "AccountValidEUAError": { + "value": { + "summary": "No valid End User Agreement", + "detail": "Account exists but there is no valid End User Agreement permitting you to access it", + "status_code": 403 + }, + "summary": "Account valid EUA error", + "description": "Account has no valid End User Agreement" + }, + "AccountAccessForbidden": { + "value": { + "summary": "Couldn't update account details", + "detail": "Access to account is forbidden. The user might not have the necessary permissions.", + "type": "AccountAccessForbidden", + "status_code": 403 + }, + "summary": "Account Access Forbidden", + "description": "AccountAccessForbidden" + } + } + } + }, + "description": "AccountAccessForbidden" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidID": { + "value": { + "summary": "Invalid Account ID", + "detail": "$ACCOUNT_ID is not a valid Account UUID. ", + "status_code": 400 + }, + "summary": "Invalid ID", + "description": "Invalid Account ID" + } + } + } + }, + "description": "Invalid Account ID" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "UnknownRequestError": { + "value": { + "summary": "Couldn't update account details", + "detail": "Request to Institution returned an error", + "type": "UnknownRequestError", + "status_code": 500 + }, + "summary": "Unknown Request Error", + "description": "Couldn't update account details" + } + } + } + }, + "description": "Couldn't update account details" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "AccountSuspendedError": { + "value": { + "summary": "Account suspended", + "detail": "This account or its requisition was suspended due to numerous errors that occurred while accessing it.", + "status_code": 409 + }, + "summary": "Account suspended error", + "description": "Account or its requisition suspended" + }, + "AccountStateError": { + "value": { + "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "created": "2024-10-04 18:06:13.681544+00:00", + "last_accessed": "2024-10-04 18:06:13.681558+00:00", + "iban": "string", + "aspsp_identifier": "string", + "status": "ERROR" + }, + "summary": "Account state error", + "description": "Account state does not support this operation" + } + } + } + }, + "description": "Account state does not support this operation" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "ServiceError": { + "value": { + "summary": "Couldn't update account details", + "detail": "Institution service unavailable", + "type": "ServiceError", + "status_code": 503 + }, + "summary": "Service Error", + "description": "ServiceError" + }, + "ConnectionError": { + "value": { + "summary": "Couldn't update account details", + "detail": "Couldn't connect to Institution", + "type": "ConnectionError", + "status_code": 503 + }, + "summary": "Connection Error", + "description": "ConnectionError" + } + } + } + }, + "description": "ConnectionError" + } + } + } + }, + "/api/v2/accounts/{id}/transactions/": { + "get": { + "operationId": "retrieve account transactions", + "description": "Access account transactions.\n\nTransactions will be returned in Berlin Group PSD2 format.", + "parameters": [ + { + "in": "query", + "name": "date_from", + "schema": { + "type": "string", + "format": "date" + }, + "examples": { + "2024-07-06": { + "value": "2024-07-06", + "summary": "2024-07-06", + "description": "ISO 8601 format date" + } + } + }, + { + "in": "query", + "name": "date_to", + "schema": { + "type": "string", + "format": "date" + }, + "examples": { + "2024-10-04": { + "value": "2024-10-04", + "summary": "2024-10-04", + "description": "ISO 8601 format date" + } + } + }, + { + "in": "path", + "name": "id", + "schema": { + "type": "string" + }, + "required": true + } + ], + "tags": [ + "accounts" + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BankTransaction" + }, + "examples": { + "RetrieveAccountTransactions": { + "value": { + "transactions": { + "booked": [ + { + "transactionId": "string", + "debtorName": "string", + "debtorAccount": { + "iban": "string" + }, + "transactionAmount": { + "currency": "string", + "amount": "328.18" + }, + "bankTransactionCode": "string", + "bookingDate": "date", + "valueDate": "date", + "remittanceInformationUnstructured": "string" + }, + { + "transactionId": "string", + "transactionAmount": { + "currency": "string", + "amount": "947.26" + }, + "bankTransactionCode": "string", + "bookingDate": "date", + "valueDate": "date", + "remittanceInformationUnstructured": "string" + } + ], + "pending": [ + { + "transactionAmount": { + "currency": "string", + "amount": "99.20" + }, + "valueDate": "date", + "remittanceInformationUnstructured": "string" + } + ] + } + }, + "summary": "Account transactions", + "description": "Sample account transactions" + } + } + } + }, + "description": "Sample account transactions" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NotFoundError": { + "value": { + "detail": "Not found.", + "summary": "Not found.", + "status_code": 404 + }, + "summary": "Not found error", + "description": "Not found error" + }, + "AccountNotFoundError": { + "value": { + "summary": "Account ID $ACC_ID not found", + "detail": "Please check whether you specified a valid Account ID", + "status_code": 404 + }, + "summary": "Account not found error", + "description": "Account not found" + } + } + } + }, + "description": "Account not found" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + }, + "RateLimitError": { + "value": { + "summary": "Couldn't update account transactions", + "detail": "Daily request limit set by the Institution has been exceeded.", + "type": "RateLimitError", + "status_code": 429 + }, + "summary": "Rate Limit Error", + "description": "RateLimitError" + } + } + } + }, + "description": "RateLimitError" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + }, + "AccessExpiredError": { + "value": { + "summary": "Couldn't update account transactions", + "detail": "Access has expired or it has been revoked. To restore access reconnect the account.", + "type": "AccessExpiredError", + "status_code": 401 + }, + "summary": "Access Expired Error", + "description": "AccessExpiredError" + }, + "AccountInactiveError": { + "value": { + "summary": "Couldn't update account transactions", + "detail": "Account has been deactivated or it no longer exists.", + "type": "AccountInactiveError", + "status_code": 401 + }, + "summary": "Account Inactive Error", + "description": "AccountInactiveError" + } + } + } + }, + "description": "AccountInactiveError" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + }, + "AccountEUAScopeError": { + "value": { + "summary": "End User Agreement (EUA) access scope error", + "detail": "EUA doesn't allow access to account transactions. Check EUA access scope. Or create new EUA with correct access scope", + "status_code": 403 + }, + "summary": "Account EUA scope error", + "description": "EUA doesn't allow access to account transactions." + }, + "AccountValidEUAError": { + "value": { + "summary": "No valid End User Agreement", + "detail": "Account exists but there is no valid End User Agreement permitting you to access it", + "status_code": 403 + }, + "summary": "Account valid EUA error", + "description": "Account has no valid End User Agreement" + }, + "AccountAccessForbidden": { + "value": { + "summary": "Couldn't update account transactions", + "detail": "Access to account is forbidden. The user might not have the necessary permissions.", + "type": "AccountAccessForbidden", + "status_code": 403 + }, + "summary": "Account Access Forbidden", + "description": "AccountAccessForbidden" + } + } + } + }, + "description": "AccountAccessForbidden" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidID": { + "value": { + "summary": "Invalid Account ID", + "detail": "$ACCOUNT_ID is not a valid Account UUID. ", + "status_code": 400 + }, + "summary": "Invalid ID", + "description": "Invalid Account ID" + }, + "DateRangeError": { + "value": { + "summary": "Incorrect date range", + "detail": "Starting date '2024-10-14' is greater than end date '2024-10-04'. When specifying date range, starting date must precede the end date", + "status_code": 400 + }, + "summary": "Date range error", + "description": "Incorrect date range in query parameters" + } + } + } + }, + "description": "Incorrect date range in query parameters" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "UnknownRequestError": { + "value": { + "summary": "Couldn't update account transactions", + "detail": "Request to Institution returned an error", + "type": "UnknownRequestError", + "status_code": 500 + }, + "summary": "Unknown Request Error", + "description": "Couldn't update account transactions" + } + } + } + }, + "description": "Couldn't update account transactions" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "AccountSuspendedError": { + "value": { + "summary": "Account suspended", + "detail": "This account or its requisition was suspended due to numerous errors that occurred while accessing it.", + "status_code": 409 + }, + "summary": "Account suspended error", + "description": "Account or its requisition suspended" + }, + "AccountStateError": { + "value": { + "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "created": "2024-10-04 18:06:13.681544+00:00", + "last_accessed": "2024-10-04 18:06:13.681558+00:00", + "iban": "string", + "aspsp_identifier": "string", + "status": "ERROR" + }, + "summary": "Account state error", + "description": "Account state does not support this operation" + } + } + } + }, + "description": "Account state does not support this operation" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "ServiceError": { + "value": { + "summary": "Couldn't update account transactions", + "detail": "Institution service unavailable", + "type": "ServiceError", + "status_code": 503 + }, + "summary": "Service Error", + "description": "ServiceError" + }, + "ConnectionError": { + "value": { + "summary": "Couldn't update account transactions", + "detail": "Couldn't connect to Institution", + "type": "ConnectionError", + "status_code": 503 + }, + "summary": "Connection Error", + "description": "ConnectionError" + } + } + } + }, + "description": "ConnectionError" + } + } + } + }, + "/api/v2/agreements/enduser/": { + "get": { + "operationId": "retrieve all EUAs for an end user", + "description": "API endpoints related to end-user agreements.", + "parameters": [ + { + "name": "limit", + "required": false, + "in": "query", + "description": "Number of results to return per page.", + "schema": { + "type": "integer", + "default": 100, + "minimum": 1 + } + }, + { + "name": "offset", + "required": false, + "in": "query", + "description": "The initial zero-based index from which to return the results.", + "schema": { + "type": "integer", + "default": 0, + "minimum": 0 + } + } + ], + "tags": [ + "agreements" + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedEndUserAgreementList" + } + } + }, + "description": "Retrieve all end user agreements" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NotFoundError": { + "value": { + "detail": "Not found.", + "summary": "Not found.", + "status_code": 404 + }, + "summary": "Not found error", + "description": "Not found error" + } + } + } + }, + "description": "Not found error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + } + } + } + }, + "description": "Nordigen rate limit exceeded" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + } + } + } + }, + "description": "Token is invalid or expired" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + } + } + } + }, + "description": "IP address not whitelisted" + } + } + }, + "post": { + "operationId": "create EUA", + "description": "API endpoints related to end-user agreements.", + "tags": [ + "agreements" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndUserAgreementRequest" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/EndUserAgreementRequest" + } + }, + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/EndUserAgreementRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndUserAgreement" + } + } + }, + "description": "Create enduser agreement" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InstitutionFieldErrors": { + "value": { + "institution_id": { + "summary": "Unknown Institution ID $INSTITUTION_ID", + "detail": "Get Institution IDs from /institutions/?country={$COUNTRY_CODE}" + }, + "status_code": 400 + }, + "summary": "Institution field errors", + "description": "Errors related to 'institution' field." + }, + "AccessScopeFieldErrors": { + "value": { + "access_scope": [ + { + "summary": "Unknown value '$SCOPE' in access_scope", + "detail": "Choose one or several from ['balances', 'details', 'transactions']" + }, + { + "summary": "Institution access scope dependencies error", + "detail": "For this institution the following scopes are required together: ['balances', 'details']" + }, + { + "summary": "Institution access scope dependencies error", + "detail": "The following scopes are mandatory for this institution: ['transactions']" + }, + { + "summary": "Unsupported access scope selected.", + "detail": "The access scopes supported by the institution are ['transactions']. The following scopes are not supported: ['details', 'balances']" + }, + { + "summary": "Field 'access_scope' may not be an empty list.", + "detail": "Please choose one or several of ['balances', 'details', 'transactions']." + } + ], + "status_code": 400 + }, + "summary": "Access scope field errors", + "description": "Errors related to 'access_scope' field." + }, + "MaxHistoricalDaysFieldErrors": { + "value": { + "max_historical_days": [ + { + "summary": "Incorrect max_historical_days", + "detail": "max_historical_days must be > 0 and <= N26_NTSBDEB1 transaction_total_days (90)" + } + ], + "status_code": 400 + }, + "summary": "Max historical days field errors", + "description": "Errors related to 'max_historical_days' field." + }, + "AccessValidForDaysFieldErrors": { + "value": { + "access_valid_for_days": [ + { + "summary": "Incorrect access_valid_for_days", + "detail": "access_valid_for_days must be > 0 and <= 180" + } + ], + "status_code": 400 + }, + "summary": "Access valid for days field errors", + "description": "Errors related to 'access_valid_for_days' field." + }, + "AgreementFieldErrors": { + "value": { + "agreement": { + "summary": "Incorrect Institution ID $INSTITUTION_ID", + "detail": "Provided Institution ID: '$INSTITUTION_ID' for requisition does not match EUA institution ID '$EUA_INSTITUTION_ID'. Please provide correct institution ID: '$EUA_INSTITUTION_ID'" + }, + "status_code": 400 + }, + "summary": "Agreement field errors", + "description": "Errors related to 'agreement' field." + } + } + } + }, + "description": "Errors related to 'agreement' field." + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + } + } + } + }, + "description": "Nordigen rate limit exceeded" + }, + "402": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "PaymentRequired": { + "value": { + "summary": "Payment Required", + "detail": "Free usage limit exceeded", + "status_code": 402 + }, + "summary": "Payment Required", + "description": "Free usage limit exceeded" + } + } + } + }, + "description": "Free usage limit exceeded" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + } + } + } + }, + "description": "Token is invalid or expired" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + } + } + } + }, + "description": "IP address not whitelisted" + } + } + } + }, + "/api/v2/agreements/enduser/{id}/": { + "get": { + "operationId": "retrieve EUA by id", + "description": "Retrieve end user agreement by ID", + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "format": "uuid" + }, + "description": "A UUID string identifying this end user agreement.", + "required": true + } + ], + "tags": [ + "agreements" + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndUserAgreement" + } + } + }, + "description": "Retrieve end user agreement by ID" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NotFoundError": { + "value": { + "detail": "Not found.", + "summary": "Not found.", + "status_code": 404 + }, + "summary": "Not found error", + "description": "Not found error" + } + } + } + }, + "description": "Not found error" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidID": { + "value": { + "summary": "Invalid ID", + "detail": "272785d5-de45-4efb-aa1a-f8157ffa94 is not a valid UUID.", + "status_code": 400 + }, + "summary": "Invalid ID", + "description": "Invalid ID" + } + } + } + }, + "description": "Invalid ID" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + } + } + } + }, + "description": "Nordigen rate limit exceeded" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + } + } + } + }, + "description": "Token is invalid or expired" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + } + } + } + }, + "description": "IP address not whitelisted" + } + } + }, + "delete": { + "operationId": "delete EUA by id", + "description": "Delete an end user agreement", + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "format": "uuid" + }, + "description": "A UUID string identifying this end user agreement.", + "required": true + } + ], + "tags": [ + "agreements" + ], + "responses": { + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "CannotDeleteEUA": { + "value": { + "summary": "Cannot delete End User Agreement", + "detail": "Cannot delete accepted End User Agreement: $EUA_ID. Only non accepted agreements can be deleted", + "status_code": 400 + }, + "summary": "Cannot delete EUA", + "description": "Cannot delete End User Agreement" + }, + "InvalidID": { + "value": { + "summary": "Invalid ID", + "detail": "272785d5-de45-4efb-aa1a-f8157ffa94 is not a valid UUID.", + "status_code": 400 + }, + "summary": "Invalid ID", + "description": "Invalid ID" + } + } + } + }, + "description": "Invalid ID" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NotFoundError": { + "value": { + "detail": "Not found.", + "summary": "Not found.", + "status_code": 404 + }, + "summary": "Not found error", + "description": "Not found error" + } + } + } + }, + "description": "Not found error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + } + } + } + }, + "description": "Nordigen rate limit exceeded" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + } + } + } + }, + "description": "Token is invalid or expired" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + } + } + } + }, + "description": "IP address not whitelisted" + } + } + } + }, + "/api/v2/agreements/enduser/{id}/accept/": { + "put": { + "operationId": "accept EUA", + "description": "Accept an end-user agreement via the API", + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "format": "uuid" + }, + "description": "A UUID string identifying this end user agreement.", + "required": true + } + ], + "tags": [ + "agreements" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EnduserAcceptanceDetailsRequest" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/EnduserAcceptanceDetailsRequest" + } + }, + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/EnduserAcceptanceDetailsRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EndUserAgreement" + } + } + }, + "description": "Accept end user agreement" + }, + "405": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "EUAAccepted": { + "value": { + "summary": "EUA cannot be accepted more than once", + "detail": "End User Agreements cannot be accepted more than once", + "status_code": 405 + }, + "summary": "EUA accepted", + "description": "End User Agreements cannot be accepted more than once" + } + } + } + }, + "description": "End User Agreements cannot be accepted more than once" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InsufficientPermissions": { + "value": { + "summary": "Insufficient permissions", + "detail": "Your company doesn't have permission to accept EUA. You'll have to use our default form for this action.", + "status_code": 403 + }, + "summary": "Insufficient permissions", + "description": "Company doesn't have permission to accept EUA" + }, + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + } + } + } + }, + "description": "IP address not whitelisted" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidID": { + "value": { + "summary": "Invalid ID", + "detail": "272785d5-de45-4efb-aa1a-f8157ffa94 is not a valid UUID.", + "status_code": 400 + }, + "summary": "Invalid ID", + "description": "Invalid ID" + } + } + } + }, + "description": "Invalid ID" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NotFoundError": { + "value": { + "detail": "Not found.", + "summary": "Not found.", + "status_code": 404 + }, + "summary": "Not found error", + "description": "Not found error" + } + } + } + }, + "description": "Not found error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + } + } + } + }, + "description": "Nordigen rate limit exceeded" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + } + } + } + }, + "description": "Token is invalid or expired" + } + } + } + }, + "/api/v2/institutions/": { + "get": { + "operationId": "retrieve all supported Institutions in a given country", + "description": "List all available institutions", + "parameters": [ + { + "in": "query", + "name": "access_scopes_supported", + "schema": { + "type": "string" + }, + "description": "Boolean value, indicating if access scopes are supported", + "examples": { + "AccessScopesSupported": { + "value": "false", + "summary": "access_scopes_supported" + } + } + }, + { + "in": "query", + "name": "account_selection_supported", + "schema": { + "type": "string" + }, + "description": "Boolean value, indicating if account selection is supported", + "examples": { + "AccountSelectionSupported": { + "value": "false", + "summary": "account_selection_supported" + } + } + }, + { + "in": "query", + "name": "business_accounts_supported", + "schema": { + "type": "string" + }, + "description": "Boolean value, indicating if business accounts are supported", + "examples": { + "BusinessAccountsSupported": { + "value": "false", + "summary": "business_accounts_supported" + } + } + }, + { + "in": "query", + "name": "card_accounts_supported", + "schema": { + "type": "string" + }, + "description": "Boolean value, indicating if card accounts are supported", + "examples": { + "CardAccountsSupported": { + "value": "false", + "summary": "card_accounts_supported" + } + } + }, + { + "in": "query", + "name": "corporate_accounts_supported", + "schema": { + "type": "string" + }, + "description": "Boolean value, indicating if corporate accounts are supported", + "examples": { + "CorporateAccountsSupported": { + "value": "false", + "summary": "corporate_accounts_supported" + } + } + }, + { + "in": "query", + "name": "country", + "schema": { + "type": "string" + }, + "description": "ISO 3166 two-character country code", + "examples": { + "Austria": { + "value": "AT", + "summary": "Austria" + }, + "Belgium": { + "value": "BE", + "summary": "Belgium" + }, + "Bulgaria": { + "value": "BG", + "summary": "Bulgaria" + }, + "Croatia": { + "value": "HR", + "summary": "Croatia" + }, + "Cyprus": { + "value": "CY", + "summary": "Cyprus" + }, + "Czechia": { + "value": "CZ", + "summary": "Czechia" + }, + "Denmark": { + "value": "DK", + "summary": "Denmark" + }, + "Estonia": { + "value": "EE", + "summary": "Estonia" + }, + "Finland": { + "value": "FI", + "summary": "Finland" + }, + "France": { + "value": "FR", + "summary": "France" + }, + "Germany": { + "value": "DE", + "summary": "Germany" + }, + "Greece": { + "value": "GR", + "summary": "Greece" + }, + "Hungary": { + "value": "HU", + "summary": "Hungary" + }, + "Iceland": { + "value": "IS", + "summary": "Iceland" + }, + "Ireland": { + "value": "IE", + "summary": "Ireland" + }, + "Italy": { + "value": "IT", + "summary": "Italy" + }, + "Latvia": { + "value": "LV", + "summary": "Latvia" + }, + "Liechtenstein": { + "value": "LI", + "summary": "Liechtenstein" + }, + "Lithuania": { + "value": "LT", + "summary": "Lithuania" + }, + "Luxembourg": { + "value": "LU", + "summary": "Luxembourg" + }, + "Malta": { + "value": "MT", + "summary": "Malta" + }, + "Netherlands": { + "value": "NL", + "summary": "Netherlands" + }, + "Norway": { + "value": "NO", + "summary": "Norway" + }, + "Poland": { + "value": "PL", + "summary": "Poland" + }, + "Portugal": { + "value": "PT", + "summary": "Portugal" + }, + "Romania": { + "value": "RO", + "summary": "Romania" + }, + "Slovakia": { + "value": "SK", + "summary": "Slovakia" + }, + "Slovenia": { + "value": "SI", + "summary": "Slovenia" + }, + "Spain": { + "value": "ES", + "summary": "Spain" + }, + "Sweden": { + "value": "SE", + "summary": "Sweden" + }, + "UnitedKingdom": { + "value": "GB", + "summary": "United Kingdom" + } + } + }, + { + "in": "query", + "name": "payment_submission_supported", + "schema": { + "type": "string" + }, + "description": "Boolean value, indicating if payment submission is supported", + "examples": { + "PaymentSubmissionSupported": { + "value": "false", + "summary": "payment_submission_supported" + } + } + }, + { + "in": "query", + "name": "payments_enabled", + "schema": { + "type": "string" + }, + "description": "Boolean value, indicating if payments are supported", + "examples": { + "PaymentsEnabled": { + "value": "false", + "summary": "payments_enabled" + } + } + }, + { + "in": "query", + "name": "pending_transactions_supported", + "schema": { + "type": "string" + }, + "description": "Boolean value, indicating if pending transactions are supported", + "examples": { + "PendingTransactionsSupported": { + "value": "false", + "summary": "pending_transactions_supported" + } + } + }, + { + "in": "query", + "name": "private_accounts_supported", + "schema": { + "type": "string" + }, + "description": "Boolean value, indicating if private accounts are supported", + "examples": { + "PrivateAccountsSupported": { + "value": "false", + "summary": "private_accounts_supported" + } + } + }, + { + "in": "query", + "name": "read_debtor_account_supported", + "schema": { + "type": "string" + }, + "description": "Boolean value, indicating if debtor account can be read before submitting payment", + "examples": { + "ReadDebtorAccountSupported": { + "value": "false", + "summary": "read_debtor_account_supported" + } + } + }, + { + "in": "query", + "name": "read_refund_account_supported", + "schema": { + "type": "string" + }, + "description": "Boolean value, indicating if read refund account is supported", + "examples": { + "ReadRefundAccountSupported": { + "value": "false", + "summary": "read_refund_account_supported" + } + } + }, + { + "in": "query", + "name": "ssn_verification_supported", + "schema": { + "type": "string" + }, + "description": "Boolean value, indicating if ssn verification is supported", + "examples": { + "SsnVerificationSupported": { + "value": "false", + "summary": "ssn_verification_supported" + } + } + } + ], + "tags": [ + "institutions" + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Integration" + } + }, + "examples": { + "SupportedInstitutions": { + "value": [ + { + "id": "N26_NTSBDEB1", + "name": "N26 Bank", + "bic": "NTSBDEB1", + "transaction_total_days": "90", + "countries": [ + "GB", + "NO", + "SE", + "FI", + "DK", + "EE", + "LV", + "LT", + "NL", + "CZ", + "ES", + "PL", + "BE", + "DE", + "AT", + "BG", + "HR", + "CY", + "FR", + "GR", + "HU", + "IS", + "IE", + "IT", + "LI", + "LU", + "MT", + "PT", + "RO", + "SK", + "SI" + ], + "logo": "https://cdn-logos.gocardless.com/ais/N26_SANDBOX_NTSBDEB1.png", + "identification_codes": [] + } + ], + "summary": "Supported Institutions", + "description": "some of supported Institutions" + } + } + } + }, + "description": "list of supported Institutions in the country" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NotAValidChoice": { + "value": { + "summary": "Invalid country choice.", + "detail": "GBA is not a valid choice.", + "status_code": 400 + }, + "summary": "Not a valid choice", + "description": "Provided country is not valid" + }, + "UnknownFields": { + "value": { + "summary": "Unknown fields", + "detail": "Unknown fields {${FIELD}} in {${LOCATION}}", + "status_code": 400 + }, + "summary": "Unknown Fields", + "description": "Unknown Fields" + } + } + } + }, + "description": "Unknown Fields" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NotFoundError": { + "value": { + "detail": "Not found.", + "summary": "Not found.", + "status_code": 404 + }, + "summary": "Not found error", + "description": "Not found error" + } + } + } + }, + "description": "Not found error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + } + } + } + }, + "description": "Nordigen rate limit exceeded" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + } + } + } + }, + "description": "Token is invalid or expired" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + } + } + } + }, + "description": "IP address not whitelisted" + } + } + } + }, + "/api/v2/institutions/{id}/": { + "get": { + "operationId": "retrieve institution", + "description": "Get details about a specific Institution and its supported features", + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string" + }, + "required": true, + "examples": { + "N26": { + "value": "N26_NTSBDEB1", + "summary": "N26", + "description": "Nordigen's Institution ID for N26" + } + } + } + ], + "tags": [ + "institutions" + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationRetrieve" + }, + "examples": { + "N26Bank": { + "value": { + "id": "N26_NTSBDEB1", + "name": "N26 Bank", + "bic": "NTSBDEB1", + "transaction_total_days": "90", + "countries": [ + "GB", + "NO", + "SE", + "FI", + "DK", + "EE", + "LV", + "LT", + "NL", + "CZ", + "ES", + "PL", + "BE", + "DE", + "AT", + "BG", + "HR", + "CY", + "FR", + "GR", + "HU", + "IS", + "IE", + "IT", + "LI", + "LU", + "MT", + "PT", + "RO", + "SK", + "SI" + ], + "logo": "https://cdn-logos.gocardless.com/ais/N26_SANDBOX_NTSBDEB1.png", + "supported_payments": { + "single-payment": [ + "SCT", + "ISCT" + ] + }, + "supported_features": [ + "account_selection", + "business_accounts", + "card_accounts", + "payments", + "private_accounts" + ], + "identification_codes": [] + }, + "summary": "N26 Bank", + "description": "N26 Bank" + }, + "ABNAMROBank": { + "value": { + "id": "ABNAMRO_FTSBDEFAXXX", + "name": "ABN AMRO Bank Commercial", + "bic": "FTSBDEFAXXX", + "transaction_total_days": "558", + "countries": [ + "DE" + ], + "logo": "https://cdn-logos.gocardless.com/ais/ABNAMRO_FTSBDEFAXXX.png", + "supported_payments": { + "single-payment": [ + "SCT" + ] + }, + "supported_features": [ + "business_accounts", + "card_accounts", + "payments", + "pending_transactions", + "private_accounts" + ], + "identification_codes": [] + }, + "summary": "ABN AMRO Bank", + "description": "ABN AMRO Bank" + } + } + } + }, + "description": "Retrieve institution by id" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NotFoundError": { + "value": { + "detail": "Not found.", + "summary": "Not found.", + "status_code": 404 + }, + "summary": "Not found error", + "description": "Not found error" + } + } + } + }, + "description": "Not found error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + } + } + } + }, + "description": "Nordigen rate limit exceeded" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + } + } + } + }, + "description": "Token is invalid or expired" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + } + } + } + }, + "description": "IP address not whitelisted" + } + } + } + }, + "/api/v2/requisitions/": { + "get": { + "operationId": "retrieve all requisitions", + "description": "Retrieve all requisitions belonging to the company", + "parameters": [ + { + "name": "limit", + "required": false, + "in": "query", + "description": "Number of results to return per page.", + "schema": { + "type": "integer", + "default": 100, + "minimum": 1 + } + }, + { + "name": "offset", + "required": false, + "in": "query", + "description": "The initial zero-based index from which to return the results.", + "schema": { + "type": "integer", + "default": 0, + "minimum": 0 + } + } + ], + "tags": [ + "requisitions" + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedRequisitionList" + } + } + }, + "description": "Retrieve all requisitions" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NotFoundError": { + "value": { + "detail": "Not found.", + "summary": "Not found.", + "status_code": 404 + }, + "summary": "Not found error", + "description": "Not found error" + } + } + } + }, + "description": "Not found error" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "UnknownFields": { + "value": { + "summary": "Unknown fields", + "detail": "Unknown fields {${FIELD}} in {${LOCATION}}", + "status_code": 400 + }, + "summary": "Unknown Fields", + "description": "Unknown Fields" + } + } + } + }, + "description": "Unknown Fields" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + } + } + } + }, + "description": "Nordigen rate limit exceeded" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + } + } + } + }, + "description": "Token is invalid or expired" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + } + } + } + }, + "description": "IP address not whitelisted" + } + } + }, + "post": { + "operationId": "Create requisition", + "description": "Create a new requisition", + "tags": [ + "requisitions" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RequisitionRequest" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/RequisitionRequest" + } + }, + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/RequisitionRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpectacularRequisition" + } + } + }, + "description": "Requisition has been successfully created" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "ReferenceFieldErrors": { + "value": { + "reference": { + "summary": "Client reference must be unique", + "detail": "Client reference: $REFERENCE_ID already exists" + }, + "status_code": 400 + }, + "summary": "Reference field errors", + "description": "Errors related to 'reference' field." + }, + "UserLanguageFieldErrors": { + "value": { + "user_language": { + "summary": "Provided user_language is invalid or not supported", + "detail": "'$LNG_CODE' is an invalid or unsupported language" + }, + "status_code": 400 + }, + "summary": "User language field errors", + "description": "Errors related to 'user_language' field." + }, + "AgreementFieldErrors": { + "value": { + "agreement": [ + { + "summary": "Unknown Institution ID $ASPSP_ID", + "detail": "Get Institution IDs from /institutions/?country={$COUNTRY_CODE}" + }, + { + "summary": "Invalid EndUserAgreement ID", + "detail": "$AGREEMENT_ID is not a valid EndUserAgreement UUID. Please specify valid agreement from /api/agreements/enduser/?={$ENDUSER_ID} or create a new one" + } + ], + "status_code": 400 + }, + "summary": "Agreement field errors", + "description": "Errors related to 'agreement' field." + }, + "RedirectFieldErrors": { + "value": { + "redirect": [ + { + "summary": "Redirect URL is required", + "detail": "Where an end user will be redirected after finishing authentication in the Institution" + }, + { + "summary": "Invalid redirect URI", + "detail": "Redirect URI must have a valid URI structure" + } + ], + "status_code": 400 + }, + "summary": "Redirect field errors", + "description": "Errors related to 'redirect' field." + }, + "SSNFieldErrors": { + "value": { + "ssn": { + "summary": "SSN verification not supported", + "detail": "SSN verification not supported for $INSTITUTION_ID" + }, + "status_code": 400 + }, + "summary": "SSN field errors", + "description": "Errors related to 'ssn' field." + }, + "AccountSelectionFieldErrors": { + "value": { + "account_selection": { + "summary": "Account selection not supported", + "detail": "Account selection not supported for $INSTITUTION_ID" + }, + "status_code": 400 + }, + "summary": "Account selection field errors", + "description": "Errors related to 'account_selection' field." + }, + "InstitutionFieldErrors": { + "value": { + "institution_id": { + "summary": "Unknown Institution ID $INSTITUTION_ID", + "detail": "Get Institution IDs from /institutions/?country={$COUNTRY_CODE}" + }, + "status_code": 400 + }, + "summary": "Institution field errors", + "description": "Errors related to 'institution' field." + }, + "UnknownFields": { + "value": { + "summary": "Unknown fields", + "detail": "Unknown fields {${FIELD}} in {${LOCATION}}", + "status_code": 400 + }, + "summary": "Unknown Fields", + "description": "Unknown Fields" + }, + "FieldsRequired": { + "value": { + "redirect": [ + "This field is required." + ], + "institution_id": [ + "This field is required." + ], + "status_code": 400 + }, + "summary": "Fields required", + "description": "Field is required" + } + } + } + }, + "description": "Field is required" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "AgreementNotFoundErrors": { + "value": { + "agreement": { + "summary": "ID $AGREEMENT_ID not found", + "detail": "Please check whether you specified a valid ID" + }, + "status_code": 404 + }, + "summary": "Agreement not found errors", + "description": "Errors related to 'agreement' field." + } + } + } + }, + "description": "Errors related to 'agreement' field." + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + } + } + } + }, + "description": "Nordigen rate limit exceeded" + }, + "402": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "PaymentRequired": { + "value": { + "summary": "Payment Required", + "detail": "Free usage limit exceeded", + "status_code": 402 + }, + "summary": "Payment Required", + "description": "Free usage limit exceeded" + } + } + } + }, + "description": "Free usage limit exceeded" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + } + } + } + }, + "description": "Token is invalid or expired" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + } + } + } + }, + "description": "IP address not whitelisted" + } + } + } + }, + "/api/v2/requisitions/{id}/": { + "get": { + "operationId": "requisition by id", + "description": "Retrieve a requisition by ID", + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "format": "uuid" + }, + "description": "A UUID string identifying this requisition.", + "required": true + } + ], + "tags": [ + "requisitions" + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Requisition" + } + } + }, + "description": "Get requisition by ID" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NotFoundError": { + "value": { + "detail": "Not found.", + "summary": "Not found.", + "status_code": 404 + }, + "summary": "Not found error", + "description": "Not found error" + } + } + } + }, + "description": "Not found error" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidID": { + "value": { + "summary": "Invalid ID", + "detail": "272785d5-de45-4efb-aa1a-f8157ffa94 is not a valid UUID.", + "status_code": 400 + }, + "summary": "Invalid ID", + "description": "Invalid ID" + } + } + } + }, + "description": "Invalid ID" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + } + } + } + }, + "description": "Nordigen rate limit exceeded" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + } + } + } + }, + "description": "Token is invalid or expired" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + } + } + } + }, + "description": "IP address not whitelisted" + } + } + }, + "delete": { + "operationId": "delete requisition by id", + "description": "Delete requisition and its end user agreement", + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "format": "uuid" + }, + "description": "A UUID string identifying this requisition.", + "required": true + } + ], + "tags": [ + "requisitions" + ], + "responses": { + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidID": { + "value": { + "summary": "Invalid ID", + "detail": "272785d5-de45-4efb-aa1a-f8157ffa94 is not a valid UUID.", + "status_code": 400 + }, + "summary": "Invalid ID", + "description": "Invalid ID" + } + } + } + }, + "description": "Invalid ID" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NotFoundError": { + "value": { + "detail": "Not found.", + "summary": "Not found.", + "status_code": 404 + }, + "summary": "Not found error", + "description": "Not found error" + } + } + } + }, + "description": "Not found error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + } + } + } + }, + "description": "Nordigen rate limit exceeded" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + } + } + } + }, + "description": "Token is invalid or expired" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + } + } + } + }, + "description": "IP address not whitelisted" + } + } + } + }, + "/api/v2/token/new/": { + "post": { + "operationId": "Obtain new access/refresh token pair", + "description": "Obtain JWT pair", + "tags": [ + "token" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JWTObtainPairRequest" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/JWTObtainPairRequest" + } + }, + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/JWTObtainPairRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpectacularJWTObtain" + } + } + }, + "description": "Obtain JWT response." + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "AuthenticationFailed": { + "value": { + "summary": "Authentication failed", + "detail": "No active account found with the given credentials", + "status_code": 401 + }, + "summary": "Authentication failed", + "description": "Incorrect secret key or id" + } + } + } + }, + "description": "Incorrect secret key or id" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + } + } + } + }, + "description": "IP address not whitelisted" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + } + } + } + }, + "description": "Nordigen rate limit exceeded" + } + } + } + }, + "/api/v2/token/refresh/": { + "post": { + "operationId": "Get a new access token", + "description": "Refresh access token", + "tags": [ + "token" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JWTRefreshRequest" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/JWTRefreshRequest" + } + }, + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/JWTRefreshRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpectacularJWTRefresh" + } + } + }, + "description": "Refresh access token." + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "IPAccessDenied": { + "value": { + "summary": "IP address access denied", + "detail": "Your IP $IP_ADDRESS isn't whitelisted to perform this action", + "status_code": 403 + }, + "summary": "IP Access denied", + "description": "IP address not whitelisted" + } + } + } + }, + "description": "IP address not whitelisted" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "InvalidToken": { + "value": { + "summary": "Invalid token", + "detail": "Token is invalid or expired", + "status_code": 401 + }, + "summary": "Invalid token", + "description": "Token is invalid or expired" + } + } + } + }, + "description": "Token is invalid or expired" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + }, + "examples": { + "NordigenRateLimitExceeded": { + "value": { + "summary": "Rate limit exceeded", + "detail": "The rate limit for this resource is /. Please try again in seconds", + "status_code": 429 + }, + "summary": "Nordigen rate limit exceeded", + "description": "Nordigen rate limit exceeded" + } + } + } + }, + "description": "Nordigen rate limit exceeded" + } + } + } + } + }, + "components": { + "schemas": { + "Account": { + "type": "object", + "description": "AccountSerializer.", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "description": "The ID of this Account, used to refer to this account in other API calls." + }, + "created": { + "type": "string", + "format": "date-time", + "readOnly": true, + "description": "The date & time at which the account object was created." + }, + "last_accessed": { + "type": "string", + "format": "date-time", + "readOnly": true, + "description": "The date & time at which the account object was last accessed." + }, + "iban": { + "type": "string", + "readOnly": true, + "description": "The Account IBAN" + }, + "status": { + "type": "string", + "readOnly": true, + "description": "The processing status of this account." + }, + "institution_id": { + "type": "string", + "readOnly": true, + "description": "The ASPSP associated with this account." + }, + "owner_name": { + "type": "string", + "readOnly": true, + "description": "The name of the account owner." + } + } + }, + "AccountBalance": { + "type": "object", + "description": "AccountBalanceSerializer.", + "properties": { + "balances": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BalanceSchema" + } + } + } + }, + "AccountDetail": { + "type": "object", + "description": "AccountDetailSerializer.", + "properties": { + "account": { + "allOf": [ + { + "$ref": "#/components/schemas/DetailSchema" + } + ], + "description": "account" + } + }, + "required": [ + "account" + ] + }, + "AccountSchema": { + "type": "object", + "description": "AccountSchema.", + "properties": { + "iban": { + "type": "string", + "description": "iban" + }, + "bban": { + "type": "string", + "description": "bban" + }, + "pan": { + "type": "string", + "description": "pan" + }, + "maskedPan": { + "type": "string", + "description": "maskedPan" + }, + "msisdn": { + "type": "string", + "description": "msisdn" + }, + "currency": { + "type": "string", + "description": "currency" + } + } + }, + "BalanceAmountSchema": { + "type": "object", + "description": "BalanceAmountSchema.", + "properties": { + "amount": { + "type": "string", + "description": "amount" + }, + "currency": { + "type": "string", + "description": "currency" + } + }, + "required": [ + "amount", + "currency" + ] + }, + "BalanceSchema": { + "type": "object", + "description": "BalanceSchema.", + "properties": { + "balanceAmount": { + "allOf": [ + { + "$ref": "#/components/schemas/BalanceAmountSchema" + } + ], + "description": "balanceAmount" + }, + "balanceType": { + "type": "string", + "description": "balanceType" + }, + "creditLimitIncluded": { + "type": "boolean", + "description": "creditLimitIncluded" + }, + "lastChangeDateTime": { + "type": "string", + "description": "lastChangeDateTime" + }, + "referenceDate": { + "type": "string", + "description": "referenceDate" + }, + "lastCommittedTransaction": { + "type": "string", + "description": "lastCommittedTransaction" + } + }, + "required": [ + "balanceAmount", + "balanceType" + ] + }, + "BankTransaction": { + "type": "object", + "description": "BankTransactionSerializer.", + "properties": { + "booked": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransactionSchema" + } + }, + "pending": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransactionSchema" + } + } + }, + "required": [ + "booked" + ] + }, + "CurrencyExchangeSchema": { + "type": "object", + "description": "CurrencyExchangeSchema.", + "properties": { + "sourceCurrency": { + "type": "string", + "description": "sourceCurrency" + }, + "exchangeRate": { + "type": "string", + "description": "exchangeRate" + }, + "unitCurrency": { + "type": "string", + "description": "unitCurrency" + }, + "targetCurrency": { + "type": "string", + "description": "targetCurrency" + }, + "quotationDate": { + "type": "string", + "description": "quotationDate" + }, + "contractIdentification": { + "type": "string", + "description": "contractIdentification" + } + } + }, + "DetailSchema": { + "type": "object", + "description": "DetailSchema.", + "properties": { + "resourceId": { + "type": "string", + "description": "resourceId" + }, + "iban": { + "type": "string", + "description": "iban" + }, + "bban": { + "type": "string", + "description": "bban" + }, + "msisdn": { + "type": "string", + "description": "msisdn" + }, + "currency": { + "type": "string", + "description": "currency" + }, + "ownerName": { + "type": "string", + "description": "ownerName" + }, + "name": { + "type": "string", + "description": "name" + }, + "displayName": { + "type": "string", + "description": "displayName" + }, + "product": { + "type": "string", + "description": "product" + }, + "cashAccountType": { + "type": "string", + "description": "cashAccountType" + }, + "status": { + "type": "string", + "description": "status" + }, + "bic": { + "type": "string", + "description": "bic" + }, + "linkedAccounts": { + "type": "string", + "description": "linkedAccounts" + }, + "maskedPan": { + "type": "string", + "description": "maskedPan" + }, + "usage": { + "type": "string", + "description": "usage" + }, + "details": { + "type": "string", + "description": "details" + }, + "ownerAddressUnstructured": { + "type": "array", + "items": { + "type": "string" + }, + "description": "ownerAddressUnstructured" + }, + "ownerAddressStructured": { + "allOf": [ + { + "$ref": "#/components/schemas/OwnerAddressStructuredSchema" + } + ], + "description": "ownerAddressStructured" + } + } + }, + "EndUserAgreement": { + "type": "object", + "description": "Represents an end-user agreement.", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "title": "End User Agreement ID", + "description": "The ID of this End User Agreement, used to refer to this end user agreement in other API calls." + }, + "created": { + "type": "string", + "format": "date-time", + "readOnly": true, + "title": "Created Date", + "description": "The date & time at which the end user agreement was created." + }, + "institution_id": { + "type": "string", + "description": "an Institution ID for this EUA" + }, + "max_historical_days": { + "type": "integer", + "maximum": 730, + "minimum": 1, + "default": 90, + "title": "Maximum Historical Days", + "description": "Maximum number of days of transaction data to retrieve." + }, + "access_valid_for_days": { + "type": "integer", + "maximum": 180, + "minimum": 1, + "default": 90, + "title": "Access Valid For (Days)", + "description": "Number of days from acceptance that the access can be used." + }, + "access_scope": { + "type": "array", + "items": {}, + "default": [ + "balances", + "details", + "transactions" + ], + "title": "Level of information to access (by default all)", + "description": "Array containing one or several values of ['balances', 'details', 'transactions']" + }, + "accepted": { + "type": "string", + "format": "date-time", + "nullable": true, + "readOnly": true, + "title": "Accepted Date", + "description": "The date & time at which the end user accepted the agreement." + } + }, + "required": [ + "institution_id" + ] + }, + "EndUserAgreementRequest": { + "type": "object", + "description": "Represents an end-user agreement.", + "properties": { + "institution_id": { + "type": "string", + "minLength": 1, + "description": "an Institution ID for this EUA" + }, + "max_historical_days": { + "type": "integer", + "maximum": 730, + "minimum": 1, + "default": 90, + "title": "Maximum Historical Days", + "description": "Maximum number of days of transaction data to retrieve." + }, + "access_valid_for_days": { + "type": "integer", + "maximum": 180, + "minimum": 1, + "default": 90, + "title": "Access Valid For (Days)", + "description": "Number of days from acceptance that the access can be used." + }, + "access_scope": { + "type": "array", + "items": {}, + "default": [ + "balances", + "details", + "transactions" + ], + "title": "Level of information to access (by default all)", + "description": "Array containing one or several values of ['balances', 'details', 'transactions']" + } + }, + "required": [ + "institution_id" + ] + }, + "EnduserAcceptanceDetailsRequest": { + "type": "object", + "description": "Represents end-user details.", + "properties": { + "user_agent": { + "type": "string", + "minLength": 1, + "title": "user agent string for the end user" + }, + "ip_address": { + "type": "string", + "minLength": 1, + "title": "end user IP address" + } + }, + "required": [ + "ip_address", + "user_agent" + ] + }, + "ErrorResponse": { + "type": "object", + "properties": { + "summary": { + "type": "string" + }, + "detail": { + "type": "string" + }, + "type": { + "type": "string" + }, + "status_code": { + "type": "integer" + } + }, + "required": [ + "detail", + "status_code", + "summary" + ] + }, + "Integration": { + "type": "object", + "description": "Represents an Integration.", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "bic": { + "type": "string" + }, + "transaction_total_days": { + "type": "string", + "default": "90" + }, + "countries": { + "type": "array", + "items": { + "type": "string" + } + }, + "logo": { + "type": "string" + } + }, + "required": [ + "countries", + "id", + "logo", + "name" + ] + }, + "IntegrationRetrieve": { + "type": "object", + "description": "IntegrationSerializer for Retrieve endpoint.", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "bic": { + "type": "string" + }, + "transaction_total_days": { + "type": "string", + "default": "90" + }, + "countries": { + "type": "array", + "items": { + "type": "string" + } + }, + "logo": { + "type": "string" + }, + "supported_payments": { + "type": "object", + "additionalProperties": {} + }, + "supported_features": { + "type": "array", + "items": {} + }, + "identification_codes": { + "type": "array", + "items": {} + } + }, + "required": [ + "countries", + "id", + "identification_codes", + "logo", + "name", + "supported_features", + "supported_payments" + ] + }, + "JWTObtainPairRequest": { + "type": "object", + "description": "Obtain JWT pair.", + "properties": { + "secret_id": { + "type": "string", + "minLength": 1, + "description": "Secret id from /user-secrets/" + }, + "secret_key": { + "type": "string", + "minLength": 1, + "description": "Secret key from /user-secrets/" + } + }, + "required": [ + "secret_id", + "secret_key" + ] + }, + "JWTRefreshRequest": { + "type": "object", + "description": "Refresh access token.", + "properties": { + "refresh": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "refresh" + ] + }, + "OwnerAddressStructuredSchema": { + "type": "object", + "description": "OwnerAddressStructuredSchema.", + "properties": { + "streetName": { + "type": "string", + "description": "streetName" + }, + "buildingNumber": { + "type": "string", + "description": "buildingNumber" + }, + "townName": { + "type": "string", + "description": "townName" + }, + "postCode": { + "type": "string", + "description": "postCode" + }, + "country": { + "type": "string", + "description": "country" + } + } + }, + "PaginatedEndUserAgreementList": { + "type": "object", + "required": [ + "count", + "results" + ], + "properties": { + "count": { + "type": "integer", + "example": 123 + }, + "next": { + "type": "string", + "nullable": true, + "format": "uri", + "example": "https://bankaccountdata.gocardless.com/api/v2/agreements/enduser/?limit=100&offset=0" + }, + "previous": { + "type": "string", + "nullable": true, + "format": "uri", + "example": "https://bankaccountdata.gocardless.com/api/v2/agreements/enduser/?limit=100&offset=0" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EndUserAgreement" + } + } + } + }, + "PaginatedRequisitionList": { + "type": "object", + "required": [ + "count", + "results" + ], + "properties": { + "count": { + "type": "integer", + "example": 123 + }, + "next": { + "type": "string", + "nullable": true, + "format": "uri", + "example": "https://bankaccountdata.gocardless.com/api/v2/requisitions/?limit=100&offset=0" + }, + "previous": { + "type": "string", + "nullable": true, + "format": "uri", + "example": "https://bankaccountdata.gocardless.com/api/v2/requisitions/?limit=100&offset=0" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Requisition" + } + } + } + }, + "Requisition": { + "type": "object", + "description": "RequisitionSerializer.", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "readOnly": true + }, + "created": { + "type": "string", + "format": "date-time", + "nullable": true, + "readOnly": true, + "title": "Created Date", + "description": "The date & time at which the requisition was created." + }, + "redirect": { + "type": "string", + "format": "uri", + "nullable": true, + "description": "redirect URL to your application after end-user authorization with ASPSP", + "maxLength": 1024 + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/StatusEnum" + } + ], + "description": "status of this requisition", + "title": "Requisition status", + "readOnly": true + }, + "institution_id": { + "type": "string", + "description": "an Institution ID for this Requisition" + }, + "agreement": { + "type": "string", + "format": "uuid", + "description": "EUA associated with this requisition" + }, + "reference": { + "type": "string", + "description": "additional ID to identify the end user", + "maxLength": 256 + }, + "accounts": { + "type": "array", + "items": { + "type": "string", + "format": "uuid", + "title": "accounts" + }, + "readOnly": true, + "description": "array of account IDs retrieved within a scope of this requisition" + }, + "user_language": { + "type": "string", + "description": "A two-letter country code (ISO 639-1)", + "maxLength": 5 + }, + "link": { + "type": "string", + "format": "uri", + "readOnly": true, + "default": "https://ob.gocardless.com/psd2/start/3fa85f64-5717-4562-b3fc-2c963f66afa6/{$INSTITUTION_ID}", + "description": "link to initiate authorization with Institution" + }, + "ssn": { + "type": "string", + "description": "optional SSN field to verify ownership of the account", + "maxLength": 64 + }, + "account_selection": { + "type": "boolean", + "default": false, + "description": "option to enable account selection view for the end user" + }, + "redirect_immediate": { + "type": "boolean", + "default": false, + "description": "enable redirect back to the client after account list received" + } + }, + "required": [ + "institution_id", + "redirect" + ] + }, + "RequisitionRequest": { + "type": "object", + "description": "RequisitionSerializer.", + "properties": { + "redirect": { + "type": "string", + "format": "uri", + "nullable": true, + "minLength": 1, + "description": "redirect URL to your application after end-user authorization with ASPSP", + "maxLength": 1024 + }, + "institution_id": { + "type": "string", + "minLength": 1, + "description": "an Institution ID for this Requisition" + }, + "agreement": { + "type": "string", + "format": "uuid", + "description": "EUA associated with this requisition" + }, + "reference": { + "type": "string", + "minLength": 1, + "description": "additional ID to identify the end user", + "maxLength": 256 + }, + "user_language": { + "type": "string", + "minLength": 1, + "description": "A two-letter country code (ISO 639-1)", + "maxLength": 5 + }, + "ssn": { + "type": "string", + "description": "optional SSN field to verify ownership of the account", + "maxLength": 64 + }, + "account_selection": { + "type": "boolean", + "default": false, + "description": "option to enable account selection view for the end user" + }, + "redirect_immediate": { + "type": "boolean", + "default": false, + "description": "enable redirect back to the client after account list received" + } + }, + "required": [ + "institution_id", + "redirect" + ] + }, + "SpectacularJWTObtain": { + "type": "object", + "description": "Obtain new JWT pair.", + "properties": { + "access": { + "type": "string", + "readOnly": true, + "description": "Your access token" + }, + "access_expires": { + "type": "integer", + "readOnly": true, + "default": 86400, + "description": "Access token expires in seconds" + }, + "refresh": { + "type": "string", + "readOnly": true, + "description": "Your refresh token" + }, + "refresh_expires": { + "type": "integer", + "readOnly": true, + "default": 2592000, + "description": "Refresh token expires in seconds" + } + } + }, + "SpectacularJWTRefresh": { + "type": "object", + "description": "Refresh Access token.", + "properties": { + "access": { + "type": "string", + "readOnly": true, + "description": "Your access token" + }, + "access_expires": { + "type": "integer", + "readOnly": true, + "default": 86400, + "description": "Access token expires in seconds" + } + } + }, + "SpectacularRequisition": { + "type": "object", + "description": "Create requisition.", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "readOnly": true + }, + "created": { + "type": "string", + "format": "date-time", + "nullable": true, + "readOnly": true, + "title": "Created Date", + "description": "The date & time at which the requisition was created." + }, + "redirect": { + "type": "string", + "format": "uri", + "nullable": true, + "description": "redirect URL to your application after end-user authorization with ASPSP", + "maxLength": 1024 + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/StatusEnum" + } + ], + "description": "status of this requisition", + "title": "Requisition status", + "readOnly": true + }, + "institution_id": { + "type": "string", + "description": "an Institution ID for this Requisition" + }, + "agreement": { + "type": "string", + "format": "uuid", + "description": "EUA associated with this requisition" + }, + "reference": { + "type": "string", + "description": "additional ID to identify the end user", + "maxLength": 256 + }, + "accounts": { + "type": "array", + "items": {}, + "readOnly": true, + "default": [], + "description": "array of account IDs retrieved within a scope of this requisition" + }, + "user_language": { + "type": "string", + "description": "A two-letter country code (ISO 639-1)", + "maxLength": 5 + }, + "link": { + "type": "string", + "format": "uri", + "readOnly": true, + "default": "https://ob.gocardless.com/psd2/start/3fa85f64-5717-4562-b3fc-2c963f66afa6/{$INSTITUTION_ID}", + "description": "link to initiate authorization with Institution" + }, + "ssn": { + "type": "string", + "description": "optional SSN field to verify ownership of the account", + "maxLength": 64 + }, + "account_selection": { + "type": "boolean", + "default": false, + "description": "option to enable account selection view for the end user" + }, + "redirect_immediate": { + "type": "boolean", + "default": false, + "description": "enable redirect back to the client after account list received" + } + }, + "required": [ + "institution_id", + "redirect" + ] + }, + "StatusEnum": { + "enum": [ + "CR", + "ID", + "LN", + "RJ", + "ER", + "SU", + "EX", + "GC", + "UA", + "GA", + "SA" + ], + "type": "string" + }, + "TransactionAmountSchema": { + "type": "object", + "description": "TransactionAmountSchema.", + "properties": { + "amount": { + "type": "string", + "description": "amount" + }, + "currency": { + "type": "string", + "description": "currency" + } + }, + "required": [ + "amount", + "currency" + ] + }, + "TransactionSchema": { + "type": "object", + "description": "TransactionSchema.", + "properties": { + "transactionId": { + "type": "string", + "description": "transactionId" + }, + "entryReference": { + "type": "string", + "description": "entryReference" + }, + "endToEndId": { + "type": "string", + "description": "endToEndId" + }, + "mandateId": { + "type": "string", + "description": "mandateId" + }, + "checkId": { + "type": "string", + "description": "checkId" + }, + "creditorId": { + "type": "string", + "description": "creditorId" + }, + "bookingDate": { + "type": "string", + "description": "bookingDate" + }, + "valueDate": { + "type": "string", + "description": "valueDate" + }, + "bookingDateTime": { + "type": "string", + "description": "bookingDateTime" + }, + "valueDateTime": { + "type": "string", + "description": "valueDateTime" + }, + "transactionAmount": { + "allOf": [ + { + "$ref": "#/components/schemas/TransactionAmountSchema" + } + ], + "description": "transactionAmount" + }, + "currencyExchange": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CurrencyExchangeSchema" + } + }, + "creditorName": { + "type": "string", + "description": "creditorName" + }, + "creditorAccount": { + "allOf": [ + { + "$ref": "#/components/schemas/AccountSchema" + } + ], + "description": "creditorAccount" + }, + "ultimateCreditor": { + "type": "string", + "description": "ultimateCreditor" + }, + "debtorName": { + "type": "string", + "description": "debtorName" + }, + "debtorAccount": { + "allOf": [ + { + "$ref": "#/components/schemas/AccountSchema" + } + ], + "description": "debtorAccount" + }, + "ultimateDebtor": { + "type": "string", + "description": "ultimateDebtor" + }, + "remittanceInformationUnstructured": { + "type": "string", + "description": "remittanceInformationUnstructured" + }, + "remittanceInformationUnstructuredArray": { + "type": "array", + "items": { + "type": "string" + }, + "description": "remittanceInformationUnstructuredArray" + }, + "remittanceInformationStructured": { + "type": "string", + "description": "remittanceInformationStructured" + }, + "remittanceInformationStructuredArray": { + "type": "array", + "items": { + "type": "string" + }, + "description": "remittanceInformationStructuredArray" + }, + "additionalInformation": { + "type": "string", + "description": "additionalInformation" + }, + "purposeCode": { + "type": "string", + "description": "purposeCode" + }, + "bankTransactionCode": { + "type": "string", + "description": "bankTransactionCode" + }, + "proprietaryBankTransactionCode": { + "type": "string", + "description": "proprietaryBankTransactionCode" + }, + "internalTransactionId": { + "type": "string", + "description": "internalTransactionId" + } + }, + "required": [ + "transactionAmount" + ] + } + }, + "securitySchemes": { + "jwtAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + }, + "security": [ + { + "jwtAuth": [] + } + ], + "servers": [ + { + "url": "https://bankaccountdata.gocardless.com" + } + ] +} \ No newline at end of file