diff --git a/.cargo/deny.toml b/.cargo/deny.toml index 26a61084e8..485f23500d 100644 --- a/.cargo/deny.toml +++ b/.cargo/deny.toml @@ -1,5 +1,14 @@ [licenses] -allow = ["Apache-2.0", "MIT", "MPL-2.0", "Unicode-3.0"] +allow = [ + "Apache-2.0", + "BSD-3-Clause", + "CDLA-Permissive-2.0", + "ISC", + "MIT", + "MPL-2.0", + "OpenSSL", + "Unicode-3.0", +] [licenses.private] ignore = true diff --git a/.github/codecov.yml b/.github/codecov.yml index 8db67faf6f..74d4afc256 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -8,3 +8,5 @@ coverage: threshold: 1% comment: after_n_builds: 3 +ignore: + - packages/client-rust diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 718fa332b3..485549b336 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -272,6 +272,7 @@ updates: - dependencies - package-ecosystem: docker-compose directories: + - /packages/client-rust # - /scripts # Maybe - /scripts/api - /tests/e2e diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 2cc26c16be..9de701ee5d 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -26,7 +26,7 @@ REPLACE ME If an API change has been made -- [ ] The API schema has been updated (`make gen-build`) +- [ ] The API schema and clients have been updated (`make gen`) If changes to the frontend have been made diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index 473d793386..52b77dba28 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -58,16 +58,20 @@ jobs: dependencies: ${{ matrix.deps }} - name: run job run: make ci-lint-${{ matrix.job }} - test-gen-build: + test-gen: runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v5 - name: Setup authentik env uses: ./.github/actions/setup + with: + dependencies: "system,python,runtime,rust-nightly" - name: generate schema run: make migrate gen-build + - name: generate API clients + run: make gen-client-rs - name: ensure schema is up-to-date - run: git diff --exit-code -- schema.yml blueprints/schema.json + run: git diff --exit-code -- schema.yml blueprints/schema.json packages/client-rust test-migrations: runs-on: ubuntu-latest steps: @@ -326,7 +330,7 @@ jobs: if: always() needs: - lint - - test-gen-build + - test-gen - test-migrations - test-migrations-from-stable - test-unittest diff --git a/CODEOWNERS b/CODEOWNERS index b30e702902..df8cd900aa 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -27,6 +27,7 @@ Makefile @goauthentik/infrastructure .editorconfig @goauthentik/infrastructure CODEOWNERS @goauthentik/infrastructure # Backend packages +packages/client-rust @goauthentik/backend packages/django-channels-postgres @goauthentik/backend packages/django-postgres-cache @goauthentik/backend packages/django-dramatiq-postgres @goauthentik/backend diff --git a/Cargo.lock b/Cargo.lock index 7e04eb34d8..cfd6b03aec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -47,7 +47,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys", + "windows-sys 0.61.2", ] [[package]] @@ -58,7 +58,196 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +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 = "authentik-client" +version = "2026.5.0-rc1" +dependencies = [ + "aws-lc-rs", + "reqwest", + "reqwest-middleware", + "rustls", + "serde", + "serde_json", + "serde_repr", + "serde_with", + "tokio", + "tokio-util", + "url", + "uuid", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "aws-lc-fips-sys" +version = "0.13.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8bce4948d2520386c6d92a6ea2d472300257702242e5a1d01d6add52bd2e7c1" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", + "regex", +] + +[[package]] +name = "aws-lc-rs" +version = "1.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a054912289d18629dc78375ba2c3726a3afe3ff71b4edba9dedfca0e3446d1fc" +dependencies = [ + "aws-lc-fips-sys", + "aws-lc-sys", + "untrusted 0.7.1", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa7e52a4c5c547c741610a2c6f123f3881e409b714cd27e6798ef020c514f0a" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bindgen" +version = "0.72.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", +] + +[[package]] +name = "bitflags" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "cc" +version = "1.2.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +dependencies = [ + "num-traits", + "serde", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", ] [[package]] @@ -101,6 +290,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" +[[package]] +name = "cmake" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d" +dependencies = [ + "cc", +] + [[package]] name = "colorchoice" version = "1.0.5" @@ -113,7 +311,63 @@ version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" dependencies = [ - "windows-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[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" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +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 = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -133,6 +387,43 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + [[package]] name = "eyre" version = "0.6.12" @@ -143,30 +434,633 @@ dependencies = [ "once_cell", ] +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 5.3.0", + "wasip2", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "wasip2", + "wasip3", +] + +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[package]] +name = "h2" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "pin-utils", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "system-configuration", + "tokio", + "tower-service", + "tracing", + "windows-registry", +] + +[[package]] +name = "icu_collections" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + [[package]] name = "indenter" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", + "serde", + "serde_core", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "iri-string" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8e7418f59cc01c88316161279a7f665217ae316b388e58a0d10e29f54f1e5eb" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" + +[[package]] +name = "libloading" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link", +] + +[[package]] +name = "litemap" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + [[package]] name = "memchr" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +[[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 = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "mio" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-conv" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + [[package]] name = "once_cell" version = "1.21.4" @@ -179,6 +1073,87 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + [[package]] name = "proc-macro2" version = "1.0.106" @@ -188,6 +1163,62 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror 2.0.18", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +dependencies = [ + "aws-lc-rs", + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.60.2", +] + [[package]] name = "quote" version = "1.0.45" @@ -197,6 +1228,56 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + [[package]] name = "regex" version = "1.12.3" @@ -226,12 +1307,363 @@ version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +[[package]] +name = "reqwest" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3f43e3283ab1488b624b44b0e988d0acea0b3214e694730a055cb6b2efa801" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "reqwest-middleware" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "199dda04a536b532d0cc04d7979e39b1c763ea749bf91507017069c00b96056f" +dependencies = [ + "anyhow", + "async-trait", + "http", + "reqwest", + "serde", + "thiserror 2.0.18", + "tower-service", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted 0.9.0", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "rustls" +version = "0.23.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4" +dependencies = [ + "aws-lc-rs", + "log", + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-platform-verifier" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + +[[package]] +name = "rustls-webpki" +version = "0.103.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted 0.9.0", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +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.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5414fad8e6907dbdd5bc441a50ae8d6e26151a03b1de04d89a5576de61d01f" +dependencies = [ + "base64", + "chrono", + "hex", + "serde_core", + "serde_json", + "time", +] + +[[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.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + [[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.117" @@ -243,24 +1675,571 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "system-configuration" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" +dependencies = [ + "bitflags", + "core-foundation 0.9.4", + "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 = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.3.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde_core", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" + +[[package]] +name = "tinystr" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +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.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c55a2eff8b69ce66c84f85e1da1c233edc36ceb85a2058d11b0d6a3c7e7569c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "futures-util", + "hashbrown 0.15.5", + "pin-project-lite", + "slab", + "tokio", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[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.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +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.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + [[package]] name = "unicode-ident" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[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.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "uuid" +version = "1.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37" +dependencies = [ + "getrandom 0.4.2", + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[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.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8" +dependencies = [ + "cfg-if", + "futures-util", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + +[[package]] +name = "web-sys" +version = "0.3.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-root-certs" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804f18a4ac2676ffb4e8b5b5fa9ae38af06df08162314f96a68d2a363e21a8ca" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + [[package]] name = "windows-link" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + [[package]] name = "windows-sys" version = "0.61.2" @@ -269,3 +2248,392 @@ checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ "windows-link", ] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[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_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[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_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[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_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[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_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[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_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efbb2a062be311f2ba113ce66f697a4dc589f85e78a4aea276200804cea0ed87" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e8bc7269b54418e7aeeef514aa68f8690b8c0489a06b0136e5f57c4c5ccab89" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/Cargo.toml b/Cargo.toml index 47987f7b26..342e87812a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,11 @@ [workspace] -members = ["website/scripts/docsmg"] +members = ["packages/client-rust", "website/scripts/docsmg"] resolver = "3" [workspace.package] +version = "2026.5.0-rc1" authors = ["authentik Team "] +description = "Making authentication simple." edition = "2024" readme = "README.md" homepage = "https://goauthentik.io" @@ -12,11 +14,38 @@ license-file = "LICENSE" publish = false [workspace.dependencies] -clap = { version = "4.5.59", features = ["derive", "env"] } -colored = "3.1.1" -dotenvy = "0.15.7" -eyre = "0.6.12" -regex = "1.12.3" +aws-lc-rs = { version = "= 1.16.2", features = ["fips"] } +clap = { version = "= 4.6.0", features = ["derive", "env"] } +colored = "= 3.1.1" +dotenvy = "= 0.15.7" +eyre = "= 0.6.12" +regex = "= 1.12.3" +reqwest = { version = "= 0.13.2", features = [ + "form", + "json", + "multipart", + "query", + "rustls", + "stream", +] } +reqwest-middleware = { version = "= 0.5.1", features = [ + "form", + "json", + "multipart", + "query", + "rustls", +] } +rustls = { version = "= 0.23.37", features = ["fips"] } +serde = { version = "= 1.0.228", features = ["derive"] } +serde_json = "= 1.0.149" +serde_repr = "= 0.1.20" +serde_with = { version = "= 3.18.0", default-features = false, features = [ + "base64", +] } +tokio = { version = "= 1.50.0", features = ["full"] } +tokio-util = { version = "= 0.7.18", features = ["full"] } +url = "= 2.5.8" +uuid = { version = "= 1.22.0", features = ["serde", "v4"] } [profile.dev.package.backtrace] opt-level = 3 diff --git a/Makefile b/Makefile index bceb5ed42a..1e83c42b2d 100644 --- a/Makefile +++ b/Makefile @@ -81,10 +81,12 @@ test: ## Run the server tests and produce a coverage report (locally) $(UV) run coverage html $(UV) run coverage report -lint-fix: ## Lint and automatically fix errors in the python source code. Reports spelling errors. +lint-fix-rust: + $(CARGO) +nightly fmt --all -- --config-path "${PWD}/.cargo/rustfmt.toml" + +lint-fix: lint-fix-rust ## Lint and automatically fix errors in the python source code. Reports spelling errors. $(UV) run black $(PY_SOURCES) $(UV) run ruff check --fix $(PY_SOURCES) - $(CARGO) +nightly fmt --all -- --config-path .cargo/rustfmt.toml lint-spellcheck: ## Reports spelling errors. npm run lint:spellcheck @@ -239,10 +241,14 @@ gen-client-go: gen-clean-go ## Build and install the authentik API for Golang make -C ${PWD}/${GEN_API_GO} build version=${NPM_VERSION} go mod edit -replace goauthentik.io/api/v3=./${GEN_API_GO} +gen-client-rs: + make -C "${PWD}/packages/client-rust" build version=${NPM_VERSION} + make lint-fix-rust + gen-dev-config: ## Generate a local development config file $(UV) run scripts/generate_config.py -gen: gen-build gen-client-ts +gen: gen-build gen-client-ts gen-client-rs ######################### ## Node.js @@ -359,13 +365,13 @@ ci-lint-pending-migrations: ci--meta-debug $(UV) run ak makemigrations --check ci-lint-cargo-deny: ci--meta-debug - $(CARGO) deny --locked --workspace check --config .cargo/deny.toml + $(CARGO) deny --locked --workspace check --config "${PWD}/.cargo/deny.toml" ci-lint-cargo-machete: ci--meta-debug $(CARGO) machete ci-lint-rustfmt: ci--meta-debug - $(CARGO) +nightly fmt --all --check -- --config-path .cargo/rustfmt.toml + $(CARGO) +nightly fmt --all --check -- --config-path "${PWD}/.cargo/rustfmt.toml" ci-lint-clippy: ci--meta-debug $(CARGO) clippy --workspace -- -D warnings diff --git a/cspell.config.jsonc b/cspell.config.jsonc index ab807ef90c..3e94ac0dde 100644 --- a/cspell.config.jsonc +++ b/cspell.config.jsonc @@ -231,6 +231,7 @@ "./blueprints/schema.json", // Generated blueprint schema "custom-elements.json", // TypeScript custom element definitions "./gen-*-api", // Generated API Client + "./packages/client-rust/src", // Generated API Client "./schemas/**", // XML Schemas "./authentik/sources/**/schemas", // Source schemas "**vendored**", // Vendored files diff --git a/locale/en/dictionaries/rust.txt b/locale/en/dictionaries/rust.txt index 7c4b914bb2..53b00364a9 100644 --- a/locale/en/dictionaries/rust.txt +++ b/locale/en/dictionaries/rust.txt @@ -1,10 +1,12 @@ allinone argh clippy +impls nasm netns pointee rcgen +repr serde sqlx tcpv diff --git a/packages/client-rust/.openapi-generator-ignore b/packages/client-rust/.openapi-generator-ignore new file mode 100644 index 0000000000..cf96d6b3f1 --- /dev/null +++ b/packages/client-rust/.openapi-generator-ignore @@ -0,0 +1 @@ +Cargo.toml diff --git a/packages/client-rust/Cargo.toml b/packages/client-rust/Cargo.toml new file mode 100644 index 0000000000..20939478b8 --- /dev/null +++ b/packages/client-rust/Cargo.toml @@ -0,0 +1,41 @@ +[package] +name = "authentik-client" +version.workspace = true +authors.workspace = true +description.workspace = true +edition = "2021" +readme.workspace = true +homepage.workspace = true +repository.workspace = true +license-file.workspace = true +publish = false + +[dependencies] +aws-lc-rs.workspace = true +serde.workspace = true +serde_with.workspace = true +serde_json.workspace = true +serde_repr.workspace = true +url.workspace = true +uuid.workspace = true +tokio.workspace = true +tokio-util.workspace = true +reqwest.workspace = true +reqwest-middleware.workspace = true +rustls.workspace = true + +[lints.rust] +non_snake_case = "allow" + +[lints.rustdoc] +invalid_html_tags = "allow" + +[lints.clippy] +derivable_impls = "allow" +empty_docs = "allow" +into_iter_on_ref = "allow" +large_enum_variant = "allow" +needless_return = "allow" + +[package.metadata.cargo-machete] +ignored = ["aws-lc-rs", "rustls"] diff --git a/packages/client-rust/Makefile b/packages/client-rust/Makefile new file mode 100644 index 0000000000..e60dcf7d74 --- /dev/null +++ b/packages/client-rust/Makefile @@ -0,0 +1,24 @@ +.SHELLFLAGS += -x -e +PWD = $(shell pwd) +UID = $(shell id -u) +GID = $(shell id -g) + +build: +ifndef version + $(error Usage: make build version=20xx.xx.xx) +endif + rm -rf src + docker compose run --rm --user "${UID}:${GID}" gen \ + generate \ + -i /schema.yml \ + -g rust \ + -o local \ + -c /local/config.yaml \ + --additional-properties=packageVersion=$(version) + rm -rf \ + .gitignore \ + .openapi-generator \ + .travis.yml \ + docs \ + git_push.sh \ + README.md diff --git a/packages/client-rust/compose.yml b/packages/client-rust/compose.yml new file mode 100644 index 0000000000..fd3ad5c8bb --- /dev/null +++ b/packages/client-rust/compose.yml @@ -0,0 +1,9 @@ +--- +services: + gen: + image: docker.io/openapitools/openapi-generator-cli:v7.20.0 + restart: never + network_mode: none + volumes: + - ./:/local + - ../../schema.yml:/schema.yml:ro diff --git a/packages/client-rust/config.yaml b/packages/client-rust/config.yaml new file mode 100644 index 0000000000..46aa72b843 --- /dev/null +++ b/packages/client-rust/config.yaml @@ -0,0 +1,10 @@ +--- +additionalProperties: + packageName: authentik-client + avoidBoxedModels: true + bestFitInt: true + preferUnsignedInt: true + library: reqwest + supportAsync: true + supportMiddleware: true + repositoryUrl: https://github.com/authentik-community/client-rust.git diff --git a/packages/client-rust/src/apis/admin_api.rs b/packages/client-rust/src/apis/admin_api.rs new file mode 100644 index 0000000000..c04c9aad35 --- /dev/null +++ b/packages/client-rust/src/apis/admin_api.rs @@ -0,0 +1,949 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use tokio::fs::File as TokioFile; +use tokio_util::codec::{BytesCodec, FramedRead}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`admin_apps_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminAppsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_file_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminFileCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_file_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminFileDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_file_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminFileListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_file_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminFileUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_models_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminModelsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_settings_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminSettingsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_settings_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminSettingsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_settings_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminSettingsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_system_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminSystemCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_system_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminSystemRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_version_history_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminVersionHistoryListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_version_history_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminVersionHistoryRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_version_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminVersionRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// Read-only view list all installed apps +pub async fn admin_apps_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/admin/apps/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::App>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::App>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Upload file to storage backend. +pub async fn admin_file_create( + configuration: &configuration::Configuration, + file: std::path::PathBuf, + name: Option<&str>, + usage: Option<&str>, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_form_file = file; + let p_form_name = name; + let p_form_usage = usage; + + let uri_str = format!("{}/admin/file/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + let mut multipart_form = reqwest::multipart::Form::new(); + let file = TokioFile::open(&p_form_file).await?; + let stream = FramedRead::new(file, BytesCodec::new()); + let file_name = p_form_file + .file_name() + .map(|n| n.to_string_lossy().to_string()) + .unwrap_or_default(); + let file_part = + reqwest::multipart::Part::stream(reqwest::Body::wrap_stream(stream)).file_name(file_name); + multipart_form = multipart_form.part("file", file_part); + if let Some(param_value) = p_form_name { + multipart_form = multipart_form.text("name", param_value.to_string()); + } + if let Some(param_value) = p_form_usage { + multipart_form = multipart_form.text("usage", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Delete file from storage backend. +pub async fn admin_file_destroy( + configuration: &configuration::Configuration, + name: Option<&str>, + usage: Option<&str>, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_usage = usage; + + let uri_str = format!("{}/admin/file/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_usage { + req_builder = req_builder.query(&[("usage", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// List files from storage backend. +pub async fn admin_file_list( + configuration: &configuration::Configuration, + manageable_only: Option, + search: Option<&str>, + usage: Option<&str>, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_manageable_only = manageable_only; + let p_query_search = search; + let p_query_usage = usage; + + let uri_str = format!("{}/admin/file/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_manageable_only { + req_builder = req_builder.query(&[("manageable_only", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_usage { + req_builder = req_builder.query(&[("usage", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::FileList>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::FileList>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn admin_file_used_by_list( + configuration: &configuration::Configuration, + name: Option<&str>, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + + let uri_str = format!("{}/admin/file/used_by/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Read-only view list all installed models +pub async fn admin_models_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/admin/models/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::App>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::App>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Settings view +pub async fn admin_settings_partial_update( + configuration: &configuration::Configuration, + patched_settings_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_patched_settings_request = patched_settings_request; + + let uri_str = format!("{}/admin/settings/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_settings_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Settings`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Settings`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Settings view +pub async fn admin_settings_retrieve( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!("{}/admin/settings/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Settings`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Settings`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Settings view +pub async fn admin_settings_update( + configuration: &configuration::Configuration, + settings_request: models::SettingsRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_settings_request = settings_request; + + let uri_str = format!("{}/admin/settings/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_settings_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Settings`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Settings`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get system information. +pub async fn admin_system_create( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!("{}/admin/system/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SystemInfo`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SystemInfo`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get system information. +pub async fn admin_system_retrieve( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!("{}/admin/system/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SystemInfo`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SystemInfo`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// VersionHistory Viewset +pub async fn admin_version_history_list( + configuration: &configuration::Configuration, + build: Option<&str>, + ordering: Option<&str>, + search: Option<&str>, + version: Option<&str>, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_build = build; + let p_query_ordering = ordering; + let p_query_search = search; + let p_query_version = version; + + let uri_str = format!("{}/admin/version/history/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_build { + req_builder = req_builder.query(&[("build", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_version { + req_builder = req_builder.query(&[("version", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::VersionHistory>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::VersionHistory>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// VersionHistory Viewset +pub async fn admin_version_history_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/admin/version/history/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::VersionHistory`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::VersionHistory`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get running and latest version. +pub async fn admin_version_retrieve( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!("{}/admin/version/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Version`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Version`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/authenticators_api.rs b/packages/client-rust/src/apis/authenticators_api.rs new file mode 100644 index 0000000000..ad64510260 --- /dev/null +++ b/packages/client-rust/src/apis/authenticators_api.rs @@ -0,0 +1,5978 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`authenticators_admin_all_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminAllListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_duo_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminDuoCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_duo_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminDuoDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_duo_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminDuoListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_duo_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminDuoPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_duo_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminDuoRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_duo_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminDuoUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_email_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminEmailCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_email_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminEmailDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_email_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminEmailListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_email_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminEmailPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_email_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminEmailRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_email_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminEmailUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_endpoint_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminEndpointCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_endpoint_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminEndpointDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_endpoint_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminEndpointListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_endpoint_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminEndpointPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_endpoint_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminEndpointRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_endpoint_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminEndpointUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_sms_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminSmsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_sms_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminSmsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_sms_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminSmsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_sms_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminSmsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_sms_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminSmsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_sms_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminSmsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_static_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminStaticCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_static_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminStaticDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_static_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminStaticListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_static_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminStaticPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_static_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminStaticRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_static_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminStaticUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_totp_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminTotpCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_totp_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminTotpDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_totp_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminTotpListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_totp_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminTotpPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_totp_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminTotpRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_totp_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminTotpUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_webauthn_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminWebauthnCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_webauthn_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminWebauthnDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_webauthn_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminWebauthnListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_webauthn_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminWebauthnPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_webauthn_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminWebauthnRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_admin_webauthn_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAdminWebauthnUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_all_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsAllListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_duo_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsDuoDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_duo_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsDuoListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_duo_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsDuoPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_duo_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsDuoRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_duo_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsDuoUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_duo_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsDuoUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_email_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsEmailDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_email_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsEmailListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_email_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsEmailPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_email_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsEmailRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_email_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsEmailUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_email_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsEmailUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_endpoint_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsEndpointListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_endpoint_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsEndpointRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_endpoint_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsEndpointUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_sms_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsSmsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_sms_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsSmsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_sms_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsSmsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_sms_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsSmsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_sms_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsSmsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_sms_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsSmsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_static_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsStaticDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_static_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsStaticListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_static_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsStaticPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_static_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsStaticRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_static_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsStaticUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_static_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsStaticUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_totp_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsTotpDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_totp_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsTotpListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_totp_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsTotpPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_totp_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsTotpRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_totp_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsTotpUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_totp_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsTotpUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_webauthn_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsWebauthnDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_webauthn_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsWebauthnListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_webauthn_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsWebauthnPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_webauthn_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsWebauthnRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_webauthn_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsWebauthnUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`authenticators_webauthn_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AuthenticatorsWebauthnUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// Get all devices for current user +pub async fn authenticators_admin_all_list( + configuration: &configuration::Configuration, + user: Option, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_user = user; + + let uri_str = format!("{}/authenticators/admin/all/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_user { + req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::Device>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::Device>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Duo authenticator devices (for admins) +pub async fn authenticators_admin_duo_create( + configuration: &configuration::Configuration, + duo_device_request: models::DuoDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_duo_device_request = duo_device_request; + + let uri_str = format!("{}/authenticators/admin/duo/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_duo_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DuoDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DuoDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Duo authenticator devices (for admins) +pub async fn authenticators_admin_duo_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/admin/duo/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Duo authenticator devices (for admins) +pub async fn authenticators_admin_duo_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/authenticators/admin/duo/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedDuoDeviceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedDuoDeviceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Duo authenticator devices (for admins) +pub async fn authenticators_admin_duo_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_duo_device_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_duo_device_request = patched_duo_device_request; + + let uri_str = format!( + "{}/authenticators/admin/duo/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_duo_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DuoDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DuoDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Duo authenticator devices (for admins) +pub async fn authenticators_admin_duo_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/admin/duo/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DuoDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DuoDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Duo authenticator devices (for admins) +pub async fn authenticators_admin_duo_update( + configuration: &configuration::Configuration, + id: i32, + duo_device_request: models::DuoDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_duo_device_request = duo_device_request; + + let uri_str = format!( + "{}/authenticators/admin/duo/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_duo_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DuoDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DuoDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for email authenticator devices (for admins) +pub async fn authenticators_admin_email_create( + configuration: &configuration::Configuration, + email_device_request: models::EmailDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_email_device_request = email_device_request; + + let uri_str = format!("{}/authenticators/admin/email/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_email_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EmailDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EmailDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for email authenticator devices (for admins) +pub async fn authenticators_admin_email_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/admin/email/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for email authenticator devices (for admins) +pub async fn authenticators_admin_email_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/authenticators/admin/email/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedEmailDeviceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedEmailDeviceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for email authenticator devices (for admins) +pub async fn authenticators_admin_email_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_email_device_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_email_device_request = patched_email_device_request; + + let uri_str = format!( + "{}/authenticators/admin/email/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_email_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EmailDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EmailDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for email authenticator devices (for admins) +pub async fn authenticators_admin_email_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/admin/email/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EmailDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EmailDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for email authenticator devices (for admins) +pub async fn authenticators_admin_email_update( + configuration: &configuration::Configuration, + id: i32, + email_device_request: models::EmailDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_email_device_request = email_device_request; + + let uri_str = format!( + "{}/authenticators/admin/email/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_email_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EmailDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EmailDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Endpoint authenticator devices (for admins) +pub async fn authenticators_admin_endpoint_create( + configuration: &configuration::Configuration, + google_endpoint_device_request: models::GoogleEndpointDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_google_endpoint_device_request = google_endpoint_device_request; + + let uri_str = format!("{}/authenticators/admin/endpoint/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_google_endpoint_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleEndpointDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleEndpointDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Endpoint authenticator devices (for admins) +pub async fn authenticators_admin_endpoint_destroy( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/authenticators/admin/endpoint/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Endpoint authenticator devices (for admins) +pub async fn authenticators_admin_endpoint_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/authenticators/admin/endpoint/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGoogleEndpointDeviceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGoogleEndpointDeviceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Endpoint authenticator devices (for admins) +pub async fn authenticators_admin_endpoint_partial_update( + configuration: &configuration::Configuration, + uuid: &str, + patched_google_endpoint_device_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_patched_google_endpoint_device_request = patched_google_endpoint_device_request; + + let uri_str = format!( + "{}/authenticators/admin/endpoint/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_google_endpoint_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleEndpointDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleEndpointDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Endpoint authenticator devices (for admins) +pub async fn authenticators_admin_endpoint_retrieve( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/authenticators/admin/endpoint/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleEndpointDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleEndpointDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Endpoint authenticator devices (for admins) +pub async fn authenticators_admin_endpoint_update( + configuration: &configuration::Configuration, + uuid: &str, + google_endpoint_device_request: models::GoogleEndpointDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_google_endpoint_device_request = google_endpoint_device_request; + + let uri_str = format!( + "{}/authenticators/admin/endpoint/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_google_endpoint_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleEndpointDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleEndpointDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for sms authenticator devices (for admins) +pub async fn authenticators_admin_sms_create( + configuration: &configuration::Configuration, + sms_device_request: models::SmsDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_sms_device_request = sms_device_request; + + let uri_str = format!("{}/authenticators/admin/sms/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_sms_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SmsDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SmsDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for sms authenticator devices (for admins) +pub async fn authenticators_admin_sms_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/admin/sms/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for sms authenticator devices (for admins) +pub async fn authenticators_admin_sms_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/authenticators/admin/sms/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedSmsDeviceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedSmsDeviceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for sms authenticator devices (for admins) +pub async fn authenticators_admin_sms_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_sms_device_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_sms_device_request = patched_sms_device_request; + + let uri_str = format!( + "{}/authenticators/admin/sms/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_sms_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SmsDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SmsDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for sms authenticator devices (for admins) +pub async fn authenticators_admin_sms_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/admin/sms/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SmsDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SmsDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for sms authenticator devices (for admins) +pub async fn authenticators_admin_sms_update( + configuration: &configuration::Configuration, + id: i32, + sms_device_request: models::SmsDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_sms_device_request = sms_device_request; + + let uri_str = format!( + "{}/authenticators/admin/sms/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_sms_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SmsDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SmsDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for static authenticator devices (for admins) +pub async fn authenticators_admin_static_create( + configuration: &configuration::Configuration, + static_device_request: models::StaticDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_static_device_request = static_device_request; + + let uri_str = format!("{}/authenticators/admin/static/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_static_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::StaticDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::StaticDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for static authenticator devices (for admins) +pub async fn authenticators_admin_static_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/admin/static/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for static authenticator devices (for admins) +pub async fn authenticators_admin_static_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/authenticators/admin/static/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedStaticDeviceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedStaticDeviceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for static authenticator devices (for admins) +pub async fn authenticators_admin_static_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_static_device_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_static_device_request = patched_static_device_request; + + let uri_str = format!( + "{}/authenticators/admin/static/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_static_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::StaticDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::StaticDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for static authenticator devices (for admins) +pub async fn authenticators_admin_static_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/admin/static/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::StaticDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::StaticDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for static authenticator devices (for admins) +pub async fn authenticators_admin_static_update( + configuration: &configuration::Configuration, + id: i32, + static_device_request: models::StaticDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_static_device_request = static_device_request; + + let uri_str = format!( + "{}/authenticators/admin/static/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_static_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::StaticDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::StaticDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for totp authenticator devices (for admins) +pub async fn authenticators_admin_totp_create( + configuration: &configuration::Configuration, + totp_device_request: models::TotpDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_totp_device_request = totp_device_request; + + let uri_str = format!("{}/authenticators/admin/totp/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_totp_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TotpDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TotpDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for totp authenticator devices (for admins) +pub async fn authenticators_admin_totp_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/admin/totp/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for totp authenticator devices (for admins) +pub async fn authenticators_admin_totp_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/authenticators/admin/totp/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedTotpDeviceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedTotpDeviceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for totp authenticator devices (for admins) +pub async fn authenticators_admin_totp_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_totp_device_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_totp_device_request = patched_totp_device_request; + + let uri_str = format!( + "{}/authenticators/admin/totp/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_totp_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TotpDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TotpDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for totp authenticator devices (for admins) +pub async fn authenticators_admin_totp_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/admin/totp/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TotpDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TotpDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for totp authenticator devices (for admins) +pub async fn authenticators_admin_totp_update( + configuration: &configuration::Configuration, + id: i32, + totp_device_request: models::TotpDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_totp_device_request = totp_device_request; + + let uri_str = format!( + "{}/authenticators/admin/totp/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_totp_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TotpDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TotpDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for WebAuthn authenticator devices (for admins) +pub async fn authenticators_admin_webauthn_create( + configuration: &configuration::Configuration, + web_authn_device_request: models::WebAuthnDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_web_authn_device_request = web_authn_device_request; + + let uri_str = format!("{}/authenticators/admin/webauthn/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_web_authn_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::WebAuthnDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::WebAuthnDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for WebAuthn authenticator devices (for admins) +pub async fn authenticators_admin_webauthn_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/admin/webauthn/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for WebAuthn authenticator devices (for admins) +pub async fn authenticators_admin_webauthn_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/authenticators/admin/webauthn/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedWebAuthnDeviceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedWebAuthnDeviceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for WebAuthn authenticator devices (for admins) +pub async fn authenticators_admin_webauthn_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_web_authn_device_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_web_authn_device_request = patched_web_authn_device_request; + + let uri_str = format!( + "{}/authenticators/admin/webauthn/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_web_authn_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::WebAuthnDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::WebAuthnDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for WebAuthn authenticator devices (for admins) +pub async fn authenticators_admin_webauthn_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/admin/webauthn/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::WebAuthnDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::WebAuthnDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for WebAuthn authenticator devices (for admins) +pub async fn authenticators_admin_webauthn_update( + configuration: &configuration::Configuration, + id: i32, + web_authn_device_request: models::WebAuthnDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_web_authn_device_request = web_authn_device_request; + + let uri_str = format!( + "{}/authenticators/admin/webauthn/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_web_authn_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::WebAuthnDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::WebAuthnDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all devices for current user +pub async fn authenticators_all_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/authenticators/all/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::Device>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::Device>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Duo authenticator devices +pub async fn authenticators_duo_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/duo/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Duo authenticator devices +pub async fn authenticators_duo_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/authenticators/duo/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedDuoDeviceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedDuoDeviceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Duo authenticator devices +pub async fn authenticators_duo_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_duo_device_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_duo_device_request = patched_duo_device_request; + + let uri_str = format!( + "{}/authenticators/duo/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_duo_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DuoDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DuoDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Duo authenticator devices +pub async fn authenticators_duo_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/duo/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DuoDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DuoDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Duo authenticator devices +pub async fn authenticators_duo_update( + configuration: &configuration::Configuration, + id: i32, + duo_device_request: models::DuoDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_duo_device_request = duo_device_request; + + let uri_str = format!( + "{}/authenticators/duo/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_duo_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DuoDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DuoDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn authenticators_duo_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/duo/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for email authenticator devices +pub async fn authenticators_email_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/email/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for email authenticator devices +pub async fn authenticators_email_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/authenticators/email/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedEmailDeviceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedEmailDeviceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for email authenticator devices +pub async fn authenticators_email_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_email_device_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_email_device_request = patched_email_device_request; + + let uri_str = format!( + "{}/authenticators/email/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_email_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EmailDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EmailDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for email authenticator devices +pub async fn authenticators_email_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/email/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EmailDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EmailDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for email authenticator devices +pub async fn authenticators_email_update( + configuration: &configuration::Configuration, + id: i32, + email_device_request: models::EmailDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_email_device_request = email_device_request; + + let uri_str = format!( + "{}/authenticators/email/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_email_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EmailDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EmailDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn authenticators_email_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/email/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Endpoint authenticator devices +pub async fn authenticators_endpoint_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/authenticators/endpoint/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGoogleEndpointDeviceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGoogleEndpointDeviceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for Endpoint authenticator devices +pub async fn authenticators_endpoint_retrieve( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/authenticators/endpoint/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleEndpointDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleEndpointDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn authenticators_endpoint_used_by_list( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/authenticators/endpoint/{uuid}/used_by/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for sms authenticator devices +pub async fn authenticators_sms_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/sms/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for sms authenticator devices +pub async fn authenticators_sms_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/authenticators/sms/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedSmsDeviceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedSmsDeviceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for sms authenticator devices +pub async fn authenticators_sms_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_sms_device_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_sms_device_request = patched_sms_device_request; + + let uri_str = format!( + "{}/authenticators/sms/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_sms_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SmsDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SmsDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for sms authenticator devices +pub async fn authenticators_sms_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/sms/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SmsDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SmsDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for sms authenticator devices +pub async fn authenticators_sms_update( + configuration: &configuration::Configuration, + id: i32, + sms_device_request: models::SmsDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_sms_device_request = sms_device_request; + + let uri_str = format!( + "{}/authenticators/sms/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_sms_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SmsDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SmsDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn authenticators_sms_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/sms/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for static authenticator devices +pub async fn authenticators_static_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/static/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for static authenticator devices +pub async fn authenticators_static_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/authenticators/static/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedStaticDeviceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedStaticDeviceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for static authenticator devices +pub async fn authenticators_static_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_static_device_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_static_device_request = patched_static_device_request; + + let uri_str = format!( + "{}/authenticators/static/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_static_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::StaticDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::StaticDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for static authenticator devices +pub async fn authenticators_static_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/static/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::StaticDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::StaticDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for static authenticator devices +pub async fn authenticators_static_update( + configuration: &configuration::Configuration, + id: i32, + static_device_request: models::StaticDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_static_device_request = static_device_request; + + let uri_str = format!( + "{}/authenticators/static/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_static_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::StaticDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::StaticDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn authenticators_static_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/static/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for totp authenticator devices +pub async fn authenticators_totp_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/totp/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for totp authenticator devices +pub async fn authenticators_totp_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/authenticators/totp/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedTotpDeviceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedTotpDeviceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for totp authenticator devices +pub async fn authenticators_totp_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_totp_device_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_totp_device_request = patched_totp_device_request; + + let uri_str = format!( + "{}/authenticators/totp/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_totp_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TotpDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TotpDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for totp authenticator devices +pub async fn authenticators_totp_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/totp/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TotpDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TotpDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for totp authenticator devices +pub async fn authenticators_totp_update( + configuration: &configuration::Configuration, + id: i32, + totp_device_request: models::TotpDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_totp_device_request = totp_device_request; + + let uri_str = format!( + "{}/authenticators/totp/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_totp_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TotpDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TotpDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn authenticators_totp_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/totp/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for WebAuthn authenticator devices +pub async fn authenticators_webauthn_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/webauthn/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for WebAuthn authenticator devices +pub async fn authenticators_webauthn_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/authenticators/webauthn/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedWebAuthnDeviceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedWebAuthnDeviceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for WebAuthn authenticator devices +pub async fn authenticators_webauthn_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_web_authn_device_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_web_authn_device_request = patched_web_authn_device_request; + + let uri_str = format!( + "{}/authenticators/webauthn/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_web_authn_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::WebAuthnDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::WebAuthnDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for WebAuthn authenticator devices +pub async fn authenticators_webauthn_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/webauthn/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::WebAuthnDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::WebAuthnDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Viewset for WebAuthn authenticator devices +pub async fn authenticators_webauthn_update( + configuration: &configuration::Configuration, + id: i32, + web_authn_device_request: models::WebAuthnDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_web_authn_device_request = web_authn_device_request; + + let uri_str = format!( + "{}/authenticators/webauthn/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_web_authn_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::WebAuthnDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::WebAuthnDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn authenticators_webauthn_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/authenticators/webauthn/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/configuration.rs b/packages/client-rust/src/apis/configuration.rs new file mode 100644 index 0000000000..86b35fb5d9 --- /dev/null +++ b/packages/client-rust/src/apis/configuration.rs @@ -0,0 +1,46 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// 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, +} + +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: "/api/v3".to_owned(), + user_agent: Some("OpenAPI-Generator/2026.5.0-rc1/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/packages/client-rust/src/apis/core_api.rs b/packages/client-rust/src/apis/core_api.rs new file mode 100644 index 0000000000..270f794f10 --- /dev/null +++ b/packages/client-rust/src/apis/core_api.rs @@ -0,0 +1,5342 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`core_application_entitlements_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreApplicationEntitlementsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_application_entitlements_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreApplicationEntitlementsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_application_entitlements_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreApplicationEntitlementsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_application_entitlements_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreApplicationEntitlementsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_application_entitlements_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreApplicationEntitlementsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_application_entitlements_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreApplicationEntitlementsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_application_entitlements_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreApplicationEntitlementsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_applications_check_access_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreApplicationsCheckAccessRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_applications_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreApplicationsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_applications_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreApplicationsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_applications_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreApplicationsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_applications_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreApplicationsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_applications_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreApplicationsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_applications_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreApplicationsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_applications_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreApplicationsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_authenticated_sessions_bulk_delete_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreAuthenticatedSessionsBulkDeleteDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_authenticated_sessions_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreAuthenticatedSessionsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_authenticated_sessions_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreAuthenticatedSessionsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_authenticated_sessions_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreAuthenticatedSessionsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_authenticated_sessions_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreAuthenticatedSessionsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_brands_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreBrandsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_brands_current_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreBrandsCurrentRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_brands_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreBrandsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_brands_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreBrandsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_brands_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreBrandsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_brands_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreBrandsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_brands_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreBrandsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_brands_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreBrandsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_groups_add_user_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreGroupsAddUserCreateError { + Status404(), + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_groups_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreGroupsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_groups_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreGroupsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_groups_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreGroupsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_groups_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreGroupsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_groups_remove_user_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreGroupsRemoveUserCreateError { + Status404(), + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_groups_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreGroupsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_groups_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreGroupsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_groups_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreGroupsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_tokens_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreTokensCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_tokens_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreTokensDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_tokens_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreTokensListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_tokens_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreTokensPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_tokens_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreTokensRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_tokens_set_key_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreTokensSetKeyCreateError { + Status400(), + Status404(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_tokens_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreTokensUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_tokens_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreTokensUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_tokens_view_key_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreTokensViewKeyRetrieveError { + Status404(), + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_transactional_applications_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreTransactionalApplicationsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_user_consent_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUserConsentDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_user_consent_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUserConsentListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_user_consent_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUserConsentRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_user_consent_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUserConsentUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_export_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersExportCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_impersonate_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersImpersonateCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_impersonate_end_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersImpersonateEndRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_me_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersMeRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_paths_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersPathsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_recovery_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersRecoveryCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_recovery_email_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersRecoveryEmailCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_service_account_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersServiceAccountCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_set_password_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersSetPasswordCreateError { + Status400(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`core_users_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CoreUsersUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// ApplicationEntitlement Viewset +pub async fn core_application_entitlements_create( + configuration: &configuration::Configuration, + application_entitlement_request: models::ApplicationEntitlementRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_application_entitlement_request = application_entitlement_request; + + let uri_str = format!("{}/core/application_entitlements/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_application_entitlement_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ApplicationEntitlement`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ApplicationEntitlement`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ApplicationEntitlement Viewset +pub async fn core_application_entitlements_destroy( + configuration: &configuration::Configuration, + pbm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + + let uri_str = format!( + "{}/core/application_entitlements/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ApplicationEntitlement Viewset +pub async fn core_application_entitlements_list( + configuration: &configuration::Configuration, + app: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + pbm_uuid: Option<&str>, + search: Option<&str>, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_query_app = app; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_pbm_uuid = pbm_uuid; + let p_query_search = search; + + let uri_str = format!("{}/core/application_entitlements/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_app { + req_builder = req_builder.query(&[("app", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_pbm_uuid { + req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedApplicationEntitlementList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedApplicationEntitlementList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ApplicationEntitlement Viewset +pub async fn core_application_entitlements_partial_update( + configuration: &configuration::Configuration, + pbm_uuid: &str, + patched_application_entitlement_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + let p_body_patched_application_entitlement_request = patched_application_entitlement_request; + + let uri_str = format!( + "{}/core/application_entitlements/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_application_entitlement_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ApplicationEntitlement`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ApplicationEntitlement`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ApplicationEntitlement Viewset +pub async fn core_application_entitlements_retrieve( + configuration: &configuration::Configuration, + pbm_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + + let uri_str = format!( + "{}/core/application_entitlements/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ApplicationEntitlement`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ApplicationEntitlement`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ApplicationEntitlement Viewset +pub async fn core_application_entitlements_update( + configuration: &configuration::Configuration, + pbm_uuid: &str, + application_entitlement_request: models::ApplicationEntitlementRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + let p_body_application_entitlement_request = application_entitlement_request; + + let uri_str = format!( + "{}/core/application_entitlements/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_application_entitlement_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ApplicationEntitlement`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ApplicationEntitlement`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn core_application_entitlements_used_by_list( + configuration: &configuration::Configuration, + pbm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + + let uri_str = format!( + "{}/core/application_entitlements/{pbm_uuid}/used_by/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Check access to a single application by slug +pub async fn core_applications_check_access_retrieve( + configuration: &configuration::Configuration, + slug: &str, + for_user: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_query_for_user = for_user; + + let uri_str = format!( + "{}/core/applications/{slug}/check_access/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_for_user { + req_builder = req_builder.query(&[("for_user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PolicyTestResult`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PolicyTestResult`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Application Viewset +pub async fn core_applications_create( + configuration: &configuration::Configuration, + application_request: models::ApplicationRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_application_request = application_request; + + let uri_str = format!("{}/core/applications/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_application_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Application`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Application`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Application Viewset +pub async fn core_applications_destroy( + configuration: &configuration::Configuration, + slug: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/core/applications/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Custom list method that checks Policy based access instead of guardian +pub async fn core_applications_list( + configuration: &configuration::Configuration, + for_user: Option, + group: Option<&str>, + meta_description: Option<&str>, + meta_launch_url: Option<&str>, + meta_publisher: Option<&str>, + name: Option<&str>, + only_with_launch_url: Option, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + slug: Option<&str>, + superuser_full_list: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_for_user = for_user; + let p_query_group = group; + let p_query_meta_description = meta_description; + let p_query_meta_launch_url = meta_launch_url; + let p_query_meta_publisher = meta_publisher; + let p_query_name = name; + let p_query_only_with_launch_url = only_with_launch_url; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_slug = slug; + let p_query_superuser_full_list = superuser_full_list; + + let uri_str = format!("{}/core/applications/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_for_user { + req_builder = req_builder.query(&[("for_user", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_group { + req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_meta_description { + req_builder = req_builder.query(&[("meta_description", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_meta_launch_url { + req_builder = req_builder.query(&[("meta_launch_url", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_meta_publisher { + req_builder = req_builder.query(&[("meta_publisher", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_only_with_launch_url { + req_builder = req_builder.query(&[("only_with_launch_url", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_slug { + req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_superuser_full_list { + req_builder = req_builder.query(&[("superuser_full_list", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedApplicationList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedApplicationList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Application Viewset +pub async fn core_applications_partial_update( + configuration: &configuration::Configuration, + slug: &str, + patched_application_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_patched_application_request = patched_application_request; + + let uri_str = format!( + "{}/core/applications/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_application_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Application`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Application`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Application Viewset +pub async fn core_applications_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/core/applications/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Application`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Application`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Application Viewset +pub async fn core_applications_update( + configuration: &configuration::Configuration, + slug: &str, + application_request: models::ApplicationRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_application_request = application_request; + + let uri_str = format!( + "{}/core/applications/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_application_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Application`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Application`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn core_applications_used_by_list( + configuration: &configuration::Configuration, + slug: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/core/applications/{slug}/used_by/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Bulk revoke all sessions for multiple users +pub async fn core_authenticated_sessions_bulk_delete_destroy( + configuration: &configuration::Configuration, + user_pks: Vec, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_query_user_pks = user_pks; + + let uri_str = format!( + "{}/core/authenticated_sessions/bulk_delete/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + req_builder = match "multi" { + "multi" => req_builder.query( + &p_query_user_pks + .into_iter() + .map(|p| ("user_pks".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "user_pks", + &p_query_user_pks + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::BulkDeleteSessionResponse`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::BulkDeleteSessionResponse`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatedSession Viewset +pub async fn core_authenticated_sessions_destroy( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/core/authenticated_sessions/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatedSession Viewset +pub async fn core_authenticated_sessions_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + session__last_ip: Option<&str>, + session__last_user_agent: Option<&str>, + user__username: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_session__last_ip = session__last_ip; + let p_query_session__last_user_agent = session__last_user_agent; + let p_query_user__username = user__username; + + let uri_str = format!("{}/core/authenticated_sessions/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_session__last_ip { + req_builder = req_builder.query(&[("session__last_ip", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_session__last_user_agent { + req_builder = req_builder.query(&[("session__last_user_agent", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user__username { + req_builder = req_builder.query(&[("user__username", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedAuthenticatedSessionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedAuthenticatedSessionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatedSession Viewset +pub async fn core_authenticated_sessions_retrieve( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/core/authenticated_sessions/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatedSession`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatedSession`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn core_authenticated_sessions_used_by_list( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/core/authenticated_sessions/{uuid}/used_by/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Brand Viewset +pub async fn core_brands_create( + configuration: &configuration::Configuration, + brand_request: models::BrandRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_brand_request = brand_request; + + let uri_str = format!("{}/core/brands/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_brand_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Brand`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Brand`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get current brand +pub async fn core_brands_current_retrieve( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!("{}/core/brands/current/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::CurrentBrand`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::CurrentBrand`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Brand Viewset +pub async fn core_brands_destroy( + configuration: &configuration::Configuration, + brand_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_brand_uuid = brand_uuid; + + let uri_str = format!( + "{}/core/brands/{brand_uuid}/", + configuration.base_path, + brand_uuid = crate::apis::urlencode(p_path_brand_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Brand Viewset +pub async fn core_brands_list( + configuration: &configuration::Configuration, + brand_uuid: Option<&str>, + branding_default_flow_background: Option<&str>, + branding_favicon: Option<&str>, + branding_logo: Option<&str>, + branding_title: Option<&str>, + client_certificates: Option>, + default: Option, + domain: Option<&str>, + flow_authentication: Option<&str>, + flow_device_code: Option<&str>, + flow_invalidation: Option<&str>, + flow_recovery: Option<&str>, + flow_unenrollment: Option<&str>, + flow_user_settings: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + web_certificate: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_brand_uuid = brand_uuid; + let p_query_branding_default_flow_background = branding_default_flow_background; + let p_query_branding_favicon = branding_favicon; + let p_query_branding_logo = branding_logo; + let p_query_branding_title = branding_title; + let p_query_client_certificates = client_certificates; + let p_query_default = default; + let p_query_domain = domain; + let p_query_flow_authentication = flow_authentication; + let p_query_flow_device_code = flow_device_code; + let p_query_flow_invalidation = flow_invalidation; + let p_query_flow_recovery = flow_recovery; + let p_query_flow_unenrollment = flow_unenrollment; + let p_query_flow_user_settings = flow_user_settings; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_web_certificate = web_certificate; + + let uri_str = format!("{}/core/brands/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_brand_uuid { + req_builder = req_builder.query(&[("brand_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_branding_default_flow_background { + req_builder = + req_builder.query(&[("branding_default_flow_background", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_branding_favicon { + req_builder = req_builder.query(&[("branding_favicon", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_branding_logo { + req_builder = req_builder.query(&[("branding_logo", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_branding_title { + req_builder = req_builder.query(&[("branding_title", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_client_certificates { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("client_certificates".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "client_certificates", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_default { + req_builder = req_builder.query(&[("default", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_domain { + req_builder = req_builder.query(&[("domain", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_flow_authentication { + req_builder = req_builder.query(&[("flow_authentication", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_flow_device_code { + req_builder = req_builder.query(&[("flow_device_code", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_flow_invalidation { + req_builder = req_builder.query(&[("flow_invalidation", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_flow_recovery { + req_builder = req_builder.query(&[("flow_recovery", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_flow_unenrollment { + req_builder = req_builder.query(&[("flow_unenrollment", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_flow_user_settings { + req_builder = req_builder.query(&[("flow_user_settings", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_web_certificate { + req_builder = req_builder.query(&[("web_certificate", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedBrandList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedBrandList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Brand Viewset +pub async fn core_brands_partial_update( + configuration: &configuration::Configuration, + brand_uuid: &str, + patched_brand_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_brand_uuid = brand_uuid; + let p_body_patched_brand_request = patched_brand_request; + + let uri_str = format!( + "{}/core/brands/{brand_uuid}/", + configuration.base_path, + brand_uuid = crate::apis::urlencode(p_path_brand_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_brand_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Brand`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Brand`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Brand Viewset +pub async fn core_brands_retrieve( + configuration: &configuration::Configuration, + brand_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_brand_uuid = brand_uuid; + + let uri_str = format!( + "{}/core/brands/{brand_uuid}/", + configuration.base_path, + brand_uuid = crate::apis::urlencode(p_path_brand_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Brand`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Brand`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Brand Viewset +pub async fn core_brands_update( + configuration: &configuration::Configuration, + brand_uuid: &str, + brand_request: models::BrandRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_brand_uuid = brand_uuid; + let p_body_brand_request = brand_request; + + let uri_str = format!( + "{}/core/brands/{brand_uuid}/", + configuration.base_path, + brand_uuid = crate::apis::urlencode(p_path_brand_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_brand_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Brand`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Brand`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn core_brands_used_by_list( + configuration: &configuration::Configuration, + brand_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_brand_uuid = brand_uuid; + + let uri_str = format!( + "{}/core/brands/{brand_uuid}/used_by/", + configuration.base_path, + brand_uuid = crate::apis::urlencode(p_path_brand_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Add user to group +pub async fn core_groups_add_user_create( + configuration: &configuration::Configuration, + group_uuid: &str, + user_account_request: models::UserAccountRequest, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_group_uuid = group_uuid; + let p_body_user_account_request = user_account_request; + + let uri_str = format!( + "{}/core/groups/{group_uuid}/add_user/", + configuration.base_path, + group_uuid = crate::apis::urlencode(p_path_group_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_account_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group Viewset +pub async fn core_groups_create( + configuration: &configuration::Configuration, + group_request: models::GroupRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_group_request = group_request; + + let uri_str = format!("{}/core/groups/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_group_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Group`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Group`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group Viewset +pub async fn core_groups_destroy( + configuration: &configuration::Configuration, + group_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_group_uuid = group_uuid; + + let uri_str = format!( + "{}/core/groups/{group_uuid}/", + configuration.base_path, + group_uuid = crate::apis::urlencode(p_path_group_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group Viewset +pub async fn core_groups_list( + configuration: &configuration::Configuration, + attributes: Option<&str>, + include_children: Option, + include_inherited_roles: Option, + include_parents: Option, + include_users: Option, + is_superuser: Option, + members_by_pk: Option>, + members_by_username: Option>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_attributes = attributes; + let p_query_include_children = include_children; + let p_query_include_inherited_roles = include_inherited_roles; + let p_query_include_parents = include_parents; + let p_query_include_users = include_users; + let p_query_is_superuser = is_superuser; + let p_query_members_by_pk = members_by_pk; + let p_query_members_by_username = members_by_username; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/core/groups/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_attributes { + req_builder = req_builder.query(&[("attributes", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_include_children { + req_builder = req_builder.query(&[("include_children", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_include_inherited_roles { + req_builder = req_builder.query(&[("include_inherited_roles", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_include_parents { + req_builder = req_builder.query(&[("include_parents", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_include_users { + req_builder = req_builder.query(&[("include_users", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_is_superuser { + req_builder = req_builder.query(&[("is_superuser", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_members_by_pk { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("members_by_pk".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "members_by_pk", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_members_by_username { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("members_by_username".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "members_by_username", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGroupList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGroupList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group Viewset +pub async fn core_groups_partial_update( + configuration: &configuration::Configuration, + group_uuid: &str, + patched_group_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_group_uuid = group_uuid; + let p_body_patched_group_request = patched_group_request; + + let uri_str = format!( + "{}/core/groups/{group_uuid}/", + configuration.base_path, + group_uuid = crate::apis::urlencode(p_path_group_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_group_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Group`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Group`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Remove user from group +pub async fn core_groups_remove_user_create( + configuration: &configuration::Configuration, + group_uuid: &str, + user_account_request: models::UserAccountRequest, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_group_uuid = group_uuid; + let p_body_user_account_request = user_account_request; + + let uri_str = format!( + "{}/core/groups/{group_uuid}/remove_user/", + configuration.base_path, + group_uuid = crate::apis::urlencode(p_path_group_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_account_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group Viewset +pub async fn core_groups_retrieve( + configuration: &configuration::Configuration, + group_uuid: &str, + include_children: Option, + include_inherited_roles: Option, + include_parents: Option, + include_users: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_group_uuid = group_uuid; + let p_query_include_children = include_children; + let p_query_include_inherited_roles = include_inherited_roles; + let p_query_include_parents = include_parents; + let p_query_include_users = include_users; + + let uri_str = format!( + "{}/core/groups/{group_uuid}/", + configuration.base_path, + group_uuid = crate::apis::urlencode(p_path_group_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_include_children { + req_builder = req_builder.query(&[("include_children", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_include_inherited_roles { + req_builder = req_builder.query(&[("include_inherited_roles", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_include_parents { + req_builder = req_builder.query(&[("include_parents", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_include_users { + req_builder = req_builder.query(&[("include_users", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Group`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Group`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group Viewset +pub async fn core_groups_update( + configuration: &configuration::Configuration, + group_uuid: &str, + group_request: models::GroupRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_group_uuid = group_uuid; + let p_body_group_request = group_request; + + let uri_str = format!( + "{}/core/groups/{group_uuid}/", + configuration.base_path, + group_uuid = crate::apis::urlencode(p_path_group_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_group_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Group`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Group`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn core_groups_used_by_list( + configuration: &configuration::Configuration, + group_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_group_uuid = group_uuid; + + let uri_str = format!( + "{}/core/groups/{group_uuid}/used_by/", + configuration.base_path, + group_uuid = crate::apis::urlencode(p_path_group_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Token Viewset +pub async fn core_tokens_create( + configuration: &configuration::Configuration, + token_request: models::TokenRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_token_request = token_request; + + let uri_str = format!("{}/core/tokens/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_token_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Token`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Token`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Token Viewset +pub async fn core_tokens_destroy( + configuration: &configuration::Configuration, + identifier: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_identifier = identifier; + + let uri_str = format!( + "{}/core/tokens/{identifier}/", + configuration.base_path, + identifier = crate::apis::urlencode(p_path_identifier) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Token Viewset +pub async fn core_tokens_list( + configuration: &configuration::Configuration, + description: Option<&str>, + expires: Option, + expiring: Option, + identifier: Option<&str>, + intent: Option<&str>, + managed: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + user__username: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_description = description; + let p_query_expires = expires; + let p_query_expiring = expiring; + let p_query_identifier = identifier; + let p_query_intent = intent; + let p_query_managed = managed; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_user__username = user__username; + + let uri_str = format!("{}/core/tokens/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_description { + req_builder = req_builder.query(&[("description", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_expires { + req_builder = req_builder.query(&[("expires", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_expiring { + req_builder = req_builder.query(&[("expiring", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_identifier { + req_builder = req_builder.query(&[("identifier", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_intent { + req_builder = req_builder.query(&[("intent", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_managed { + req_builder = req_builder.query(&[("managed", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user__username { + req_builder = req_builder.query(&[("user__username", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedTokenList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedTokenList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Token Viewset +pub async fn core_tokens_partial_update( + configuration: &configuration::Configuration, + identifier: &str, + patched_token_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_identifier = identifier; + let p_body_patched_token_request = patched_token_request; + + let uri_str = format!( + "{}/core/tokens/{identifier}/", + configuration.base_path, + identifier = crate::apis::urlencode(p_path_identifier) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_token_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Token`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Token`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Token Viewset +pub async fn core_tokens_retrieve( + configuration: &configuration::Configuration, + identifier: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_identifier = identifier; + + let uri_str = format!( + "{}/core/tokens/{identifier}/", + configuration.base_path, + identifier = crate::apis::urlencode(p_path_identifier) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Token`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Token`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Set token key. Action is logged as event. `authentik_core.set_token_key` permission is required. +pub async fn core_tokens_set_key_create( + configuration: &configuration::Configuration, + identifier: &str, + token_set_key_request: models::TokenSetKeyRequest, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_identifier = identifier; + let p_body_token_set_key_request = token_set_key_request; + + let uri_str = format!( + "{}/core/tokens/{identifier}/set_key/", + configuration.base_path, + identifier = crate::apis::urlencode(p_path_identifier) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_token_set_key_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Token Viewset +pub async fn core_tokens_update( + configuration: &configuration::Configuration, + identifier: &str, + token_request: models::TokenRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_identifier = identifier; + let p_body_token_request = token_request; + + let uri_str = format!( + "{}/core/tokens/{identifier}/", + configuration.base_path, + identifier = crate::apis::urlencode(p_path_identifier) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_token_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Token`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Token`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn core_tokens_used_by_list( + configuration: &configuration::Configuration, + identifier: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_identifier = identifier; + + let uri_str = format!( + "{}/core/tokens/{identifier}/used_by/", + configuration.base_path, + identifier = crate::apis::urlencode(p_path_identifier) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Return token key and log access +pub async fn core_tokens_view_key_retrieve( + configuration: &configuration::Configuration, + identifier: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_identifier = identifier; + + let uri_str = format!( + "{}/core/tokens/{identifier}/view_key/", + configuration.base_path, + identifier = crate::apis::urlencode(p_path_identifier) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TokenView`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TokenView`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Convert data into a blueprint, validate it and apply it +pub async fn core_transactional_applications_update( + configuration: &configuration::Configuration, + transaction_application_request: models::TransactionApplicationRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_body_transaction_application_request = transaction_application_request; + + let uri_str = format!( + "{}/core/transactional/applications/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_transaction_application_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TransactionApplicationResponse`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TransactionApplicationResponse`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserConsent Viewset +pub async fn core_user_consent_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/core/user_consent/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserConsent Viewset +pub async fn core_user_consent_list( + configuration: &configuration::Configuration, + application: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + user: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_application = application; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_user = user; + + let uri_str = format!("{}/core/user_consent/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_application { + req_builder = req_builder.query(&[("application", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user { + req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedUserConsentList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedUserConsentList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserConsent Viewset +pub async fn core_user_consent_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/core/user_consent/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserConsent`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserConsent`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn core_user_consent_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/core/user_consent/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User Viewset +pub async fn core_users_create( + configuration: &configuration::Configuration, + user_request: models::UserRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_user_request = user_request; + + let uri_str = format!("{}/core/users/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::User`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::User`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User Viewset +pub async fn core_users_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/core/users/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Create a data export for this data type. Note that the export is generated asynchronously: this +/// method returns a `DataExport` object that will initially have `completed=false` as well as the +/// permanent URL to that object in the `Location` header. You can poll that URL until +/// `completed=true`, at which point the `file_url` property will contain a URL to download +pub async fn core_users_export_create( + configuration: &configuration::Configuration, + attributes: Option<&str>, + date_joined: Option, + date_joined__gt: Option, + date_joined__lt: Option, + email: Option<&str>, + groups_by_name: Option>, + groups_by_pk: Option>, + is_active: Option, + is_superuser: Option, + last_login: Option, + last_login__gt: Option, + last_login__isnull: Option, + last_login__lt: Option, + last_updated: Option, + last_updated__gt: Option, + last_updated__lt: Option, + name: Option<&str>, + ordering: Option<&str>, + path: Option<&str>, + path_startswith: Option<&str>, + roles_by_name: Option>, + roles_by_pk: Option>, + search: Option<&str>, + r#type: Option>, + username: Option<&str>, + uuid: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_attributes = attributes; + let p_query_date_joined = date_joined; + let p_query_date_joined__gt = date_joined__gt; + let p_query_date_joined__lt = date_joined__lt; + let p_query_email = email; + let p_query_groups_by_name = groups_by_name; + let p_query_groups_by_pk = groups_by_pk; + let p_query_is_active = is_active; + let p_query_is_superuser = is_superuser; + let p_query_last_login = last_login; + let p_query_last_login__gt = last_login__gt; + let p_query_last_login__isnull = last_login__isnull; + let p_query_last_login__lt = last_login__lt; + let p_query_last_updated = last_updated; + let p_query_last_updated__gt = last_updated__gt; + let p_query_last_updated__lt = last_updated__lt; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_path = path; + let p_query_path_startswith = path_startswith; + let p_query_roles_by_name = roles_by_name; + let p_query_roles_by_pk = roles_by_pk; + let p_query_search = search; + let p_query_type = r#type; + let p_query_username = username; + let p_query_uuid = uuid; + + let uri_str = format!("{}/core/users/export/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref param_value) = p_query_attributes { + req_builder = req_builder.query(&[("attributes", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_date_joined { + req_builder = req_builder.query(&[("date_joined", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_date_joined__gt { + req_builder = req_builder.query(&[("date_joined__gt", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_date_joined__lt { + req_builder = req_builder.query(&[("date_joined__lt", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_email { + req_builder = req_builder.query(&[("email", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_groups_by_name { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("groups_by_name".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "groups_by_name", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_groups_by_pk { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("groups_by_pk".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "groups_by_pk", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_is_active { + req_builder = req_builder.query(&[("is_active", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_is_superuser { + req_builder = req_builder.query(&[("is_superuser", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_login { + req_builder = req_builder.query(&[("last_login", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_login__gt { + req_builder = req_builder.query(&[("last_login__gt", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_login__isnull { + req_builder = req_builder.query(&[("last_login__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_login__lt { + req_builder = req_builder.query(&[("last_login__lt", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_updated { + req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_updated__gt { + req_builder = req_builder.query(&[("last_updated__gt", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_updated__lt { + req_builder = req_builder.query(&[("last_updated__lt", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_path { + req_builder = req_builder.query(&[("path", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_path_startswith { + req_builder = req_builder.query(&[("path_startswith", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_roles_by_name { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("roles_by_name".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "roles_by_name", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_roles_by_pk { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("roles_by_pk".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "roles_by_pk", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_type { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("type".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "type", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_username { + req_builder = req_builder.query(&[("username", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_uuid { + req_builder = req_builder.query(&[("uuid", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DataExport`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DataExport`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Impersonate a user +pub async fn core_users_impersonate_create( + configuration: &configuration::Configuration, + id: i32, + impersonation_request: models::ImpersonationRequest, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_impersonation_request = impersonation_request; + + let uri_str = format!( + "{}/core/users/{id}/impersonate/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_impersonation_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// End Impersonation a user +pub async fn core_users_impersonate_end_retrieve( + configuration: &configuration::Configuration, +) -> Result<(), Error> { + let uri_str = format!("{}/core/users/impersonate_end/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User Viewset +pub async fn core_users_list( + configuration: &configuration::Configuration, + attributes: Option<&str>, + date_joined: Option, + date_joined__gt: Option, + date_joined__lt: Option, + email: Option<&str>, + groups_by_name: Option>, + groups_by_pk: Option>, + include_groups: Option, + include_roles: Option, + is_active: Option, + is_superuser: Option, + last_login: Option, + last_login__gt: Option, + last_login__isnull: Option, + last_login__lt: Option, + last_updated: Option, + last_updated__gt: Option, + last_updated__lt: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + path: Option<&str>, + path_startswith: Option<&str>, + roles_by_name: Option>, + roles_by_pk: Option>, + search: Option<&str>, + r#type: Option>, + username: Option<&str>, + uuid: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_attributes = attributes; + let p_query_date_joined = date_joined; + let p_query_date_joined__gt = date_joined__gt; + let p_query_date_joined__lt = date_joined__lt; + let p_query_email = email; + let p_query_groups_by_name = groups_by_name; + let p_query_groups_by_pk = groups_by_pk; + let p_query_include_groups = include_groups; + let p_query_include_roles = include_roles; + let p_query_is_active = is_active; + let p_query_is_superuser = is_superuser; + let p_query_last_login = last_login; + let p_query_last_login__gt = last_login__gt; + let p_query_last_login__isnull = last_login__isnull; + let p_query_last_login__lt = last_login__lt; + let p_query_last_updated = last_updated; + let p_query_last_updated__gt = last_updated__gt; + let p_query_last_updated__lt = last_updated__lt; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_path = path; + let p_query_path_startswith = path_startswith; + let p_query_roles_by_name = roles_by_name; + let p_query_roles_by_pk = roles_by_pk; + let p_query_search = search; + let p_query_type = r#type; + let p_query_username = username; + let p_query_uuid = uuid; + + let uri_str = format!("{}/core/users/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_attributes { + req_builder = req_builder.query(&[("attributes", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_date_joined { + req_builder = req_builder.query(&[("date_joined", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_date_joined__gt { + req_builder = req_builder.query(&[("date_joined__gt", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_date_joined__lt { + req_builder = req_builder.query(&[("date_joined__lt", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_email { + req_builder = req_builder.query(&[("email", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_groups_by_name { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("groups_by_name".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "groups_by_name", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_groups_by_pk { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("groups_by_pk".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "groups_by_pk", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_include_groups { + req_builder = req_builder.query(&[("include_groups", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_include_roles { + req_builder = req_builder.query(&[("include_roles", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_is_active { + req_builder = req_builder.query(&[("is_active", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_is_superuser { + req_builder = req_builder.query(&[("is_superuser", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_login { + req_builder = req_builder.query(&[("last_login", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_login__gt { + req_builder = req_builder.query(&[("last_login__gt", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_login__isnull { + req_builder = req_builder.query(&[("last_login__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_login__lt { + req_builder = req_builder.query(&[("last_login__lt", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_updated { + req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_updated__gt { + req_builder = req_builder.query(&[("last_updated__gt", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_updated__lt { + req_builder = req_builder.query(&[("last_updated__lt", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_path { + req_builder = req_builder.query(&[("path", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_path_startswith { + req_builder = req_builder.query(&[("path_startswith", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_roles_by_name { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("roles_by_name".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "roles_by_name", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_roles_by_pk { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("roles_by_pk".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "roles_by_pk", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_type { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("type".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "type", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_username { + req_builder = req_builder.query(&[("username", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_uuid { + req_builder = req_builder.query(&[("uuid", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedUserList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedUserList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get information about current user +pub async fn core_users_me_retrieve( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!("{}/core/users/me/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SessionUser`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SessionUser`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User Viewset +pub async fn core_users_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_user_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_user_request = patched_user_request; + + let uri_str = format!( + "{}/core/users/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_user_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::User`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::User`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all user paths +pub async fn core_users_paths_retrieve( + configuration: &configuration::Configuration, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_search = search; + + let uri_str = format!("{}/core/users/paths/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserPath`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserPath`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Create a temporary link that a user can use to recover their account +pub async fn core_users_recovery_create( + configuration: &configuration::Configuration, + id: i32, + user_recovery_link_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_user_recovery_link_request = user_recovery_link_request; + + let uri_str = format!( + "{}/core/users/{id}/recovery/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_recovery_link_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Link`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Link`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Send an email with a temporary link that a user can use to recover their account +pub async fn core_users_recovery_email_create( + configuration: &configuration::Configuration, + id: i32, + user_recovery_email_request: models::UserRecoveryEmailRequest, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_user_recovery_email_request = user_recovery_email_request; + + let uri_str = format!( + "{}/core/users/{id}/recovery_email/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_recovery_email_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User Viewset +pub async fn core_users_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/core/users/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::User`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::User`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Create a new user account that is marked as a service account +pub async fn core_users_service_account_create( + configuration: &configuration::Configuration, + user_service_account_request: models::UserServiceAccountRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_user_service_account_request = user_service_account_request; + + let uri_str = format!("{}/core/users/service_account/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_service_account_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserServiceAccountResponse`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserServiceAccountResponse`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Set password for user +pub async fn core_users_set_password_create( + configuration: &configuration::Configuration, + id: i32, + user_password_set_request: models::UserPasswordSetRequest, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_user_password_set_request = user_password_set_request; + + let uri_str = format!( + "{}/core/users/{id}/set_password/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_password_set_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User Viewset +pub async fn core_users_update( + configuration: &configuration::Configuration, + id: i32, + user_request: models::UserRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_user_request = user_request; + + let uri_str = format!( + "{}/core/users/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::User`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::User`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn core_users_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/core/users/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/crypto_api.rs b/packages/client-rust/src/apis/crypto_api.rs new file mode 100644 index 0000000000..e3d834ab97 --- /dev/null +++ b/packages/client-rust/src/apis/crypto_api.rs @@ -0,0 +1,773 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`crypto_certificatekeypairs_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CryptoCertificatekeypairsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`crypto_certificatekeypairs_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CryptoCertificatekeypairsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`crypto_certificatekeypairs_generate_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CryptoCertificatekeypairsGenerateCreateError { + Status400(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`crypto_certificatekeypairs_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CryptoCertificatekeypairsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`crypto_certificatekeypairs_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CryptoCertificatekeypairsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`crypto_certificatekeypairs_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CryptoCertificatekeypairsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`crypto_certificatekeypairs_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CryptoCertificatekeypairsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`crypto_certificatekeypairs_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CryptoCertificatekeypairsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`crypto_certificatekeypairs_view_certificate_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CryptoCertificatekeypairsViewCertificateRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`crypto_certificatekeypairs_view_private_key_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CryptoCertificatekeypairsViewPrivateKeyRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// CertificateKeyPair Viewset +pub async fn crypto_certificatekeypairs_create( + configuration: &configuration::Configuration, + certificate_key_pair_request: models::CertificateKeyPairRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_certificate_key_pair_request = certificate_key_pair_request; + + let uri_str = format!("{}/crypto/certificatekeypairs/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_certificate_key_pair_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::CertificateKeyPair`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::CertificateKeyPair`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// CertificateKeyPair Viewset +pub async fn crypto_certificatekeypairs_destroy( + configuration: &configuration::Configuration, + kp_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_kp_uuid = kp_uuid; + + let uri_str = format!( + "{}/crypto/certificatekeypairs/{kp_uuid}/", + configuration.base_path, + kp_uuid = crate::apis::urlencode(p_path_kp_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Generate a new, self-signed certificate-key pair +pub async fn crypto_certificatekeypairs_generate_create( + configuration: &configuration::Configuration, + certificate_generation_request: models::CertificateGenerationRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_certificate_generation_request = certificate_generation_request; + + let uri_str = format!( + "{}/crypto/certificatekeypairs/generate/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_certificate_generation_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::CertificateKeyPair`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::CertificateKeyPair`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// CertificateKeyPair Viewset +pub async fn crypto_certificatekeypairs_list( + configuration: &configuration::Configuration, + has_key: Option, + key_type: Option>, + managed: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_has_key = has_key; + let p_query_key_type = key_type; + let p_query_managed = managed; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/crypto/certificatekeypairs/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_has_key { + req_builder = req_builder.query(&[("has_key", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_key_type { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("key_type".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "key_type", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_managed { + req_builder = req_builder.query(&[("managed", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedCertificateKeyPairList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedCertificateKeyPairList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// CertificateKeyPair Viewset +pub async fn crypto_certificatekeypairs_partial_update( + configuration: &configuration::Configuration, + kp_uuid: &str, + patched_certificate_key_pair_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_kp_uuid = kp_uuid; + let p_body_patched_certificate_key_pair_request = patched_certificate_key_pair_request; + + let uri_str = format!( + "{}/crypto/certificatekeypairs/{kp_uuid}/", + configuration.base_path, + kp_uuid = crate::apis::urlencode(p_path_kp_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_certificate_key_pair_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::CertificateKeyPair`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::CertificateKeyPair`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// CertificateKeyPair Viewset +pub async fn crypto_certificatekeypairs_retrieve( + configuration: &configuration::Configuration, + kp_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_kp_uuid = kp_uuid; + + let uri_str = format!( + "{}/crypto/certificatekeypairs/{kp_uuid}/", + configuration.base_path, + kp_uuid = crate::apis::urlencode(p_path_kp_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::CertificateKeyPair`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::CertificateKeyPair`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// CertificateKeyPair Viewset +pub async fn crypto_certificatekeypairs_update( + configuration: &configuration::Configuration, + kp_uuid: &str, + certificate_key_pair_request: models::CertificateKeyPairRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_kp_uuid = kp_uuid; + let p_body_certificate_key_pair_request = certificate_key_pair_request; + + let uri_str = format!( + "{}/crypto/certificatekeypairs/{kp_uuid}/", + configuration.base_path, + kp_uuid = crate::apis::urlencode(p_path_kp_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_certificate_key_pair_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::CertificateKeyPair`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::CertificateKeyPair`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn crypto_certificatekeypairs_used_by_list( + configuration: &configuration::Configuration, + kp_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_kp_uuid = kp_uuid; + + let uri_str = format!( + "{}/crypto/certificatekeypairs/{kp_uuid}/used_by/", + configuration.base_path, + kp_uuid = crate::apis::urlencode(p_path_kp_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Return certificate-key pairs certificate and log access +pub async fn crypto_certificatekeypairs_view_certificate_retrieve( + configuration: &configuration::Configuration, + kp_uuid: &str, + download: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_kp_uuid = kp_uuid; + let p_query_download = download; + + let uri_str = format!( + "{}/crypto/certificatekeypairs/{kp_uuid}/view_certificate/", + configuration.base_path, + kp_uuid = crate::apis::urlencode(p_path_kp_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_download { + req_builder = req_builder.query(&[("download", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::CertificateData`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::CertificateData`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Return certificate-key pairs private key and log access +pub async fn crypto_certificatekeypairs_view_private_key_retrieve( + configuration: &configuration::Configuration, + kp_uuid: &str, + download: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_kp_uuid = kp_uuid; + let p_query_download = download; + + let uri_str = format!( + "{}/crypto/certificatekeypairs/{kp_uuid}/view_private_key/", + configuration.base_path, + kp_uuid = crate::apis::urlencode(p_path_kp_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_download { + req_builder = req_builder.query(&[("download", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::CertificateData`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::CertificateData`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/endpoints_api.rs b/packages/client-rust/src/apis/endpoints_api.rs new file mode 100644 index 0000000000..0f8836b0ac --- /dev/null +++ b/packages/client-rust/src/apis/endpoints_api.rs @@ -0,0 +1,4561 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`endpoints_agents_connectors_agent_config_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsConnectorsAgentConfigRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_connectors_auth_fed_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsConnectorsAuthFedCreateError { + Status404(), + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_connectors_auth_ia_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsConnectorsAuthIaCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_connectors_check_in_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsConnectorsCheckInCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_connectors_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsConnectorsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_connectors_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsConnectorsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_connectors_enroll_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsConnectorsEnrollCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_connectors_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsConnectorsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_connectors_mdm_config_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsConnectorsMdmConfigCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_connectors_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsConnectorsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_connectors_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsConnectorsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_connectors_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsConnectorsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_connectors_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsConnectorsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsEnrollmentTokensCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsEnrollmentTokensDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsEnrollmentTokensListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsEnrollmentTokensPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsEnrollmentTokensRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsEnrollmentTokensUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsEnrollmentTokensUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_view_key_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsEnrollmentTokensViewKeyRetrieveError { + Status404(), + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_psso_register_device_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsPssoRegisterDeviceCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_agents_psso_register_user_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsAgentsPssoRegisterUserCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_connectors_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsConnectorsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_connectors_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsConnectorsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_connectors_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsConnectorsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_connectors_types_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsConnectorsTypesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_connectors_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsConnectorsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_device_access_groups_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDeviceAccessGroupsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_device_access_groups_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDeviceAccessGroupsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_device_access_groups_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDeviceAccessGroupsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_device_access_groups_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDeviceAccessGroupsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_device_access_groups_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDeviceAccessGroupsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_device_access_groups_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDeviceAccessGroupsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_device_access_groups_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDeviceAccessGroupsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_device_bindings_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDeviceBindingsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_device_bindings_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDeviceBindingsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_device_bindings_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDeviceBindingsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_device_bindings_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDeviceBindingsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_device_bindings_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDeviceBindingsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_device_bindings_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDeviceBindingsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_device_bindings_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDeviceBindingsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_devices_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDevicesDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_devices_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDevicesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_devices_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDevicesPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_devices_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDevicesRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_devices_summary_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDevicesSummaryRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_devices_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDevicesUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_devices_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsDevicesUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_fleet_connectors_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsFleetConnectorsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_fleet_connectors_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsFleetConnectorsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_fleet_connectors_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsFleetConnectorsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_fleet_connectors_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsFleetConnectorsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_fleet_connectors_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsFleetConnectorsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_fleet_connectors_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsFleetConnectorsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_fleet_connectors_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsFleetConnectorsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_google_chrome_connectors_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsGoogleChromeConnectorsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_google_chrome_connectors_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsGoogleChromeConnectorsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_google_chrome_connectors_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsGoogleChromeConnectorsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_google_chrome_connectors_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsGoogleChromeConnectorsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_google_chrome_connectors_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsGoogleChromeConnectorsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_google_chrome_connectors_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsGoogleChromeConnectorsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`endpoints_google_chrome_connectors_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EndpointsGoogleChromeConnectorsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_connectors_agent_config_retrieve( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!( + "{}/endpoints/agents/connectors/agent_config/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AgentConfig`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AgentConfig`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_connectors_auth_fed_create( + configuration: &configuration::Configuration, + device: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_device = device; + + let uri_str = format!( + "{}/endpoints/agents/connectors/auth_fed/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + req_builder = req_builder.query(&[("device", &p_query_device.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AgentTokenResponse`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AgentTokenResponse`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_connectors_auth_ia_create( + configuration: &configuration::Configuration, +) -> Result> +{ + let uri_str = format!( + "{}/endpoints/agents/connectors/auth_ia/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AgentAuthenticationResponse`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AgentAuthenticationResponse`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_connectors_check_in_create( + configuration: &configuration::Configuration, + device_facts_request: Option, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_device_facts_request = device_facts_request; + + let uri_str = format!( + "{}/endpoints/agents/connectors/check_in/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + req_builder = req_builder.json(&p_body_device_facts_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_connectors_create( + configuration: &configuration::Configuration, + agent_connector_request: models::AgentConnectorRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_agent_connector_request = agent_connector_request; + + let uri_str = format!("{}/endpoints/agents/connectors/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_agent_connector_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AgentConnector`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AgentConnector`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_connectors_destroy( + configuration: &configuration::Configuration, + connector_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + + let uri_str = format!( + "{}/endpoints/agents/connectors/{connector_uuid}/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_connectors_enroll_create( + configuration: &configuration::Configuration, + enroll_request: models::EnrollRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_enroll_request = enroll_request; + + let uri_str = format!( + "{}/endpoints/agents/connectors/enroll/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + req_builder = req_builder.json(&p_body_enroll_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AgentTokenResponse`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AgentTokenResponse`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_connectors_list( + configuration: &configuration::Configuration, + enabled: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_enabled = enabled; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/endpoints/agents/connectors/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_enabled { + req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedAgentConnectorList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedAgentConnectorList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Generate configuration for MDM systems to deploy authentik Agent +pub async fn endpoints_agents_connectors_mdm_config_create( + configuration: &configuration::Configuration, + connector_uuid: &str, + mdm_config_request: models::MdmConfigRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + let p_body_mdm_config_request = mdm_config_request; + + let uri_str = format!( + "{}/endpoints/agents/connectors/{connector_uuid}/mdm_config/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_mdm_config_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MdmConfigResponse`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MdmConfigResponse`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_connectors_partial_update( + configuration: &configuration::Configuration, + connector_uuid: &str, + patched_agent_connector_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + let p_body_patched_agent_connector_request = patched_agent_connector_request; + + let uri_str = format!( + "{}/endpoints/agents/connectors/{connector_uuid}/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_agent_connector_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AgentConnector`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AgentConnector`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_connectors_retrieve( + configuration: &configuration::Configuration, + connector_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + + let uri_str = format!( + "{}/endpoints/agents/connectors/{connector_uuid}/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AgentConnector`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AgentConnector`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_connectors_update( + configuration: &configuration::Configuration, + connector_uuid: &str, + agent_connector_request: models::AgentConnectorRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + let p_body_agent_connector_request = agent_connector_request; + + let uri_str = format!( + "{}/endpoints/agents/connectors/{connector_uuid}/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_agent_connector_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AgentConnector`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AgentConnector`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn endpoints_agents_connectors_used_by_list( + configuration: &configuration::Configuration, + connector_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + + let uri_str = format!( + "{}/endpoints/agents/connectors/{connector_uuid}/used_by/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_enrollment_tokens_create( + configuration: &configuration::Configuration, + enrollment_token_request: models::EnrollmentTokenRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_enrollment_token_request = enrollment_token_request; + + let uri_str = format!( + "{}/endpoints/agents/enrollment_tokens/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_enrollment_token_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EnrollmentToken`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EnrollmentToken`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_enrollment_tokens_destroy( + configuration: &configuration::Configuration, + token_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_token_uuid = token_uuid; + + let uri_str = format!( + "{}/endpoints/agents/enrollment_tokens/{token_uuid}/", + configuration.base_path, + token_uuid = crate::apis::urlencode(p_path_token_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_enrollment_tokens_list( + configuration: &configuration::Configuration, + connector: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + token_uuid: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_connector = connector; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_token_uuid = token_uuid; + + let uri_str = format!( + "{}/endpoints/agents/enrollment_tokens/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_connector { + req_builder = req_builder.query(&[("connector", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_token_uuid { + req_builder = req_builder.query(&[("token_uuid", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedEnrollmentTokenList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedEnrollmentTokenList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_enrollment_tokens_partial_update( + configuration: &configuration::Configuration, + token_uuid: &str, + patched_enrollment_token_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_token_uuid = token_uuid; + let p_body_patched_enrollment_token_request = patched_enrollment_token_request; + + let uri_str = format!( + "{}/endpoints/agents/enrollment_tokens/{token_uuid}/", + configuration.base_path, + token_uuid = crate::apis::urlencode(p_path_token_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_enrollment_token_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EnrollmentToken`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EnrollmentToken`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_enrollment_tokens_retrieve( + configuration: &configuration::Configuration, + token_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_token_uuid = token_uuid; + + let uri_str = format!( + "{}/endpoints/agents/enrollment_tokens/{token_uuid}/", + configuration.base_path, + token_uuid = crate::apis::urlencode(p_path_token_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EnrollmentToken`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EnrollmentToken`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_agents_enrollment_tokens_update( + configuration: &configuration::Configuration, + token_uuid: &str, + enrollment_token_request: models::EnrollmentTokenRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_token_uuid = token_uuid; + let p_body_enrollment_token_request = enrollment_token_request; + + let uri_str = format!( + "{}/endpoints/agents/enrollment_tokens/{token_uuid}/", + configuration.base_path, + token_uuid = crate::apis::urlencode(p_path_token_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_enrollment_token_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EnrollmentToken`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EnrollmentToken`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn endpoints_agents_enrollment_tokens_used_by_list( + configuration: &configuration::Configuration, + token_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_token_uuid = token_uuid; + + let uri_str = format!( + "{}/endpoints/agents/enrollment_tokens/{token_uuid}/used_by/", + configuration.base_path, + token_uuid = crate::apis::urlencode(p_path_token_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Return token key and log access +pub async fn endpoints_agents_enrollment_tokens_view_key_retrieve( + configuration: &configuration::Configuration, + token_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_token_uuid = token_uuid; + + let uri_str = format!( + "{}/endpoints/agents/enrollment_tokens/{token_uuid}/view_key/", + configuration.base_path, + token_uuid = crate::apis::urlencode(p_path_token_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TokenView`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TokenView`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn endpoints_agents_psso_register_device_create( + configuration: &configuration::Configuration, + agent_psso_device_registration_request: models::AgentPssoDeviceRegistrationRequest, +) -> Result< + models::AgentPssoDeviceRegistrationResponse, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_agent_psso_device_registration_request = agent_psso_device_registration_request; + + let uri_str = format!( + "{}/endpoints/agents/psso/register/device/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + req_builder = req_builder.json(&p_body_agent_psso_device_registration_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AgentPssoDeviceRegistrationResponse`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AgentPssoDeviceRegistrationResponse`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn endpoints_agents_psso_register_user_create( + configuration: &configuration::Configuration, + agent_psso_user_registration_request: models::AgentPssoUserRegistrationRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_agent_psso_user_registration_request = agent_psso_user_registration_request; + + let uri_str = format!( + "{}/endpoints/agents/psso/register/user/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + req_builder = req_builder.json(&p_body_agent_psso_user_registration_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserSelf`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserSelf`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Connector Viewset +pub async fn endpoints_connectors_destroy( + configuration: &configuration::Configuration, + connector_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + + let uri_str = format!( + "{}/endpoints/connectors/{connector_uuid}/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Connector Viewset +pub async fn endpoints_connectors_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/endpoints/connectors/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedConnectorList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedConnectorList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Connector Viewset +pub async fn endpoints_connectors_retrieve( + configuration: &configuration::Configuration, + connector_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + + let uri_str = format!( + "{}/endpoints/connectors/{connector_uuid}/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Connector`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Connector`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all creatable types +pub async fn endpoints_connectors_types_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/endpoints/connectors/types/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn endpoints_connectors_used_by_list( + configuration: &configuration::Configuration, + connector_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + + let uri_str = format!( + "{}/endpoints/connectors/{connector_uuid}/used_by/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DeviceAccessGroup Viewset +pub async fn endpoints_device_access_groups_create( + configuration: &configuration::Configuration, + device_access_group_request: models::DeviceAccessGroupRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_device_access_group_request = device_access_group_request; + + let uri_str = format!( + "{}/endpoints/device_access_groups/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_device_access_group_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DeviceAccessGroup`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DeviceAccessGroup`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DeviceAccessGroup Viewset +pub async fn endpoints_device_access_groups_destroy( + configuration: &configuration::Configuration, + pbm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + + let uri_str = format!( + "{}/endpoints/device_access_groups/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DeviceAccessGroup Viewset +pub async fn endpoints_device_access_groups_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + pbm_uuid: Option<&str>, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_pbm_uuid = pbm_uuid; + let p_query_search = search; + + let uri_str = format!( + "{}/endpoints/device_access_groups/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_pbm_uuid { + req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedDeviceAccessGroupList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedDeviceAccessGroupList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DeviceAccessGroup Viewset +pub async fn endpoints_device_access_groups_partial_update( + configuration: &configuration::Configuration, + pbm_uuid: &str, + patched_device_access_group_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + let p_body_patched_device_access_group_request = patched_device_access_group_request; + + let uri_str = format!( + "{}/endpoints/device_access_groups/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_device_access_group_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DeviceAccessGroup`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DeviceAccessGroup`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DeviceAccessGroup Viewset +pub async fn endpoints_device_access_groups_retrieve( + configuration: &configuration::Configuration, + pbm_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + + let uri_str = format!( + "{}/endpoints/device_access_groups/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DeviceAccessGroup`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DeviceAccessGroup`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DeviceAccessGroup Viewset +pub async fn endpoints_device_access_groups_update( + configuration: &configuration::Configuration, + pbm_uuid: &str, + device_access_group_request: models::DeviceAccessGroupRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + let p_body_device_access_group_request = device_access_group_request; + + let uri_str = format!( + "{}/endpoints/device_access_groups/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_device_access_group_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DeviceAccessGroup`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DeviceAccessGroup`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn endpoints_device_access_groups_used_by_list( + configuration: &configuration::Configuration, + pbm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + + let uri_str = format!( + "{}/endpoints/device_access_groups/{pbm_uuid}/used_by/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PolicyBinding Viewset +pub async fn endpoints_device_bindings_create( + configuration: &configuration::Configuration, + device_user_binding_request: models::DeviceUserBindingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_device_user_binding_request = device_user_binding_request; + + let uri_str = format!("{}/endpoints/device_bindings/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_device_user_binding_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DeviceUserBinding`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DeviceUserBinding`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PolicyBinding Viewset +pub async fn endpoints_device_bindings_destroy( + configuration: &configuration::Configuration, + policy_binding_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_binding_uuid = policy_binding_uuid; + + let uri_str = format!( + "{}/endpoints/device_bindings/{policy_binding_uuid}/", + configuration.base_path, + policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PolicyBinding Viewset +pub async fn endpoints_device_bindings_list( + configuration: &configuration::Configuration, + enabled: Option, + order: Option, + ordering: Option<&str>, + page: Option, + page_size: Option, + policy: Option<&str>, + policy__isnull: Option, + search: Option<&str>, + target: Option<&str>, + target_in: Option>, + timeout: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_enabled = enabled; + let p_query_order = order; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_policy = policy; + let p_query_policy__isnull = policy__isnull; + let p_query_search = search; + let p_query_target = target; + let p_query_target_in = target_in; + let p_query_timeout = timeout; + + let uri_str = format!("{}/endpoints/device_bindings/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_enabled { + req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_order { + req_builder = req_builder.query(&[("order", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policy { + req_builder = req_builder.query(&[("policy", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policy__isnull { + req_builder = req_builder.query(&[("policy__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_target { + req_builder = req_builder.query(&[("target", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_target_in { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("target_in".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "target_in", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_timeout { + req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedDeviceUserBindingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedDeviceUserBindingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PolicyBinding Viewset +pub async fn endpoints_device_bindings_partial_update( + configuration: &configuration::Configuration, + policy_binding_uuid: &str, + patched_device_user_binding_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_binding_uuid = policy_binding_uuid; + let p_body_patched_device_user_binding_request = patched_device_user_binding_request; + + let uri_str = format!( + "{}/endpoints/device_bindings/{policy_binding_uuid}/", + configuration.base_path, + policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_device_user_binding_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DeviceUserBinding`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DeviceUserBinding`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PolicyBinding Viewset +pub async fn endpoints_device_bindings_retrieve( + configuration: &configuration::Configuration, + policy_binding_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_binding_uuid = policy_binding_uuid; + + let uri_str = format!( + "{}/endpoints/device_bindings/{policy_binding_uuid}/", + configuration.base_path, + policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DeviceUserBinding`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DeviceUserBinding`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PolicyBinding Viewset +pub async fn endpoints_device_bindings_update( + configuration: &configuration::Configuration, + policy_binding_uuid: &str, + device_user_binding_request: models::DeviceUserBindingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_binding_uuid = policy_binding_uuid; + let p_body_device_user_binding_request = device_user_binding_request; + + let uri_str = format!( + "{}/endpoints/device_bindings/{policy_binding_uuid}/", + configuration.base_path, + policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_device_user_binding_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DeviceUserBinding`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DeviceUserBinding`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn endpoints_device_bindings_used_by_list( + configuration: &configuration::Configuration, + policy_binding_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_binding_uuid = policy_binding_uuid; + + let uri_str = format!( + "{}/endpoints/device_bindings/{policy_binding_uuid}/used_by/", + configuration.base_path, + policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_devices_destroy( + configuration: &configuration::Configuration, + device_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_device_uuid = device_uuid; + + let uri_str = format!( + "{}/endpoints/devices/{device_uuid}/", + configuration.base_path, + device_uuid = crate::apis::urlencode(p_path_device_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_devices_list( + configuration: &configuration::Configuration, + identifier: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_identifier = identifier; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/endpoints/devices/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_identifier { + req_builder = req_builder.query(&[("identifier", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedEndpointDeviceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedEndpointDeviceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_devices_partial_update( + configuration: &configuration::Configuration, + device_uuid: &str, + patched_endpoint_device_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_device_uuid = device_uuid; + let p_body_patched_endpoint_device_request = patched_endpoint_device_request; + + let uri_str = format!( + "{}/endpoints/devices/{device_uuid}/", + configuration.base_path, + device_uuid = crate::apis::urlencode(p_path_device_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_endpoint_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EndpointDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EndpointDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_devices_retrieve( + configuration: &configuration::Configuration, + device_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_device_uuid = device_uuid; + + let uri_str = format!( + "{}/endpoints/devices/{device_uuid}/", + configuration.base_path, + device_uuid = crate::apis::urlencode(p_path_device_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EndpointDeviceDetails`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EndpointDeviceDetails`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_devices_summary_retrieve( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!("{}/endpoints/devices/summary/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DeviceSummary`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DeviceSummary`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn endpoints_devices_update( + configuration: &configuration::Configuration, + device_uuid: &str, + endpoint_device_request: models::EndpointDeviceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_device_uuid = device_uuid; + let p_body_endpoint_device_request = endpoint_device_request; + + let uri_str = format!( + "{}/endpoints/devices/{device_uuid}/", + configuration.base_path, + device_uuid = crate::apis::urlencode(p_path_device_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_endpoint_device_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EndpointDevice`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EndpointDevice`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn endpoints_devices_used_by_list( + configuration: &configuration::Configuration, + device_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_device_uuid = device_uuid; + + let uri_str = format!( + "{}/endpoints/devices/{device_uuid}/used_by/", + configuration.base_path, + device_uuid = crate::apis::urlencode(p_path_device_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// FleetConnector Viewset +pub async fn endpoints_fleet_connectors_create( + configuration: &configuration::Configuration, + fleet_connector_request: models::FleetConnectorRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_fleet_connector_request = fleet_connector_request; + + let uri_str = format!("{}/endpoints/fleet/connectors/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_fleet_connector_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::FleetConnector`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::FleetConnector`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// FleetConnector Viewset +pub async fn endpoints_fleet_connectors_destroy( + configuration: &configuration::Configuration, + connector_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + + let uri_str = format!( + "{}/endpoints/fleet/connectors/{connector_uuid}/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// FleetConnector Viewset +pub async fn endpoints_fleet_connectors_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/endpoints/fleet/connectors/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedFleetConnectorList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedFleetConnectorList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// FleetConnector Viewset +pub async fn endpoints_fleet_connectors_partial_update( + configuration: &configuration::Configuration, + connector_uuid: &str, + patched_fleet_connector_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + let p_body_patched_fleet_connector_request = patched_fleet_connector_request; + + let uri_str = format!( + "{}/endpoints/fleet/connectors/{connector_uuid}/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_fleet_connector_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::FleetConnector`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::FleetConnector`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// FleetConnector Viewset +pub async fn endpoints_fleet_connectors_retrieve( + configuration: &configuration::Configuration, + connector_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + + let uri_str = format!( + "{}/endpoints/fleet/connectors/{connector_uuid}/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::FleetConnector`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::FleetConnector`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// FleetConnector Viewset +pub async fn endpoints_fleet_connectors_update( + configuration: &configuration::Configuration, + connector_uuid: &str, + fleet_connector_request: models::FleetConnectorRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + let p_body_fleet_connector_request = fleet_connector_request; + + let uri_str = format!( + "{}/endpoints/fleet/connectors/{connector_uuid}/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_fleet_connector_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::FleetConnector`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::FleetConnector`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn endpoints_fleet_connectors_used_by_list( + configuration: &configuration::Configuration, + connector_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + + let uri_str = format!( + "{}/endpoints/fleet/connectors/{connector_uuid}/used_by/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleChromeConnector Viewset +pub async fn endpoints_google_chrome_connectors_create( + configuration: &configuration::Configuration, + google_chrome_connector_request: models::GoogleChromeConnectorRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_google_chrome_connector_request = google_chrome_connector_request; + + let uri_str = format!( + "{}/endpoints/google_chrome/connectors/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_google_chrome_connector_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleChromeConnector`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleChromeConnector`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleChromeConnector Viewset +pub async fn endpoints_google_chrome_connectors_destroy( + configuration: &configuration::Configuration, + connector_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + + let uri_str = format!( + "{}/endpoints/google_chrome/connectors/{connector_uuid}/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleChromeConnector Viewset +pub async fn endpoints_google_chrome_connectors_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result< + models::PaginatedGoogleChromeConnectorList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!( + "{}/endpoints/google_chrome/connectors/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGoogleChromeConnectorList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGoogleChromeConnectorList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleChromeConnector Viewset +pub async fn endpoints_google_chrome_connectors_partial_update( + configuration: &configuration::Configuration, + connector_uuid: &str, + patched_google_chrome_connector_request: Option, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + let p_body_patched_google_chrome_connector_request = patched_google_chrome_connector_request; + + let uri_str = format!( + "{}/endpoints/google_chrome/connectors/{connector_uuid}/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_google_chrome_connector_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleChromeConnector`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleChromeConnector`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleChromeConnector Viewset +pub async fn endpoints_google_chrome_connectors_retrieve( + configuration: &configuration::Configuration, + connector_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + + let uri_str = format!( + "{}/endpoints/google_chrome/connectors/{connector_uuid}/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleChromeConnector`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleChromeConnector`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleChromeConnector Viewset +pub async fn endpoints_google_chrome_connectors_update( + configuration: &configuration::Configuration, + connector_uuid: &str, + google_chrome_connector_request: models::GoogleChromeConnectorRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + let p_body_google_chrome_connector_request = google_chrome_connector_request; + + let uri_str = format!( + "{}/endpoints/google_chrome/connectors/{connector_uuid}/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_google_chrome_connector_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleChromeConnector`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleChromeConnector`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn endpoints_google_chrome_connectors_used_by_list( + configuration: &configuration::Configuration, + connector_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connector_uuid = connector_uuid; + + let uri_str = format!( + "{}/endpoints/google_chrome/connectors/{connector_uuid}/used_by/", + configuration.base_path, + connector_uuid = crate::apis::urlencode(p_path_connector_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/enterprise_api.rs b/packages/client-rust/src/apis/enterprise_api.rs new file mode 100644 index 0000000000..d47a536153 --- /dev/null +++ b/packages/client-rust/src/apis/enterprise_api.rs @@ -0,0 +1,707 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`enterprise_license_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnterpriseLicenseCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enterprise_license_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnterpriseLicenseDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enterprise_license_forecast_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnterpriseLicenseForecastRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enterprise_license_install_id_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnterpriseLicenseInstallIdRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enterprise_license_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnterpriseLicenseListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enterprise_license_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnterpriseLicensePartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enterprise_license_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnterpriseLicenseRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enterprise_license_summary_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnterpriseLicenseSummaryRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enterprise_license_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnterpriseLicenseUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`enterprise_license_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EnterpriseLicenseUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// License Viewset +pub async fn enterprise_license_create( + configuration: &configuration::Configuration, + license_request: models::LicenseRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_license_request = license_request; + + let uri_str = format!("{}/enterprise/license/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_license_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::License`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::License`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// License Viewset +pub async fn enterprise_license_destroy( + configuration: &configuration::Configuration, + license_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_license_uuid = license_uuid; + + let uri_str = format!( + "{}/enterprise/license/{license_uuid}/", + configuration.base_path, + license_uuid = crate::apis::urlencode(p_path_license_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Forecast how many users will be required in a year +pub async fn enterprise_license_forecast_retrieve( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!("{}/enterprise/license/forecast/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LicenseForecast`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LicenseForecast`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get install_id +pub async fn enterprise_license_install_id_retrieve( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!("{}/enterprise/license/install_id/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::InstallId`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::InstallId`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// License Viewset +pub async fn enterprise_license_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/enterprise/license/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedLicenseList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedLicenseList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// License Viewset +pub async fn enterprise_license_partial_update( + configuration: &configuration::Configuration, + license_uuid: &str, + patched_license_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_license_uuid = license_uuid; + let p_body_patched_license_request = patched_license_request; + + let uri_str = format!( + "{}/enterprise/license/{license_uuid}/", + configuration.base_path, + license_uuid = crate::apis::urlencode(p_path_license_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_license_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::License`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::License`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// License Viewset +pub async fn enterprise_license_retrieve( + configuration: &configuration::Configuration, + license_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_license_uuid = license_uuid; + + let uri_str = format!( + "{}/enterprise/license/{license_uuid}/", + configuration.base_path, + license_uuid = crate::apis::urlencode(p_path_license_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::License`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::License`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get the total license status +pub async fn enterprise_license_summary_retrieve( + configuration: &configuration::Configuration, + cached: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_cached = cached; + + let uri_str = format!("{}/enterprise/license/summary/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_cached { + req_builder = req_builder.query(&[("cached", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LicenseSummary`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LicenseSummary`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// License Viewset +pub async fn enterprise_license_update( + configuration: &configuration::Configuration, + license_uuid: &str, + license_request: models::LicenseRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_license_uuid = license_uuid; + let p_body_license_request = license_request; + + let uri_str = format!( + "{}/enterprise/license/{license_uuid}/", + configuration.base_path, + license_uuid = crate::apis::urlencode(p_path_license_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_license_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::License`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::License`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn enterprise_license_used_by_list( + configuration: &configuration::Configuration, + license_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_license_uuid = license_uuid; + + let uri_str = format!( + "{}/enterprise/license/{license_uuid}/used_by/", + configuration.base_path, + license_uuid = crate::apis::urlencode(p_path_license_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/events_api.rs b/packages/client-rust/src/apis/events_api.rs new file mode 100644 index 0000000000..8a930537af --- /dev/null +++ b/packages/client-rust/src/apis/events_api.rs @@ -0,0 +1,2507 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`events_events_actions_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsEventsActionsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_events_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsEventsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_events_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsEventsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_events_export_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsEventsExportCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_events_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsEventsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_events_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsEventsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_events_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsEventsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_events_top_per_user_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsEventsTopPerUserListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_events_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsEventsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_events_volume_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsEventsVolumeListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_notifications_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsNotificationsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_notifications_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsNotificationsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_notifications_mark_all_seen_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsNotificationsMarkAllSeenCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_notifications_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsNotificationsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_notifications_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsNotificationsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_notifications_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsNotificationsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_notifications_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsNotificationsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_rules_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsRulesCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_rules_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsRulesDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_rules_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsRulesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_rules_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsRulesPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_rules_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsRulesRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_rules_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsRulesUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_rules_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsRulesUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_transports_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsTransportsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_transports_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsTransportsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_transports_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsTransportsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_transports_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsTransportsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_transports_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsTransportsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_transports_test_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsTransportsTestCreateError { + Status500(), + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_transports_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsTransportsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`events_transports_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum EventsTransportsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// Get all actions +pub async fn events_events_actions_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/events/events/actions/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Event Read-Only Viewset +pub async fn events_events_create( + configuration: &configuration::Configuration, + event_request: models::EventRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_event_request = event_request; + + let uri_str = format!("{}/events/events/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_event_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Event`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Event`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Event Read-Only Viewset +pub async fn events_events_destroy( + configuration: &configuration::Configuration, + event_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_event_uuid = event_uuid; + + let uri_str = format!( + "{}/events/events/{event_uuid}/", + configuration.base_path, + event_uuid = crate::apis::urlencode(p_path_event_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Create a data export for this data type. Note that the export is generated asynchronously: this +/// method returns a `DataExport` object that will initially have `completed=false` as well as the +/// permanent URL to that object in the `Location` header. You can poll that URL until +/// `completed=true`, at which point the `file_url` property will contain a URL to download +pub async fn events_events_export_create( + configuration: &configuration::Configuration, + action: Option<&str>, + actions: Option>, + brand_name: Option<&str>, + client_ip: Option<&str>, + context_authorized_app: Option<&str>, + context_model_app: Option<&str>, + context_model_name: Option<&str>, + context_model_pk: Option<&str>, + ordering: Option<&str>, + search: Option<&str>, + username: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_action = action; + let p_query_actions = actions; + let p_query_brand_name = brand_name; + let p_query_client_ip = client_ip; + let p_query_context_authorized_app = context_authorized_app; + let p_query_context_model_app = context_model_app; + let p_query_context_model_name = context_model_name; + let p_query_context_model_pk = context_model_pk; + let p_query_ordering = ordering; + let p_query_search = search; + let p_query_username = username; + + let uri_str = format!("{}/events/events/export/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref param_value) = p_query_action { + req_builder = req_builder.query(&[("action", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_actions { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("actions".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "actions", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_brand_name { + req_builder = req_builder.query(&[("brand_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_client_ip { + req_builder = req_builder.query(&[("client_ip", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_context_authorized_app { + req_builder = req_builder.query(&[("context_authorized_app", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_context_model_app { + req_builder = req_builder.query(&[("context_model_app", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_context_model_name { + req_builder = req_builder.query(&[("context_model_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_context_model_pk { + req_builder = req_builder.query(&[("context_model_pk", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_username { + req_builder = req_builder.query(&[("username", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DataExport`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DataExport`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Event Read-Only Viewset +pub async fn events_events_list( + configuration: &configuration::Configuration, + action: Option<&str>, + actions: Option>, + brand_name: Option<&str>, + client_ip: Option<&str>, + context_authorized_app: Option<&str>, + context_model_app: Option<&str>, + context_model_name: Option<&str>, + context_model_pk: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + username: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_action = action; + let p_query_actions = actions; + let p_query_brand_name = brand_name; + let p_query_client_ip = client_ip; + let p_query_context_authorized_app = context_authorized_app; + let p_query_context_model_app = context_model_app; + let p_query_context_model_name = context_model_name; + let p_query_context_model_pk = context_model_pk; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_username = username; + + let uri_str = format!("{}/events/events/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_action { + req_builder = req_builder.query(&[("action", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_actions { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("actions".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "actions", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_brand_name { + req_builder = req_builder.query(&[("brand_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_client_ip { + req_builder = req_builder.query(&[("client_ip", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_context_authorized_app { + req_builder = req_builder.query(&[("context_authorized_app", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_context_model_app { + req_builder = req_builder.query(&[("context_model_app", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_context_model_name { + req_builder = req_builder.query(&[("context_model_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_context_model_pk { + req_builder = req_builder.query(&[("context_model_pk", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_username { + req_builder = req_builder.query(&[("username", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedEventList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedEventList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Event Read-Only Viewset +pub async fn events_events_partial_update( + configuration: &configuration::Configuration, + event_uuid: &str, + patched_event_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_event_uuid = event_uuid; + let p_body_patched_event_request = patched_event_request; + + let uri_str = format!( + "{}/events/events/{event_uuid}/", + configuration.base_path, + event_uuid = crate::apis::urlencode(p_path_event_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_event_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Event`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Event`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Event Read-Only Viewset +pub async fn events_events_retrieve( + configuration: &configuration::Configuration, + event_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_event_uuid = event_uuid; + + let uri_str = format!( + "{}/events/events/{event_uuid}/", + configuration.base_path, + event_uuid = crate::apis::urlencode(p_path_event_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Event`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Event`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get the top_n events grouped by user count +pub async fn events_events_top_per_user_list( + configuration: &configuration::Configuration, + action: Option<&str>, + top_n: Option, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_action = action; + let p_query_top_n = top_n; + + let uri_str = format!("{}/events/events/top_per_user/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_action { + req_builder = req_builder.query(&[("action", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_top_n { + req_builder = req_builder.query(&[("top_n", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::EventTopPerUser>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::EventTopPerUser>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Event Read-Only Viewset +pub async fn events_events_update( + configuration: &configuration::Configuration, + event_uuid: &str, + event_request: models::EventRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_event_uuid = event_uuid; + let p_body_event_request = event_request; + + let uri_str = format!( + "{}/events/events/{event_uuid}/", + configuration.base_path, + event_uuid = crate::apis::urlencode(p_path_event_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_event_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Event`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Event`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get event volume for specified filters and timeframe +pub async fn events_events_volume_list( + configuration: &configuration::Configuration, + action: Option<&str>, + actions: Option>, + brand_name: Option<&str>, + client_ip: Option<&str>, + context_authorized_app: Option<&str>, + context_model_app: Option<&str>, + context_model_name: Option<&str>, + context_model_pk: Option<&str>, + history_days: Option, + ordering: Option<&str>, + search: Option<&str>, + username: Option<&str>, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_action = action; + let p_query_actions = actions; + let p_query_brand_name = brand_name; + let p_query_client_ip = client_ip; + let p_query_context_authorized_app = context_authorized_app; + let p_query_context_model_app = context_model_app; + let p_query_context_model_name = context_model_name; + let p_query_context_model_pk = context_model_pk; + let p_query_history_days = history_days; + let p_query_ordering = ordering; + let p_query_search = search; + let p_query_username = username; + + let uri_str = format!("{}/events/events/volume/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_action { + req_builder = req_builder.query(&[("action", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_actions { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("actions".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "actions", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_brand_name { + req_builder = req_builder.query(&[("brand_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_client_ip { + req_builder = req_builder.query(&[("client_ip", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_context_authorized_app { + req_builder = req_builder.query(&[("context_authorized_app", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_context_model_app { + req_builder = req_builder.query(&[("context_model_app", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_context_model_name { + req_builder = req_builder.query(&[("context_model_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_context_model_pk { + req_builder = req_builder.query(&[("context_model_pk", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_history_days { + req_builder = req_builder.query(&[("history_days", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_username { + req_builder = req_builder.query(&[("username", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::EventVolume>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::EventVolume>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Notification Viewset +pub async fn events_notifications_destroy( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/events/notifications/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Notification Viewset +pub async fn events_notifications_list( + configuration: &configuration::Configuration, + body: Option<&str>, + created: Option, + event: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + seen: Option, + severity: Option<&str>, + user: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_body = body; + let p_query_created = created; + let p_query_event = event; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_seen = seen; + let p_query_severity = severity; + let p_query_user = user; + + let uri_str = format!("{}/events/notifications/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_body { + req_builder = req_builder.query(&[("body", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_created { + req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_event { + req_builder = req_builder.query(&[("event", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_seen { + req_builder = req_builder.query(&[("seen", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_severity { + req_builder = req_builder.query(&[("severity", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user { + req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedNotificationList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedNotificationList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mark all the user's notifications as seen +pub async fn events_notifications_mark_all_seen_create( + configuration: &configuration::Configuration, +) -> Result<(), Error> { + let uri_str = format!( + "{}/events/notifications/mark_all_seen/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Notification Viewset +pub async fn events_notifications_partial_update( + configuration: &configuration::Configuration, + uuid: &str, + patched_notification_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_patched_notification_request = patched_notification_request; + + let uri_str = format!( + "{}/events/notifications/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_notification_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Notification`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Notification`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Notification Viewset +pub async fn events_notifications_retrieve( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/events/notifications/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Notification`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Notification`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Notification Viewset +pub async fn events_notifications_update( + configuration: &configuration::Configuration, + uuid: &str, + notification_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_notification_request = notification_request; + + let uri_str = format!( + "{}/events/notifications/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_notification_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Notification`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Notification`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn events_notifications_used_by_list( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/events/notifications/{uuid}/used_by/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationRule Viewset +pub async fn events_rules_create( + configuration: &configuration::Configuration, + notification_rule_request: models::NotificationRuleRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_notification_rule_request = notification_rule_request; + + let uri_str = format!("{}/events/rules/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_notification_rule_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::NotificationRule`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::NotificationRule`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationRule Viewset +pub async fn events_rules_destroy( + configuration: &configuration::Configuration, + pbm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + + let uri_str = format!( + "{}/events/rules/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationRule Viewset +pub async fn events_rules_list( + configuration: &configuration::Configuration, + destination_group__name: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + severity: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_destination_group__name = destination_group__name; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_severity = severity; + + let uri_str = format!("{}/events/rules/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_destination_group__name { + req_builder = req_builder.query(&[("destination_group__name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_severity { + req_builder = req_builder.query(&[("severity", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedNotificationRuleList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedNotificationRuleList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationRule Viewset +pub async fn events_rules_partial_update( + configuration: &configuration::Configuration, + pbm_uuid: &str, + patched_notification_rule_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + let p_body_patched_notification_rule_request = patched_notification_rule_request; + + let uri_str = format!( + "{}/events/rules/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_notification_rule_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::NotificationRule`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::NotificationRule`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationRule Viewset +pub async fn events_rules_retrieve( + configuration: &configuration::Configuration, + pbm_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + + let uri_str = format!( + "{}/events/rules/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::NotificationRule`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::NotificationRule`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationRule Viewset +pub async fn events_rules_update( + configuration: &configuration::Configuration, + pbm_uuid: &str, + notification_rule_request: models::NotificationRuleRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + let p_body_notification_rule_request = notification_rule_request; + + let uri_str = format!( + "{}/events/rules/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_notification_rule_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::NotificationRule`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::NotificationRule`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn events_rules_used_by_list( + configuration: &configuration::Configuration, + pbm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + + let uri_str = format!( + "{}/events/rules/{pbm_uuid}/used_by/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationTransport Viewset +pub async fn events_transports_create( + configuration: &configuration::Configuration, + notification_transport_request: models::NotificationTransportRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_notification_transport_request = notification_transport_request; + + let uri_str = format!("{}/events/transports/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_notification_transport_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::NotificationTransport`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::NotificationTransport`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationTransport Viewset +pub async fn events_transports_destroy( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/events/transports/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationTransport Viewset +pub async fn events_transports_list( + configuration: &configuration::Configuration, + mode: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + send_once: Option, + webhook_url: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_mode = mode; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_send_once = send_once; + let p_query_webhook_url = webhook_url; + + let uri_str = format!("{}/events/transports/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_mode { + req_builder = req_builder.query(&[("mode", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_send_once { + req_builder = req_builder.query(&[("send_once", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_webhook_url { + req_builder = req_builder.query(&[("webhook_url", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedNotificationTransportList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedNotificationTransportList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationTransport Viewset +pub async fn events_transports_partial_update( + configuration: &configuration::Configuration, + uuid: &str, + patched_notification_transport_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_patched_notification_transport_request = patched_notification_transport_request; + + let uri_str = format!( + "{}/events/transports/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_notification_transport_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::NotificationTransport`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::NotificationTransport`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationTransport Viewset +pub async fn events_transports_retrieve( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/events/transports/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::NotificationTransport`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::NotificationTransport`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Send example notification using selected transport. Requires Modify permissions. +pub async fn events_transports_test_create( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/events/transports/{uuid}/test/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::NotificationTransportTest`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::NotificationTransportTest`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationTransport Viewset +pub async fn events_transports_update( + configuration: &configuration::Configuration, + uuid: &str, + notification_transport_request: models::NotificationTransportRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_notification_transport_request = notification_transport_request; + + let uri_str = format!( + "{}/events/transports/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_notification_transport_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::NotificationTransport`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::NotificationTransport`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn events_transports_used_by_list( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/events/transports/{uuid}/used_by/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/flows_api.rs b/packages/client-rust/src/apis/flows_api.rs new file mode 100644 index 0000000000..c5ff77d3d2 --- /dev/null +++ b/packages/client-rust/src/apis/flows_api.rs @@ -0,0 +1,1695 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use tokio::fs::File as TokioFile; +use tokio_util::codec::{BytesCodec, FramedRead}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`flows_bindings_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsBindingsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_bindings_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsBindingsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_bindings_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsBindingsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_bindings_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsBindingsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_bindings_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsBindingsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_bindings_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsBindingsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_bindings_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsBindingsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_executor_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsExecutorGetError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_executor_solve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsExecutorSolveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_inspector_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsInspectorGetError { + Status400(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_instances_cache_clear_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsInstancesCacheClearCreateError { + Status400(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_instances_cache_info_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsInstancesCacheInfoRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_instances_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsInstancesCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_instances_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsInstancesDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_instances_diagram_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsInstancesDiagramRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_instances_execute_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsInstancesExecuteRetrieveError { + Status400(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_instances_export_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsInstancesExportRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_instances_import_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsInstancesImportCreateError { + Status400(models::FlowImportResult), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_instances_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsInstancesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_instances_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsInstancesPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_instances_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsInstancesRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_instances_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsInstancesUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`flows_instances_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum FlowsInstancesUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// FlowStageBinding Viewset +pub async fn flows_bindings_create( + configuration: &configuration::Configuration, + flow_stage_binding_request: models::FlowStageBindingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_flow_stage_binding_request = flow_stage_binding_request; + + let uri_str = format!("{}/flows/bindings/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_flow_stage_binding_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::FlowStageBinding`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::FlowStageBinding`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// FlowStageBinding Viewset +pub async fn flows_bindings_destroy( + configuration: &configuration::Configuration, + fsb_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_fsb_uuid = fsb_uuid; + + let uri_str = format!( + "{}/flows/bindings/{fsb_uuid}/", + configuration.base_path, + fsb_uuid = crate::apis::urlencode(p_path_fsb_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// FlowStageBinding Viewset +pub async fn flows_bindings_list( + configuration: &configuration::Configuration, + evaluate_on_plan: Option, + fsb_uuid: Option<&str>, + invalid_response_action: Option<&str>, + order: Option, + ordering: Option<&str>, + page: Option, + page_size: Option, + pbm_uuid: Option<&str>, + policies: Option>, + policy_engine_mode: Option<&str>, + re_evaluate_policies: Option, + search: Option<&str>, + stage: Option<&str>, + target: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_evaluate_on_plan = evaluate_on_plan; + let p_query_fsb_uuid = fsb_uuid; + let p_query_invalid_response_action = invalid_response_action; + let p_query_order = order; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_pbm_uuid = pbm_uuid; + let p_query_policies = policies; + let p_query_policy_engine_mode = policy_engine_mode; + let p_query_re_evaluate_policies = re_evaluate_policies; + let p_query_search = search; + let p_query_stage = stage; + let p_query_target = target; + + let uri_str = format!("{}/flows/bindings/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_evaluate_on_plan { + req_builder = req_builder.query(&[("evaluate_on_plan", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_fsb_uuid { + req_builder = req_builder.query(&[("fsb_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_invalid_response_action { + req_builder = req_builder.query(&[("invalid_response_action", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_order { + req_builder = req_builder.query(&[("order", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_pbm_uuid { + req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policies { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("policies".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "policies", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_policy_engine_mode { + req_builder = req_builder.query(&[("policy_engine_mode", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_re_evaluate_policies { + req_builder = req_builder.query(&[("re_evaluate_policies", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage { + req_builder = req_builder.query(&[("stage", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_target { + req_builder = req_builder.query(&[("target", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedFlowStageBindingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedFlowStageBindingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// FlowStageBinding Viewset +pub async fn flows_bindings_partial_update( + configuration: &configuration::Configuration, + fsb_uuid: &str, + patched_flow_stage_binding_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_fsb_uuid = fsb_uuid; + let p_body_patched_flow_stage_binding_request = patched_flow_stage_binding_request; + + let uri_str = format!( + "{}/flows/bindings/{fsb_uuid}/", + configuration.base_path, + fsb_uuid = crate::apis::urlencode(p_path_fsb_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_flow_stage_binding_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::FlowStageBinding`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::FlowStageBinding`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// FlowStageBinding Viewset +pub async fn flows_bindings_retrieve( + configuration: &configuration::Configuration, + fsb_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_fsb_uuid = fsb_uuid; + + let uri_str = format!( + "{}/flows/bindings/{fsb_uuid}/", + configuration.base_path, + fsb_uuid = crate::apis::urlencode(p_path_fsb_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::FlowStageBinding`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::FlowStageBinding`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// FlowStageBinding Viewset +pub async fn flows_bindings_update( + configuration: &configuration::Configuration, + fsb_uuid: &str, + flow_stage_binding_request: models::FlowStageBindingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_fsb_uuid = fsb_uuid; + let p_body_flow_stage_binding_request = flow_stage_binding_request; + + let uri_str = format!( + "{}/flows/bindings/{fsb_uuid}/", + configuration.base_path, + fsb_uuid = crate::apis::urlencode(p_path_fsb_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_flow_stage_binding_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::FlowStageBinding`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::FlowStageBinding`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn flows_bindings_used_by_list( + configuration: &configuration::Configuration, + fsb_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_fsb_uuid = fsb_uuid; + + let uri_str = format!( + "{}/flows/bindings/{fsb_uuid}/used_by/", + configuration.base_path, + fsb_uuid = crate::apis::urlencode(p_path_fsb_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get the next pending challenge from the currently active flow. +pub async fn flows_executor_get( + configuration: &configuration::Configuration, + flow_slug: &str, + query: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_flow_slug = flow_slug; + let p_query_query = query; + + let uri_str = format!( + "{}/flows/executor/{flow_slug}/", + configuration.base_path, + flow_slug = crate::apis::urlencode(p_path_flow_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("query", &p_query_query.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ChallengeTypes`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ChallengeTypes`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Solve the previously retrieved challenge and advanced to the next stage. +pub async fn flows_executor_solve( + configuration: &configuration::Configuration, + flow_slug: &str, + query: &str, + flow_challenge_response_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_flow_slug = flow_slug; + let p_query_query = query; + let p_body_flow_challenge_response_request = flow_challenge_response_request; + + let uri_str = format!( + "{}/flows/executor/{flow_slug}/", + configuration.base_path, + flow_slug = crate::apis::urlencode(p_path_flow_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + req_builder = req_builder.query(&[("query", &p_query_query.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_flow_challenge_response_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ChallengeTypes`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ChallengeTypes`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get current flow state and record it +pub async fn flows_inspector_get( + configuration: &configuration::Configuration, + flow_slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_flow_slug = flow_slug; + + let uri_str = format!( + "{}/flows/inspector/{flow_slug}/", + configuration.base_path, + flow_slug = crate::apis::urlencode(p_path_flow_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::FlowInspection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::FlowInspection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Clear flow cache +pub async fn flows_instances_cache_clear_create( + configuration: &configuration::Configuration, +) -> Result<(), Error> { + let uri_str = format!("{}/flows/instances/cache_clear/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Info about cached flows +pub async fn flows_instances_cache_info_retrieve( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!("{}/flows/instances/cache_info/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Cache`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Cache`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Flow Viewset +pub async fn flows_instances_create( + configuration: &configuration::Configuration, + flow_request: models::FlowRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_flow_request = flow_request; + + let uri_str = format!("{}/flows/instances/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_flow_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Flow`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Flow`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Flow Viewset +pub async fn flows_instances_destroy( + configuration: &configuration::Configuration, + slug: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/flows/instances/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Return diagram for flow with slug `slug`, in the format used by flowchart.js +pub async fn flows_instances_diagram_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/flows/instances/{slug}/diagram/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::FlowDiagram`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::FlowDiagram`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Execute flow for current user +pub async fn flows_instances_execute_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/flows/instances/{slug}/execute/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Link`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Link`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Export flow to .yaml file +pub async fn flows_instances_export_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/flows/instances/{slug}/export/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(resp) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Import flow from .yaml file +pub async fn flows_instances_import_create( + configuration: &configuration::Configuration, + file: Option, + clear: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_form_file = file; + let p_form_clear = clear; + + let uri_str = format!("{}/flows/instances/import/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + let mut multipart_form = reqwest::multipart::Form::new(); + if let Some(ref param_value) = p_form_file { + let file = TokioFile::open(param_value).await?; + let stream = FramedRead::new(file, BytesCodec::new()); + let file_name = param_value + .file_name() + .map(|n| n.to_string_lossy().to_string()) + .unwrap_or_default(); + let file_part = reqwest::multipart::Part::stream(reqwest::Body::wrap_stream(stream)) + .file_name(file_name); + multipart_form = multipart_form.part("file", file_part); + } + if let Some(param_value) = p_form_clear { + multipart_form = multipart_form.text("clear", param_value.to_string()); + } + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::FlowImportResult`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::FlowImportResult`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Flow Viewset +pub async fn flows_instances_list( + configuration: &configuration::Configuration, + denied_action: Option<&str>, + designation: Option<&str>, + flow_uuid: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + slug: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_denied_action = denied_action; + let p_query_designation = designation; + let p_query_flow_uuid = flow_uuid; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_slug = slug; + + let uri_str = format!("{}/flows/instances/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_denied_action { + req_builder = req_builder.query(&[("denied_action", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_designation { + req_builder = req_builder.query(&[("designation", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_flow_uuid { + req_builder = req_builder.query(&[("flow_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_slug { + req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedFlowList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedFlowList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Flow Viewset +pub async fn flows_instances_partial_update( + configuration: &configuration::Configuration, + slug: &str, + patched_flow_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_patched_flow_request = patched_flow_request; + + let uri_str = format!( + "{}/flows/instances/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_flow_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Flow`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Flow`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Flow Viewset +pub async fn flows_instances_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/flows/instances/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Flow`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Flow`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Flow Viewset +pub async fn flows_instances_update( + configuration: &configuration::Configuration, + slug: &str, + flow_request: models::FlowRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_flow_request = flow_request; + + let uri_str = format!( + "{}/flows/instances/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_flow_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Flow`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Flow`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn flows_instances_used_by_list( + configuration: &configuration::Configuration, + slug: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/flows/instances/{slug}/used_by/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/lifecycle_api.rs b/packages/client-rust/src/apis/lifecycle_api.rs new file mode 100644 index 0000000000..efbcfef996 --- /dev/null +++ b/packages/client-rust/src/apis/lifecycle_api.rs @@ -0,0 +1,735 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`lifecycle_iterations_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LifecycleIterationsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`lifecycle_iterations_latest_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LifecycleIterationsLatestRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`lifecycle_iterations_list_open`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LifecycleIterationsListOpenError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`lifecycle_reviews_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LifecycleReviewsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`lifecycle_rules_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LifecycleRulesCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`lifecycle_rules_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LifecycleRulesDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`lifecycle_rules_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LifecycleRulesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`lifecycle_rules_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LifecycleRulesPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`lifecycle_rules_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LifecycleRulesRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`lifecycle_rules_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum LifecycleRulesUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// Mixin to validate that a valid enterprise license exists before allowing to save the object +pub async fn lifecycle_iterations_create( + configuration: &configuration::Configuration, + lifecycle_iteration_request: models::LifecycleIterationRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_lifecycle_iteration_request = lifecycle_iteration_request; + + let uri_str = format!("{}/lifecycle/iterations/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_lifecycle_iteration_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LifecycleIteration`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LifecycleIteration`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to validate that a valid enterprise license exists before allowing to save the object +pub async fn lifecycle_iterations_latest_retrieve( + configuration: &configuration::Configuration, + content_type: &str, + object_id: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_content_type = content_type; + let p_path_object_id = object_id; + + let uri_str = format!( + "{}/lifecycle/iterations/latest/{content_type}/{object_id}/", + configuration.base_path, + content_type = crate::apis::urlencode(p_path_content_type), + object_id = crate::apis::urlencode(p_path_object_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LifecycleIteration`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LifecycleIteration`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to validate that a valid enterprise license exists before allowing to save the object +pub async fn lifecycle_iterations_list_open( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + user_is_reviewer: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_user_is_reviewer = user_is_reviewer; + + let uri_str = format!("{}/lifecycle/iterations/open/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user_is_reviewer { + req_builder = req_builder.query(&[("user_is_reviewer", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedLifecycleIterationList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedLifecycleIterationList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to validate that a valid enterprise license exists before allowing to save the object +pub async fn lifecycle_reviews_create( + configuration: &configuration::Configuration, + review_request: models::ReviewRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_review_request = review_request; + + let uri_str = format!("{}/lifecycle/reviews/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_review_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Review`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Review`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn lifecycle_rules_create( + configuration: &configuration::Configuration, + lifecycle_rule_request: models::LifecycleRuleRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_lifecycle_rule_request = lifecycle_rule_request; + + let uri_str = format!("{}/lifecycle/rules/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_lifecycle_rule_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LifecycleRule`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LifecycleRule`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn lifecycle_rules_destroy( + configuration: &configuration::Configuration, + id: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/lifecycle/rules/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn lifecycle_rules_list( + configuration: &configuration::Configuration, + content_type__model: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_content_type__model = content_type__model; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/lifecycle/rules/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_content_type__model { + req_builder = req_builder.query(&[("content_type__model", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedLifecycleRuleList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedLifecycleRuleList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn lifecycle_rules_partial_update( + configuration: &configuration::Configuration, + id: &str, + patched_lifecycle_rule_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_lifecycle_rule_request = patched_lifecycle_rule_request; + + let uri_str = format!( + "{}/lifecycle/rules/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_lifecycle_rule_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LifecycleRule`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LifecycleRule`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn lifecycle_rules_retrieve( + configuration: &configuration::Configuration, + id: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/lifecycle/rules/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LifecycleRule`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LifecycleRule`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn lifecycle_rules_update( + configuration: &configuration::Configuration, + id: &str, + lifecycle_rule_request: models::LifecycleRuleRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_lifecycle_rule_request = lifecycle_rule_request; + + let uri_str = format!( + "{}/lifecycle/rules/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_lifecycle_rule_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LifecycleRule`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LifecycleRule`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/managed_api.rs b/packages/client-rust/src/apis/managed_api.rs new file mode 100644 index 0000000000..e047a0bb52 --- /dev/null +++ b/packages/client-rust/src/apis/managed_api.rs @@ -0,0 +1,651 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`managed_blueprints_apply_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ManagedBlueprintsApplyCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`managed_blueprints_available_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ManagedBlueprintsAvailableListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`managed_blueprints_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ManagedBlueprintsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`managed_blueprints_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ManagedBlueprintsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`managed_blueprints_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ManagedBlueprintsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`managed_blueprints_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ManagedBlueprintsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`managed_blueprints_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ManagedBlueprintsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`managed_blueprints_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ManagedBlueprintsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`managed_blueprints_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ManagedBlueprintsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// Apply a blueprint +pub async fn managed_blueprints_apply_create( + configuration: &configuration::Configuration, + instance_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_instance_uuid = instance_uuid; + + let uri_str = format!( + "{}/managed/blueprints/{instance_uuid}/apply/", + configuration.base_path, + instance_uuid = crate::apis::urlencode(p_path_instance_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::BlueprintInstance`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::BlueprintInstance`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get blueprints +pub async fn managed_blueprints_available_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/managed/blueprints/available/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::BlueprintFile>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::BlueprintFile>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Blueprint instances +pub async fn managed_blueprints_create( + configuration: &configuration::Configuration, + blueprint_instance_request: models::BlueprintInstanceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_blueprint_instance_request = blueprint_instance_request; + + let uri_str = format!("{}/managed/blueprints/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_blueprint_instance_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::BlueprintInstance`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::BlueprintInstance`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Blueprint instances +pub async fn managed_blueprints_destroy( + configuration: &configuration::Configuration, + instance_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_instance_uuid = instance_uuid; + + let uri_str = format!( + "{}/managed/blueprints/{instance_uuid}/", + configuration.base_path, + instance_uuid = crate::apis::urlencode(p_path_instance_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Blueprint instances +pub async fn managed_blueprints_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + path: Option<&str>, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_path = path; + let p_query_search = search; + + let uri_str = format!("{}/managed/blueprints/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_path { + req_builder = req_builder.query(&[("path", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedBlueprintInstanceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedBlueprintInstanceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Blueprint instances +pub async fn managed_blueprints_partial_update( + configuration: &configuration::Configuration, + instance_uuid: &str, + patched_blueprint_instance_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_instance_uuid = instance_uuid; + let p_body_patched_blueprint_instance_request = patched_blueprint_instance_request; + + let uri_str = format!( + "{}/managed/blueprints/{instance_uuid}/", + configuration.base_path, + instance_uuid = crate::apis::urlencode(p_path_instance_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_blueprint_instance_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::BlueprintInstance`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::BlueprintInstance`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Blueprint instances +pub async fn managed_blueprints_retrieve( + configuration: &configuration::Configuration, + instance_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_instance_uuid = instance_uuid; + + let uri_str = format!( + "{}/managed/blueprints/{instance_uuid}/", + configuration.base_path, + instance_uuid = crate::apis::urlencode(p_path_instance_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::BlueprintInstance`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::BlueprintInstance`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Blueprint instances +pub async fn managed_blueprints_update( + configuration: &configuration::Configuration, + instance_uuid: &str, + blueprint_instance_request: models::BlueprintInstanceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_instance_uuid = instance_uuid; + let p_body_blueprint_instance_request = blueprint_instance_request; + + let uri_str = format!( + "{}/managed/blueprints/{instance_uuid}/", + configuration.base_path, + instance_uuid = crate::apis::urlencode(p_path_instance_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_blueprint_instance_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::BlueprintInstance`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::BlueprintInstance`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn managed_blueprints_used_by_list( + configuration: &configuration::Configuration, + instance_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_instance_uuid = instance_uuid; + + let uri_str = format!( + "{}/managed/blueprints/{instance_uuid}/used_by/", + configuration.base_path, + instance_uuid = crate::apis::urlencode(p_path_instance_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/mod.rs b/packages/client-rust/src/apis/mod.rs new file mode 100644 index 0000000000..69b6094918 --- /dev/null +++ b/packages/client-rust/src/apis/mod.rs @@ -0,0 +1,150 @@ +use std::{error, 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") +} + +/// Internal use only +/// A content type supported by this client. +#[allow(dead_code)] +enum ContentType { + Json, + Text, + Unsupported(String), +} + +impl From<&str> for ContentType { + fn from(content_type: &str) -> Self { + if content_type.starts_with("application") && content_type.contains("json") { + return Self::Json; + } else if content_type.starts_with("text/plain") { + return Self::Text; + } else { + return Self::Unsupported(content_type.to_string()); + } + } +} + +pub mod admin_api; +pub mod authenticators_api; +pub mod core_api; +pub mod crypto_api; +pub mod endpoints_api; +pub mod enterprise_api; +pub mod events_api; +pub mod flows_api; +pub mod lifecycle_api; +pub mod managed_api; +pub mod oauth2_api; +pub mod outposts_api; +pub mod policies_api; +pub mod propertymappings_api; +pub mod providers_api; +pub mod rac_api; +pub mod rbac_api; +pub mod reports_api; +pub mod root_api; +pub mod schema_api; +pub mod sources_api; +pub mod ssf_api; +pub mod stages_api; +pub mod tasks_api; +pub mod tenants_api; + +pub mod configuration; diff --git a/packages/client-rust/src/apis/oauth2_api.rs b/packages/client-rust/src/apis/oauth2_api.rs new file mode 100644 index 0000000000..1c5f7220a6 --- /dev/null +++ b/packages/client-rust/src/apis/oauth2_api.rs @@ -0,0 +1,872 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`oauth2_access_tokens_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Oauth2AccessTokensDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`oauth2_access_tokens_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Oauth2AccessTokensListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`oauth2_access_tokens_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Oauth2AccessTokensRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`oauth2_access_tokens_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Oauth2AccessTokensUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`oauth2_authorization_codes_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Oauth2AuthorizationCodesDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`oauth2_authorization_codes_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Oauth2AuthorizationCodesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`oauth2_authorization_codes_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Oauth2AuthorizationCodesRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`oauth2_authorization_codes_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Oauth2AuthorizationCodesUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`oauth2_refresh_tokens_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Oauth2RefreshTokensDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`oauth2_refresh_tokens_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Oauth2RefreshTokensListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`oauth2_refresh_tokens_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Oauth2RefreshTokensRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`oauth2_refresh_tokens_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Oauth2RefreshTokensUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// AccessToken Viewset +pub async fn oauth2_access_tokens_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/oauth2/access_tokens/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AccessToken Viewset +pub async fn oauth2_access_tokens_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + provider: Option, + search: Option<&str>, + user: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_provider = provider; + let p_query_search = search; + let p_query_user = user; + + let uri_str = format!("{}/oauth2/access_tokens/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_provider { + req_builder = req_builder.query(&[("provider", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user { + req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedTokenModelList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedTokenModelList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AccessToken Viewset +pub async fn oauth2_access_tokens_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/oauth2/access_tokens/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TokenModel`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TokenModel`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn oauth2_access_tokens_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/oauth2/access_tokens/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthorizationCode Viewset +pub async fn oauth2_authorization_codes_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/oauth2/authorization_codes/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthorizationCode Viewset +pub async fn oauth2_authorization_codes_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + provider: Option, + search: Option<&str>, + user: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_provider = provider; + let p_query_search = search; + let p_query_user = user; + + let uri_str = format!("{}/oauth2/authorization_codes/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_provider { + req_builder = req_builder.query(&[("provider", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user { + req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedExpiringBaseGrantModelList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedExpiringBaseGrantModelList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthorizationCode Viewset +pub async fn oauth2_authorization_codes_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/oauth2/authorization_codes/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ExpiringBaseGrantModel`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ExpiringBaseGrantModel`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn oauth2_authorization_codes_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/oauth2/authorization_codes/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RefreshToken Viewset +pub async fn oauth2_refresh_tokens_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/oauth2/refresh_tokens/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RefreshToken Viewset +pub async fn oauth2_refresh_tokens_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + provider: Option, + search: Option<&str>, + user: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_provider = provider; + let p_query_search = search; + let p_query_user = user; + + let uri_str = format!("{}/oauth2/refresh_tokens/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_provider { + req_builder = req_builder.query(&[("provider", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user { + req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedTokenModelList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedTokenModelList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RefreshToken Viewset +pub async fn oauth2_refresh_tokens_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/oauth2/refresh_tokens/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TokenModel`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TokenModel`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn oauth2_refresh_tokens_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/oauth2/refresh_tokens/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/outposts_api.rs b/packages/client-rust/src/apis/outposts_api.rs new file mode 100644 index 0000000000..7bb2611215 --- /dev/null +++ b/packages/client-rust/src/apis/outposts_api.rs @@ -0,0 +1,2686 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`outposts_instances_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsInstancesCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_instances_default_settings_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsInstancesDefaultSettingsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_instances_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsInstancesDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_instances_health_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsInstancesHealthListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_instances_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsInstancesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_instances_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsInstancesPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_instances_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsInstancesRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_instances_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsInstancesUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_instances_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsInstancesUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_ldap_access_check`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsLdapAccessCheckError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_ldap_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsLdapListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_proxy_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsProxyListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_radius_access_check`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsRadiusAccessCheckError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_radius_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsRadiusListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_all_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsAllDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_all_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsAllListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_all_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsAllRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_all_state_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsAllStateRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_all_types_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsAllTypesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_all_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsAllUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_docker_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsDockerCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_docker_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsDockerDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_docker_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsDockerListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_docker_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsDockerPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_docker_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsDockerRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_docker_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsDockerUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_docker_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsDockerUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_kubernetes_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsKubernetesCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_kubernetes_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsKubernetesDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_kubernetes_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsKubernetesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_kubernetes_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsKubernetesPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_kubernetes_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsKubernetesRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_kubernetes_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsKubernetesUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`outposts_service_connections_kubernetes_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OutpostsServiceConnectionsKubernetesUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// Outpost Viewset +pub async fn outposts_instances_create( + configuration: &configuration::Configuration, + outpost_request: models::OutpostRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_outpost_request = outpost_request; + + let uri_str = format!("{}/outposts/instances/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_outpost_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Outpost`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Outpost`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Global default outpost config +pub async fn outposts_instances_default_settings_retrieve( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!( + "{}/outposts/instances/default_settings/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::OutpostDefaultConfig`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::OutpostDefaultConfig`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Outpost Viewset +pub async fn outposts_instances_destroy( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/outposts/instances/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get outposts current health +pub async fn outposts_instances_health_list( + configuration: &configuration::Configuration, + uuid: &str, + managed__icontains: Option<&str>, + managed__iexact: Option<&str>, + name__icontains: Option<&str>, + name__iexact: Option<&str>, + ordering: Option<&str>, + providers__isnull: Option, + providers_by_pk: Option>, + search: Option<&str>, + service_connection__name__icontains: Option<&str>, + service_connection__name__iexact: Option<&str>, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_query_managed__icontains = managed__icontains; + let p_query_managed__iexact = managed__iexact; + let p_query_name__icontains = name__icontains; + let p_query_name__iexact = name__iexact; + let p_query_ordering = ordering; + let p_query_providers__isnull = providers__isnull; + let p_query_providers_by_pk = providers_by_pk; + let p_query_search = search; + let p_query_service_connection__name__icontains = service_connection__name__icontains; + let p_query_service_connection__name__iexact = service_connection__name__iexact; + + let uri_str = format!( + "{}/outposts/instances/{uuid}/health/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_managed__icontains { + req_builder = req_builder.query(&[("managed__icontains", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_managed__iexact { + req_builder = req_builder.query(&[("managed__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name__icontains { + req_builder = req_builder.query(&[("name__icontains", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name__iexact { + req_builder = req_builder.query(&[("name__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_providers__isnull { + req_builder = req_builder.query(&[("providers__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_providers_by_pk { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("providers_by_pk".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "providers_by_pk", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_service_connection__name__icontains { + req_builder = req_builder.query(&[( + "service_connection__name__icontains", + ¶m_value.to_string(), + )]); + } + if let Some(ref param_value) = p_query_service_connection__name__iexact { + req_builder = + req_builder.query(&[("service_connection__name__iexact", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::OutpostHealth>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::OutpostHealth>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Outpost Viewset +pub async fn outposts_instances_list( + configuration: &configuration::Configuration, + managed__icontains: Option<&str>, + managed__iexact: Option<&str>, + name__icontains: Option<&str>, + name__iexact: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + providers__isnull: Option, + providers_by_pk: Option>, + search: Option<&str>, + service_connection__name__icontains: Option<&str>, + service_connection__name__iexact: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_managed__icontains = managed__icontains; + let p_query_managed__iexact = managed__iexact; + let p_query_name__icontains = name__icontains; + let p_query_name__iexact = name__iexact; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_providers__isnull = providers__isnull; + let p_query_providers_by_pk = providers_by_pk; + let p_query_search = search; + let p_query_service_connection__name__icontains = service_connection__name__icontains; + let p_query_service_connection__name__iexact = service_connection__name__iexact; + + let uri_str = format!("{}/outposts/instances/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_managed__icontains { + req_builder = req_builder.query(&[("managed__icontains", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_managed__iexact { + req_builder = req_builder.query(&[("managed__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name__icontains { + req_builder = req_builder.query(&[("name__icontains", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name__iexact { + req_builder = req_builder.query(&[("name__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_providers__isnull { + req_builder = req_builder.query(&[("providers__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_providers_by_pk { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("providers_by_pk".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "providers_by_pk", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_service_connection__name__icontains { + req_builder = req_builder.query(&[( + "service_connection__name__icontains", + ¶m_value.to_string(), + )]); + } + if let Some(ref param_value) = p_query_service_connection__name__iexact { + req_builder = + req_builder.query(&[("service_connection__name__iexact", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedOutpostList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedOutpostList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Outpost Viewset +pub async fn outposts_instances_partial_update( + configuration: &configuration::Configuration, + uuid: &str, + patched_outpost_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_patched_outpost_request = patched_outpost_request; + + let uri_str = format!( + "{}/outposts/instances/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_outpost_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Outpost`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Outpost`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Outpost Viewset +pub async fn outposts_instances_retrieve( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/outposts/instances/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Outpost`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Outpost`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Outpost Viewset +pub async fn outposts_instances_update( + configuration: &configuration::Configuration, + uuid: &str, + outpost_request: models::OutpostRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_outpost_request = outpost_request; + + let uri_str = format!( + "{}/outposts/instances/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_outpost_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Outpost`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Outpost`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn outposts_instances_used_by_list( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/outposts/instances/{uuid}/used_by/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Check access to a single application by slug +pub async fn outposts_ldap_access_check( + configuration: &configuration::Configuration, + id: i32, + app_slug: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_query_app_slug = app_slug; + + let uri_str = format!( + "{}/outposts/ldap/{id}/check_access/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_app_slug { + req_builder = req_builder.query(&[("app_slug", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LdapCheckAccess`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LdapCheckAccess`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAPProvider Viewset +pub async fn outposts_ldap_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/outposts/ldap/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedLdapOutpostConfigList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedLdapOutpostConfigList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ProxyProvider Viewset +pub async fn outposts_proxy_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/outposts/proxy/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedProxyOutpostConfigList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedProxyOutpostConfigList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Check access to a single application by slug +pub async fn outposts_radius_access_check( + configuration: &configuration::Configuration, + id: i32, + app_slug: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_query_app_slug = app_slug; + + let uri_str = format!( + "{}/outposts/radius/{id}/check_access/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_app_slug { + req_builder = req_builder.query(&[("app_slug", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RadiusCheckAccess`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RadiusCheckAccess`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RadiusProvider Viewset +pub async fn outposts_radius_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/outposts/radius/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedRadiusOutpostConfigList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedRadiusOutpostConfigList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ServiceConnection Viewset +pub async fn outposts_service_connections_all_destroy( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/outposts/service_connections/all/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ServiceConnection Viewset +pub async fn outposts_service_connections_all_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!( + "{}/outposts/service_connections/all/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedServiceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedServiceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ServiceConnection Viewset +pub async fn outposts_service_connections_all_retrieve( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/outposts/service_connections/all/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ServiceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ServiceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get the service connection's state +pub async fn outposts_service_connections_all_state_retrieve( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/outposts/service_connections/all/{uuid}/state/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ServiceConnectionState`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ServiceConnectionState`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all creatable types +pub async fn outposts_service_connections_all_types_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!( + "{}/outposts/service_connections/all/types/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn outposts_service_connections_all_used_by_list( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/outposts/service_connections/all/{uuid}/used_by/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DockerServiceConnection Viewset +pub async fn outposts_service_connections_docker_create( + configuration: &configuration::Configuration, + docker_service_connection_request: models::DockerServiceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_docker_service_connection_request = docker_service_connection_request; + + let uri_str = format!( + "{}/outposts/service_connections/docker/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_docker_service_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DockerServiceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DockerServiceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DockerServiceConnection Viewset +pub async fn outposts_service_connections_docker_destroy( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/outposts/service_connections/docker/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DockerServiceConnection Viewset +pub async fn outposts_service_connections_docker_list( + configuration: &configuration::Configuration, + local: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + tls_authentication: Option<&str>, + tls_verification: Option<&str>, + url: Option<&str>, +) -> Result< + models::PaginatedDockerServiceConnectionList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_local = local; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_tls_authentication = tls_authentication; + let p_query_tls_verification = tls_verification; + let p_query_url = url; + + let uri_str = format!( + "{}/outposts/service_connections/docker/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_local { + req_builder = req_builder.query(&[("local", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_tls_authentication { + req_builder = req_builder.query(&[("tls_authentication", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_tls_verification { + req_builder = req_builder.query(&[("tls_verification", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_url { + req_builder = req_builder.query(&[("url", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedDockerServiceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedDockerServiceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DockerServiceConnection Viewset +pub async fn outposts_service_connections_docker_partial_update( + configuration: &configuration::Configuration, + uuid: &str, + patched_docker_service_connection_request: Option< + models::PatchedDockerServiceConnectionRequest, + >, +) -> Result< + models::DockerServiceConnection, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_patched_docker_service_connection_request = + patched_docker_service_connection_request; + + let uri_str = format!( + "{}/outposts/service_connections/docker/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_docker_service_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DockerServiceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DockerServiceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DockerServiceConnection Viewset +pub async fn outposts_service_connections_docker_retrieve( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/outposts/service_connections/docker/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DockerServiceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DockerServiceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DockerServiceConnection Viewset +pub async fn outposts_service_connections_docker_update( + configuration: &configuration::Configuration, + uuid: &str, + docker_service_connection_request: models::DockerServiceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_docker_service_connection_request = docker_service_connection_request; + + let uri_str = format!( + "{}/outposts/service_connections/docker/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_docker_service_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DockerServiceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DockerServiceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn outposts_service_connections_docker_used_by_list( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/outposts/service_connections/docker/{uuid}/used_by/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// KubernetesServiceConnection Viewset +pub async fn outposts_service_connections_kubernetes_create( + configuration: &configuration::Configuration, + kubernetes_service_connection_request: models::KubernetesServiceConnectionRequest, +) -> Result< + models::KubernetesServiceConnection, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_kubernetes_service_connection_request = kubernetes_service_connection_request; + + let uri_str = format!( + "{}/outposts/service_connections/kubernetes/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_kubernetes_service_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::KubernetesServiceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::KubernetesServiceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// KubernetesServiceConnection Viewset +pub async fn outposts_service_connections_kubernetes_destroy( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/outposts/service_connections/kubernetes/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// KubernetesServiceConnection Viewset +pub async fn outposts_service_connections_kubernetes_list( + configuration: &configuration::Configuration, + local: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result< + models::PaginatedKubernetesServiceConnectionList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_local = local; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!( + "{}/outposts/service_connections/kubernetes/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_local { + req_builder = req_builder.query(&[("local", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedKubernetesServiceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedKubernetesServiceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// KubernetesServiceConnection Viewset +pub async fn outposts_service_connections_kubernetes_partial_update( + configuration: &configuration::Configuration, + uuid: &str, + patched_kubernetes_service_connection_request: Option< + models::PatchedKubernetesServiceConnectionRequest, + >, +) -> Result< + models::KubernetesServiceConnection, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_patched_kubernetes_service_connection_request = + patched_kubernetes_service_connection_request; + + let uri_str = format!( + "{}/outposts/service_connections/kubernetes/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_kubernetes_service_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::KubernetesServiceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::KubernetesServiceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// KubernetesServiceConnection Viewset +pub async fn outposts_service_connections_kubernetes_retrieve( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result< + models::KubernetesServiceConnection, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/outposts/service_connections/kubernetes/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::KubernetesServiceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::KubernetesServiceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// KubernetesServiceConnection Viewset +pub async fn outposts_service_connections_kubernetes_update( + configuration: &configuration::Configuration, + uuid: &str, + kubernetes_service_connection_request: models::KubernetesServiceConnectionRequest, +) -> Result< + models::KubernetesServiceConnection, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_kubernetes_service_connection_request = kubernetes_service_connection_request; + + let uri_str = format!( + "{}/outposts/service_connections/kubernetes/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_kubernetes_service_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::KubernetesServiceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::KubernetesServiceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn outposts_service_connections_kubernetes_used_by_list( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/outposts/service_connections/kubernetes/{uuid}/used_by/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/policies_api.rs b/packages/client-rust/src/apis/policies_api.rs new file mode 100644 index 0000000000..93cc4026e4 --- /dev/null +++ b/packages/client-rust/src/apis/policies_api.rs @@ -0,0 +1,5729 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`policies_all_cache_clear_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesAllCacheClearCreateError { + Status400(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_all_cache_info_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesAllCacheInfoRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_all_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesAllDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_all_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesAllListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_all_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesAllRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_all_test_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesAllTestCreateError { + Status400(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_all_types_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesAllTypesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_all_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesAllUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_bindings_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesBindingsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_bindings_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesBindingsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_bindings_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesBindingsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_bindings_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesBindingsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_bindings_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesBindingsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_bindings_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesBindingsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_bindings_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesBindingsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_dummy_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesDummyCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_dummy_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesDummyDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_dummy_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesDummyListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_dummy_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesDummyPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_dummy_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesDummyRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_dummy_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesDummyUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_dummy_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesDummyUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_event_matcher_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesEventMatcherCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_event_matcher_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesEventMatcherDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_event_matcher_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesEventMatcherListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_event_matcher_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesEventMatcherPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_event_matcher_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesEventMatcherRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_event_matcher_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesEventMatcherUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_event_matcher_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesEventMatcherUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_expression_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesExpressionCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_expression_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesExpressionDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_expression_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesExpressionListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_expression_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesExpressionPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_expression_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesExpressionRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_expression_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesExpressionUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_expression_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesExpressionUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_geoip_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesGeoipCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_geoip_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesGeoipDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_geoip_iso3166_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesGeoipIso3166ListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_geoip_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesGeoipListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_geoip_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesGeoipPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_geoip_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesGeoipRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_geoip_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesGeoipUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_geoip_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesGeoipUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_password_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesPasswordCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_password_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesPasswordDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_password_expiry_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesPasswordExpiryCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_password_expiry_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesPasswordExpiryDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_password_expiry_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesPasswordExpiryListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_password_expiry_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesPasswordExpiryPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_password_expiry_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesPasswordExpiryRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_password_expiry_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesPasswordExpiryUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_password_expiry_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesPasswordExpiryUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_password_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesPasswordListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_password_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesPasswordPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_password_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesPasswordRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_password_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesPasswordUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_password_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesPasswordUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_reputation_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesReputationCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_reputation_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesReputationDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_reputation_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesReputationListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_reputation_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesReputationPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_reputation_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesReputationRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_reputation_scores_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesReputationScoresDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_reputation_scores_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesReputationScoresListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_reputation_scores_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesReputationScoresRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_reputation_scores_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesReputationScoresUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_reputation_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesReputationUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_reputation_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesReputationUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_unique_password_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesUniquePasswordCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_unique_password_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesUniquePasswordDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_unique_password_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesUniquePasswordListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_unique_password_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesUniquePasswordPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_unique_password_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesUniquePasswordRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_unique_password_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesUniquePasswordUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`policies_unique_password_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PoliciesUniquePasswordUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// Clear policy cache +pub async fn policies_all_cache_clear_create( + configuration: &configuration::Configuration, +) -> Result<(), Error> { + let uri_str = format!("{}/policies/all/cache_clear/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Info about cached policies +pub async fn policies_all_cache_info_retrieve( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!("{}/policies/all/cache_info/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Cache`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Cache`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Policy Viewset +pub async fn policies_all_destroy( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/all/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Policy Viewset +pub async fn policies_all_list( + configuration: &configuration::Configuration, + bindings__isnull: Option, + ordering: Option<&str>, + page: Option, + page_size: Option, + promptstage__isnull: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_bindings__isnull = bindings__isnull; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_promptstage__isnull = promptstage__isnull; + let p_query_search = search; + + let uri_str = format!("{}/policies/all/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_bindings__isnull { + req_builder = req_builder.query(&[("bindings__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_promptstage__isnull { + req_builder = req_builder.query(&[("promptstage__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedPolicyList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedPolicyList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Policy Viewset +pub async fn policies_all_retrieve( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/all/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Policy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Policy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Test policy +pub async fn policies_all_test_create( + configuration: &configuration::Configuration, + policy_uuid: &str, + policy_test_request: models::PolicyTestRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_policy_test_request = policy_test_request; + + let uri_str = format!( + "{}/policies/all/{policy_uuid}/test/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_policy_test_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PolicyTestResult`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PolicyTestResult`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all creatable types +pub async fn policies_all_types_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/policies/all/types/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn policies_all_used_by_list( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/all/{policy_uuid}/used_by/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PolicyBinding Viewset +pub async fn policies_bindings_create( + configuration: &configuration::Configuration, + policy_binding_request: models::PolicyBindingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_policy_binding_request = policy_binding_request; + + let uri_str = format!("{}/policies/bindings/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_policy_binding_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PolicyBinding`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PolicyBinding`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PolicyBinding Viewset +pub async fn policies_bindings_destroy( + configuration: &configuration::Configuration, + policy_binding_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_binding_uuid = policy_binding_uuid; + + let uri_str = format!( + "{}/policies/bindings/{policy_binding_uuid}/", + configuration.base_path, + policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PolicyBinding Viewset +pub async fn policies_bindings_list( + configuration: &configuration::Configuration, + enabled: Option, + order: Option, + ordering: Option<&str>, + page: Option, + page_size: Option, + policy: Option<&str>, + policy__isnull: Option, + search: Option<&str>, + target: Option<&str>, + target_in: Option>, + timeout: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_enabled = enabled; + let p_query_order = order; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_policy = policy; + let p_query_policy__isnull = policy__isnull; + let p_query_search = search; + let p_query_target = target; + let p_query_target_in = target_in; + let p_query_timeout = timeout; + + let uri_str = format!("{}/policies/bindings/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_enabled { + req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_order { + req_builder = req_builder.query(&[("order", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policy { + req_builder = req_builder.query(&[("policy", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policy__isnull { + req_builder = req_builder.query(&[("policy__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_target { + req_builder = req_builder.query(&[("target", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_target_in { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("target_in".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "target_in", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_timeout { + req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedPolicyBindingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedPolicyBindingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PolicyBinding Viewset +pub async fn policies_bindings_partial_update( + configuration: &configuration::Configuration, + policy_binding_uuid: &str, + patched_policy_binding_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_binding_uuid = policy_binding_uuid; + let p_body_patched_policy_binding_request = patched_policy_binding_request; + + let uri_str = format!( + "{}/policies/bindings/{policy_binding_uuid}/", + configuration.base_path, + policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_policy_binding_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PolicyBinding`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PolicyBinding`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PolicyBinding Viewset +pub async fn policies_bindings_retrieve( + configuration: &configuration::Configuration, + policy_binding_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_binding_uuid = policy_binding_uuid; + + let uri_str = format!( + "{}/policies/bindings/{policy_binding_uuid}/", + configuration.base_path, + policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PolicyBinding`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PolicyBinding`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PolicyBinding Viewset +pub async fn policies_bindings_update( + configuration: &configuration::Configuration, + policy_binding_uuid: &str, + policy_binding_request: models::PolicyBindingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_binding_uuid = policy_binding_uuid; + let p_body_policy_binding_request = policy_binding_request; + + let uri_str = format!( + "{}/policies/bindings/{policy_binding_uuid}/", + configuration.base_path, + policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_policy_binding_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PolicyBinding`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PolicyBinding`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn policies_bindings_used_by_list( + configuration: &configuration::Configuration, + policy_binding_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_binding_uuid = policy_binding_uuid; + + let uri_str = format!( + "{}/policies/bindings/{policy_binding_uuid}/used_by/", + configuration.base_path, + policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Dummy Viewset +pub async fn policies_dummy_create( + configuration: &configuration::Configuration, + dummy_policy_request: models::DummyPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_dummy_policy_request = dummy_policy_request; + + let uri_str = format!("{}/policies/dummy/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_dummy_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DummyPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DummyPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Dummy Viewset +pub async fn policies_dummy_destroy( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/dummy/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Dummy Viewset +pub async fn policies_dummy_list( + configuration: &configuration::Configuration, + created: Option, + execution_logging: Option, + last_updated: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + policy_uuid: Option<&str>, + result: Option, + search: Option<&str>, + wait_max: Option, + wait_min: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_created = created; + let p_query_execution_logging = execution_logging; + let p_query_last_updated = last_updated; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_policy_uuid = policy_uuid; + let p_query_result = result; + let p_query_search = search; + let p_query_wait_max = wait_max; + let p_query_wait_min = wait_min; + + let uri_str = format!("{}/policies/dummy/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_created { + req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_execution_logging { + req_builder = req_builder.query(&[("execution_logging", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_updated { + req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policy_uuid { + req_builder = req_builder.query(&[("policy_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_result { + req_builder = req_builder.query(&[("result", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_wait_max { + req_builder = req_builder.query(&[("wait_max", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_wait_min { + req_builder = req_builder.query(&[("wait_min", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedDummyPolicyList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedDummyPolicyList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Dummy Viewset +pub async fn policies_dummy_partial_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + patched_dummy_policy_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_patched_dummy_policy_request = patched_dummy_policy_request; + + let uri_str = format!( + "{}/policies/dummy/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_dummy_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DummyPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DummyPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Dummy Viewset +pub async fn policies_dummy_retrieve( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/dummy/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DummyPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DummyPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Dummy Viewset +pub async fn policies_dummy_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + dummy_policy_request: models::DummyPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_dummy_policy_request = dummy_policy_request; + + let uri_str = format!( + "{}/policies/dummy/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_dummy_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DummyPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DummyPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn policies_dummy_used_by_list( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/dummy/{policy_uuid}/used_by/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Event Matcher Policy Viewset +pub async fn policies_event_matcher_create( + configuration: &configuration::Configuration, + event_matcher_policy_request: models::EventMatcherPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_event_matcher_policy_request = event_matcher_policy_request; + + let uri_str = format!("{}/policies/event_matcher/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_event_matcher_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EventMatcherPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EventMatcherPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Event Matcher Policy Viewset +pub async fn policies_event_matcher_destroy( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/event_matcher/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Event Matcher Policy Viewset +pub async fn policies_event_matcher_list( + configuration: &configuration::Configuration, + action: Option<&str>, + app: Option<&str>, + client_ip: Option<&str>, + created: Option, + execution_logging: Option, + last_updated: Option, + model: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + policy_uuid: Option<&str>, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_action = action; + let p_query_app = app; + let p_query_client_ip = client_ip; + let p_query_created = created; + let p_query_execution_logging = execution_logging; + let p_query_last_updated = last_updated; + let p_query_model = model; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_policy_uuid = policy_uuid; + let p_query_search = search; + + let uri_str = format!("{}/policies/event_matcher/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_action { + req_builder = req_builder.query(&[("action", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_app { + req_builder = req_builder.query(&[("app", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_client_ip { + req_builder = req_builder.query(&[("client_ip", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_created { + req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_execution_logging { + req_builder = req_builder.query(&[("execution_logging", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_updated { + req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_model { + req_builder = req_builder.query(&[("model", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policy_uuid { + req_builder = req_builder.query(&[("policy_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedEventMatcherPolicyList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedEventMatcherPolicyList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Event Matcher Policy Viewset +pub async fn policies_event_matcher_partial_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + patched_event_matcher_policy_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_patched_event_matcher_policy_request = patched_event_matcher_policy_request; + + let uri_str = format!( + "{}/policies/event_matcher/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_event_matcher_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EventMatcherPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EventMatcherPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Event Matcher Policy Viewset +pub async fn policies_event_matcher_retrieve( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/event_matcher/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EventMatcherPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EventMatcherPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Event Matcher Policy Viewset +pub async fn policies_event_matcher_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + event_matcher_policy_request: models::EventMatcherPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_event_matcher_policy_request = event_matcher_policy_request; + + let uri_str = format!( + "{}/policies/event_matcher/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_event_matcher_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EventMatcherPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EventMatcherPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn policies_event_matcher_used_by_list( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/event_matcher/{policy_uuid}/used_by/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Source Viewset +pub async fn policies_expression_create( + configuration: &configuration::Configuration, + expression_policy_request: models::ExpressionPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_expression_policy_request = expression_policy_request; + + let uri_str = format!("{}/policies/expression/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_expression_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ExpressionPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ExpressionPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Source Viewset +pub async fn policies_expression_destroy( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/expression/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Source Viewset +pub async fn policies_expression_list( + configuration: &configuration::Configuration, + created: Option, + execution_logging: Option, + expression: Option<&str>, + last_updated: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + policy_uuid: Option<&str>, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_created = created; + let p_query_execution_logging = execution_logging; + let p_query_expression = expression; + let p_query_last_updated = last_updated; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_policy_uuid = policy_uuid; + let p_query_search = search; + + let uri_str = format!("{}/policies/expression/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_created { + req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_execution_logging { + req_builder = req_builder.query(&[("execution_logging", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_expression { + req_builder = req_builder.query(&[("expression", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_updated { + req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policy_uuid { + req_builder = req_builder.query(&[("policy_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedExpressionPolicyList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedExpressionPolicyList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Source Viewset +pub async fn policies_expression_partial_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + patched_expression_policy_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_patched_expression_policy_request = patched_expression_policy_request; + + let uri_str = format!( + "{}/policies/expression/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_expression_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ExpressionPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ExpressionPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Source Viewset +pub async fn policies_expression_retrieve( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/expression/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ExpressionPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ExpressionPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Source Viewset +pub async fn policies_expression_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + expression_policy_request: models::ExpressionPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_expression_policy_request = expression_policy_request; + + let uri_str = format!( + "{}/policies/expression/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_expression_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ExpressionPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ExpressionPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn policies_expression_used_by_list( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/expression/{policy_uuid}/used_by/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GeoIP Viewset +pub async fn policies_geoip_create( + configuration: &configuration::Configuration, + geo_ip_policy_request: models::GeoIpPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_geo_ip_policy_request = geo_ip_policy_request; + + let uri_str = format!("{}/policies/geoip/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_geo_ip_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GeoIpPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GeoIpPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GeoIP Viewset +pub async fn policies_geoip_destroy( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/geoip/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all countries in ISO-3166-1 +pub async fn policies_geoip_iso3166_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/policies/geoip_iso3166/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::DetailedCountry>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::DetailedCountry>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GeoIP Viewset +pub async fn policies_geoip_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/policies/geoip/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGeoIpPolicyList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGeoIpPolicyList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GeoIP Viewset +pub async fn policies_geoip_partial_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + patched_geo_ip_policy_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_patched_geo_ip_policy_request = patched_geo_ip_policy_request; + + let uri_str = format!( + "{}/policies/geoip/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_geo_ip_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GeoIpPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GeoIpPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GeoIP Viewset +pub async fn policies_geoip_retrieve( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/geoip/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GeoIpPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GeoIpPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GeoIP Viewset +pub async fn policies_geoip_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + geo_ip_policy_request: models::GeoIpPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_geo_ip_policy_request = geo_ip_policy_request; + + let uri_str = format!( + "{}/policies/geoip/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_geo_ip_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GeoIpPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GeoIpPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn policies_geoip_used_by_list( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/geoip/{policy_uuid}/used_by/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Policy Viewset +pub async fn policies_password_create( + configuration: &configuration::Configuration, + password_policy_request: models::PasswordPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_password_policy_request = password_policy_request; + + let uri_str = format!("{}/policies/password/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_password_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PasswordPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PasswordPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Policy Viewset +pub async fn policies_password_destroy( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/password/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Expiry Viewset +pub async fn policies_password_expiry_create( + configuration: &configuration::Configuration, + password_expiry_policy_request: models::PasswordExpiryPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_password_expiry_policy_request = password_expiry_policy_request; + + let uri_str = format!("{}/policies/password_expiry/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_password_expiry_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PasswordExpiryPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PasswordExpiryPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Expiry Viewset +pub async fn policies_password_expiry_destroy( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/password_expiry/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Expiry Viewset +pub async fn policies_password_expiry_list( + configuration: &configuration::Configuration, + created: Option, + days: Option, + deny_only: Option, + execution_logging: Option, + last_updated: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + policy_uuid: Option<&str>, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_created = created; + let p_query_days = days; + let p_query_deny_only = deny_only; + let p_query_execution_logging = execution_logging; + let p_query_last_updated = last_updated; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_policy_uuid = policy_uuid; + let p_query_search = search; + + let uri_str = format!("{}/policies/password_expiry/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_created { + req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_days { + req_builder = req_builder.query(&[("days", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_deny_only { + req_builder = req_builder.query(&[("deny_only", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_execution_logging { + req_builder = req_builder.query(&[("execution_logging", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_updated { + req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policy_uuid { + req_builder = req_builder.query(&[("policy_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedPasswordExpiryPolicyList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedPasswordExpiryPolicyList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Expiry Viewset +pub async fn policies_password_expiry_partial_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + patched_password_expiry_policy_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_patched_password_expiry_policy_request = patched_password_expiry_policy_request; + + let uri_str = format!( + "{}/policies/password_expiry/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_password_expiry_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PasswordExpiryPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PasswordExpiryPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Expiry Viewset +pub async fn policies_password_expiry_retrieve( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/password_expiry/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PasswordExpiryPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PasswordExpiryPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Expiry Viewset +pub async fn policies_password_expiry_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + password_expiry_policy_request: models::PasswordExpiryPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_password_expiry_policy_request = password_expiry_policy_request; + + let uri_str = format!( + "{}/policies/password_expiry/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_password_expiry_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PasswordExpiryPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PasswordExpiryPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn policies_password_expiry_used_by_list( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/password_expiry/{policy_uuid}/used_by/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Policy Viewset +pub async fn policies_password_list( + configuration: &configuration::Configuration, + amount_digits: Option, + amount_lowercase: Option, + amount_symbols: Option, + amount_uppercase: Option, + check_have_i_been_pwned: Option, + check_static_rules: Option, + check_zxcvbn: Option, + created: Option, + error_message: Option<&str>, + execution_logging: Option, + hibp_allowed_count: Option, + last_updated: Option, + length_min: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + password_field: Option<&str>, + policy_uuid: Option<&str>, + search: Option<&str>, + symbol_charset: Option<&str>, + zxcvbn_score_threshold: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_amount_digits = amount_digits; + let p_query_amount_lowercase = amount_lowercase; + let p_query_amount_symbols = amount_symbols; + let p_query_amount_uppercase = amount_uppercase; + let p_query_check_have_i_been_pwned = check_have_i_been_pwned; + let p_query_check_static_rules = check_static_rules; + let p_query_check_zxcvbn = check_zxcvbn; + let p_query_created = created; + let p_query_error_message = error_message; + let p_query_execution_logging = execution_logging; + let p_query_hibp_allowed_count = hibp_allowed_count; + let p_query_last_updated = last_updated; + let p_query_length_min = length_min; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_password_field = password_field; + let p_query_policy_uuid = policy_uuid; + let p_query_search = search; + let p_query_symbol_charset = symbol_charset; + let p_query_zxcvbn_score_threshold = zxcvbn_score_threshold; + + let uri_str = format!("{}/policies/password/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_amount_digits { + req_builder = req_builder.query(&[("amount_digits", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_amount_lowercase { + req_builder = req_builder.query(&[("amount_lowercase", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_amount_symbols { + req_builder = req_builder.query(&[("amount_symbols", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_amount_uppercase { + req_builder = req_builder.query(&[("amount_uppercase", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_check_have_i_been_pwned { + req_builder = req_builder.query(&[("check_have_i_been_pwned", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_check_static_rules { + req_builder = req_builder.query(&[("check_static_rules", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_check_zxcvbn { + req_builder = req_builder.query(&[("check_zxcvbn", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_created { + req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_error_message { + req_builder = req_builder.query(&[("error_message", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_execution_logging { + req_builder = req_builder.query(&[("execution_logging", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_hibp_allowed_count { + req_builder = req_builder.query(&[("hibp_allowed_count", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_updated { + req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_length_min { + req_builder = req_builder.query(&[("length_min", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_password_field { + req_builder = req_builder.query(&[("password_field", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policy_uuid { + req_builder = req_builder.query(&[("policy_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_symbol_charset { + req_builder = req_builder.query(&[("symbol_charset", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_zxcvbn_score_threshold { + req_builder = req_builder.query(&[("zxcvbn_score_threshold", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedPasswordPolicyList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedPasswordPolicyList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Policy Viewset +pub async fn policies_password_partial_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + patched_password_policy_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_patched_password_policy_request = patched_password_policy_request; + + let uri_str = format!( + "{}/policies/password/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_password_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PasswordPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PasswordPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Policy Viewset +pub async fn policies_password_retrieve( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/password/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PasswordPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PasswordPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Policy Viewset +pub async fn policies_password_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + password_policy_request: models::PasswordPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_password_policy_request = password_policy_request; + + let uri_str = format!( + "{}/policies/password/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_password_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PasswordPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PasswordPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn policies_password_used_by_list( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/password/{policy_uuid}/used_by/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Reputation Policy Viewset +pub async fn policies_reputation_create( + configuration: &configuration::Configuration, + reputation_policy_request: models::ReputationPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_reputation_policy_request = reputation_policy_request; + + let uri_str = format!("{}/policies/reputation/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_reputation_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ReputationPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ReputationPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Reputation Policy Viewset +pub async fn policies_reputation_destroy( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/reputation/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Reputation Policy Viewset +pub async fn policies_reputation_list( + configuration: &configuration::Configuration, + check_ip: Option, + check_username: Option, + created: Option, + execution_logging: Option, + last_updated: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + policy_uuid: Option<&str>, + search: Option<&str>, + threshold: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_check_ip = check_ip; + let p_query_check_username = check_username; + let p_query_created = created; + let p_query_execution_logging = execution_logging; + let p_query_last_updated = last_updated; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_policy_uuid = policy_uuid; + let p_query_search = search; + let p_query_threshold = threshold; + + let uri_str = format!("{}/policies/reputation/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_check_ip { + req_builder = req_builder.query(&[("check_ip", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_check_username { + req_builder = req_builder.query(&[("check_username", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_created { + req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_execution_logging { + req_builder = req_builder.query(&[("execution_logging", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_updated { + req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policy_uuid { + req_builder = req_builder.query(&[("policy_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_threshold { + req_builder = req_builder.query(&[("threshold", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedReputationPolicyList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedReputationPolicyList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Reputation Policy Viewset +pub async fn policies_reputation_partial_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + patched_reputation_policy_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_patched_reputation_policy_request = patched_reputation_policy_request; + + let uri_str = format!( + "{}/policies/reputation/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_reputation_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ReputationPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ReputationPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Reputation Policy Viewset +pub async fn policies_reputation_retrieve( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/reputation/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ReputationPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ReputationPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Reputation Viewset +pub async fn policies_reputation_scores_destroy( + configuration: &configuration::Configuration, + reputation_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_reputation_uuid = reputation_uuid; + + let uri_str = format!( + "{}/policies/reputation/scores/{reputation_uuid}/", + configuration.base_path, + reputation_uuid = crate::apis::urlencode(p_path_reputation_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Reputation Viewset +pub async fn policies_reputation_scores_list( + configuration: &configuration::Configuration, + identifier: Option<&str>, + identifier_in: Option>, + ip: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + score: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_identifier = identifier; + let p_query_identifier_in = identifier_in; + let p_query_ip = ip; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_score = score; + let p_query_search = search; + + let uri_str = format!("{}/policies/reputation/scores/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_identifier { + req_builder = req_builder.query(&[("identifier", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_identifier_in { + req_builder = match "csv" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("identifier_in".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "identifier_in", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_ip { + req_builder = req_builder.query(&[("ip", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_score { + req_builder = req_builder.query(&[("score", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedReputationList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedReputationList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Reputation Viewset +pub async fn policies_reputation_scores_retrieve( + configuration: &configuration::Configuration, + reputation_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_reputation_uuid = reputation_uuid; + + let uri_str = format!( + "{}/policies/reputation/scores/{reputation_uuid}/", + configuration.base_path, + reputation_uuid = crate::apis::urlencode(p_path_reputation_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Reputation`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Reputation`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn policies_reputation_scores_used_by_list( + configuration: &configuration::Configuration, + reputation_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_reputation_uuid = reputation_uuid; + + let uri_str = format!( + "{}/policies/reputation/scores/{reputation_uuid}/used_by/", + configuration.base_path, + reputation_uuid = crate::apis::urlencode(p_path_reputation_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Reputation Policy Viewset +pub async fn policies_reputation_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + reputation_policy_request: models::ReputationPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_reputation_policy_request = reputation_policy_request; + + let uri_str = format!( + "{}/policies/reputation/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_reputation_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ReputationPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ReputationPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn policies_reputation_used_by_list( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/reputation/{policy_uuid}/used_by/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Uniqueness Policy Viewset +pub async fn policies_unique_password_create( + configuration: &configuration::Configuration, + unique_password_policy_request: models::UniquePasswordPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_unique_password_policy_request = unique_password_policy_request; + + let uri_str = format!("{}/policies/unique_password/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_unique_password_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UniquePasswordPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UniquePasswordPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Uniqueness Policy Viewset +pub async fn policies_unique_password_destroy( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/unique_password/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Uniqueness Policy Viewset +pub async fn policies_unique_password_list( + configuration: &configuration::Configuration, + created: Option, + execution_logging: Option, + last_updated: Option, + name: Option<&str>, + num_historical_passwords: Option, + ordering: Option<&str>, + page: Option, + page_size: Option, + password_field: Option<&str>, + policy_uuid: Option<&str>, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_created = created; + let p_query_execution_logging = execution_logging; + let p_query_last_updated = last_updated; + let p_query_name = name; + let p_query_num_historical_passwords = num_historical_passwords; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_password_field = password_field; + let p_query_policy_uuid = policy_uuid; + let p_query_search = search; + + let uri_str = format!("{}/policies/unique_password/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_created { + req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_execution_logging { + req_builder = req_builder.query(&[("execution_logging", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_last_updated { + req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_num_historical_passwords { + req_builder = req_builder.query(&[("num_historical_passwords", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_password_field { + req_builder = req_builder.query(&[("password_field", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policy_uuid { + req_builder = req_builder.query(&[("policy_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedUniquePasswordPolicyList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedUniquePasswordPolicyList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Uniqueness Policy Viewset +pub async fn policies_unique_password_partial_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + patched_unique_password_policy_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_patched_unique_password_policy_request = patched_unique_password_policy_request; + + let uri_str = format!( + "{}/policies/unique_password/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_unique_password_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UniquePasswordPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UniquePasswordPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Uniqueness Policy Viewset +pub async fn policies_unique_password_retrieve( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/unique_password/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UniquePasswordPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UniquePasswordPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Password Uniqueness Policy Viewset +pub async fn policies_unique_password_update( + configuration: &configuration::Configuration, + policy_uuid: &str, + unique_password_policy_request: models::UniquePasswordPolicyRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + let p_body_unique_password_policy_request = unique_password_policy_request; + + let uri_str = format!( + "{}/policies/unique_password/{policy_uuid}/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_unique_password_policy_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UniquePasswordPolicy`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UniquePasswordPolicy`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn policies_unique_password_used_by_list( + configuration: &configuration::Configuration, + policy_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_policy_uuid = policy_uuid; + + let uri_str = format!( + "{}/policies/unique_password/{policy_uuid}/used_by/", + configuration.base_path, + policy_uuid = crate::apis::urlencode(p_path_policy_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/propertymappings_api.rs b/packages/client-rust/src/apis/propertymappings_api.rs new file mode 100644 index 0000000000..45ccae3f18 --- /dev/null +++ b/packages/client-rust/src/apis/propertymappings_api.rs @@ -0,0 +1,8572 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`propertymappings_all_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsAllDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_all_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsAllListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_all_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsAllRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_all_test_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsAllTestCreateError { + Status400(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_all_types_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsAllTypesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_all_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsAllUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_notification_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsNotificationCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_notification_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsNotificationDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_notification_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsNotificationListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_notification_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsNotificationPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_notification_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsNotificationRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_notification_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsNotificationUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_notification_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsNotificationUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_google_workspace_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderGoogleWorkspaceCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_google_workspace_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderGoogleWorkspaceDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_google_workspace_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderGoogleWorkspaceListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_google_workspace_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderGoogleWorkspacePartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_google_workspace_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderGoogleWorkspaceRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_google_workspace_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderGoogleWorkspaceUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_google_workspace_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderGoogleWorkspaceUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderMicrosoftEntraCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderMicrosoftEntraDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderMicrosoftEntraListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderMicrosoftEntraPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderMicrosoftEntraRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderMicrosoftEntraUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderMicrosoftEntraUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_rac_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderRacCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_rac_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderRacDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_rac_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderRacListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_rac_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderRacPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_rac_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderRacRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_rac_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderRacUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_rac_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderRacUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_radius_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderRadiusCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_radius_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderRadiusDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_radius_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderRadiusListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_radius_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderRadiusPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_radius_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderRadiusRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_radius_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderRadiusUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_radius_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderRadiusUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_saml_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderSamlCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_saml_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderSamlDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_saml_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderSamlListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_saml_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderSamlPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_saml_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderSamlRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_saml_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderSamlUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_saml_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderSamlUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_scim_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderScimCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_scim_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderScimDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_scim_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderScimListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_scim_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderScimPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_scim_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderScimRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_scim_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderScimUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_scim_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderScimUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_scope_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderScopeCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_scope_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderScopeDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_scope_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderScopeListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_scope_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderScopePartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_scope_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderScopeRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_scope_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderScopeUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_provider_scope_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsProviderScopeUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_kerberos_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceKerberosCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_kerberos_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceKerberosDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_kerberos_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceKerberosListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_kerberos_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceKerberosPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_kerberos_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceKerberosRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_kerberos_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceKerberosUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_kerberos_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceKerberosUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_ldap_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceLdapCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_ldap_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceLdapDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_ldap_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceLdapListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_ldap_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceLdapPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_ldap_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceLdapRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_ldap_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceLdapUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_ldap_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceLdapUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_oauth_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceOauthCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_oauth_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceOauthDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_oauth_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceOauthListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_oauth_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceOauthPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_oauth_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceOauthRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_oauth_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceOauthUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_oauth_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceOauthUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_plex_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourcePlexCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_plex_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourcePlexDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_plex_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourcePlexListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_plex_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourcePlexPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_plex_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourcePlexRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_plex_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourcePlexUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_plex_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourcePlexUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_saml_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceSamlCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_saml_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceSamlDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_saml_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceSamlListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_saml_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceSamlPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_saml_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceSamlRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_saml_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceSamlUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_saml_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceSamlUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_scim_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceScimCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_scim_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceScimDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_scim_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceScimListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_scim_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceScimPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_scim_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceScimRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_scim_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceScimUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_scim_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceScimUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_telegram_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceTelegramCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_telegram_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceTelegramDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_telegram_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceTelegramListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_telegram_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceTelegramPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_telegram_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceTelegramRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_telegram_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceTelegramUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`propertymappings_source_telegram_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PropertymappingsSourceTelegramUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// PropertyMapping Viewset +pub async fn propertymappings_all_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/all/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PropertyMapping Viewset +pub async fn propertymappings_all_list( + configuration: &configuration::Configuration, + managed: Option>, + managed__isnull: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_managed = managed; + let p_query_managed__isnull = managed__isnull; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/propertymappings/all/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_managed__isnull { + req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedPropertyMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedPropertyMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PropertyMapping Viewset +pub async fn propertymappings_all_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/all/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Test Property Mapping +pub async fn propertymappings_all_test_create( + configuration: &configuration::Configuration, + pm_uuid: &str, + format_result: Option, + property_mapping_test_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_query_format_result = format_result; + let p_body_property_mapping_test_request = property_mapping_test_request; + + let uri_str = format!( + "{}/propertymappings/all/{pm_uuid}/test/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref param_value) = p_query_format_result { + req_builder = req_builder.query(&[("format_result", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_property_mapping_test_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PropertyMappingTestResult`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PropertyMappingTestResult`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all creatable types +pub async fn propertymappings_all_types_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/propertymappings/all/types/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_all_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/all/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationWebhookMapping Viewset +pub async fn propertymappings_notification_create( + configuration: &configuration::Configuration, + notification_webhook_mapping_request: models::NotificationWebhookMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_notification_webhook_mapping_request = notification_webhook_mapping_request; + + let uri_str = format!("{}/propertymappings/notification/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_notification_webhook_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::NotificationWebhookMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::NotificationWebhookMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationWebhookMapping Viewset +pub async fn propertymappings_notification_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/notification/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationWebhookMapping Viewset +pub async fn propertymappings_notification_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result< + models::PaginatedNotificationWebhookMappingList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/propertymappings/notification/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedNotificationWebhookMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedNotificationWebhookMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationWebhookMapping Viewset +pub async fn propertymappings_notification_partial_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + patched_notification_webhook_mapping_request: Option< + models::PatchedNotificationWebhookMappingRequest, + >, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_patched_notification_webhook_mapping_request = + patched_notification_webhook_mapping_request; + + let uri_str = format!( + "{}/propertymappings/notification/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_notification_webhook_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::NotificationWebhookMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::NotificationWebhookMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationWebhookMapping Viewset +pub async fn propertymappings_notification_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/notification/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::NotificationWebhookMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::NotificationWebhookMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// NotificationWebhookMapping Viewset +pub async fn propertymappings_notification_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + notification_webhook_mapping_request: models::NotificationWebhookMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_notification_webhook_mapping_request = notification_webhook_mapping_request; + + let uri_str = format!( + "{}/propertymappings/notification/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_notification_webhook_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::NotificationWebhookMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::NotificationWebhookMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_notification_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/notification/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProviderMapping Viewset +pub async fn propertymappings_provider_google_workspace_create( + configuration: &configuration::Configuration, + google_workspace_provider_mapping_request: models::GoogleWorkspaceProviderMappingRequest, +) -> Result< + models::GoogleWorkspaceProviderMapping, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_google_workspace_provider_mapping_request = + google_workspace_provider_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/google_workspace/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_google_workspace_provider_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProviderMapping Viewset +pub async fn propertymappings_provider_google_workspace_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/google_workspace/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProviderMapping Viewset +pub async fn propertymappings_provider_google_workspace_list( + configuration: &configuration::Configuration, + expression: Option<&str>, + managed: Option>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + pm_uuid: Option<&str>, + search: Option<&str>, +) -> Result< + models::PaginatedGoogleWorkspaceProviderMappingList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_expression = expression; + let p_query_managed = managed; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_pm_uuid = pm_uuid; + let p_query_search = search; + + let uri_str = format!( + "{}/propertymappings/provider/google_workspace/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_expression { + req_builder = req_builder.query(&[("expression", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_pm_uuid { + req_builder = req_builder.query(&[("pm_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGoogleWorkspaceProviderMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGoogleWorkspaceProviderMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProviderMapping Viewset +pub async fn propertymappings_provider_google_workspace_partial_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + patched_google_workspace_provider_mapping_request: Option< + models::PatchedGoogleWorkspaceProviderMappingRequest, + >, +) -> Result< + models::GoogleWorkspaceProviderMapping, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_patched_google_workspace_provider_mapping_request = + patched_google_workspace_provider_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/google_workspace/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_google_workspace_provider_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProviderMapping Viewset +pub async fn propertymappings_provider_google_workspace_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result< + models::GoogleWorkspaceProviderMapping, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/google_workspace/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProviderMapping Viewset +pub async fn propertymappings_provider_google_workspace_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + google_workspace_provider_mapping_request: models::GoogleWorkspaceProviderMappingRequest, +) -> Result< + models::GoogleWorkspaceProviderMapping, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_google_workspace_provider_mapping_request = + google_workspace_provider_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/google_workspace/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_google_workspace_provider_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_provider_google_workspace_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/google_workspace/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProviderMapping Viewset +pub async fn propertymappings_provider_microsoft_entra_create( + configuration: &configuration::Configuration, + microsoft_entra_provider_mapping_request: models::MicrosoftEntraProviderMappingRequest, +) -> Result< + models::MicrosoftEntraProviderMapping, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_microsoft_entra_provider_mapping_request = microsoft_entra_provider_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/microsoft_entra/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_microsoft_entra_provider_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProviderMapping Viewset +pub async fn propertymappings_provider_microsoft_entra_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/microsoft_entra/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProviderMapping Viewset +pub async fn propertymappings_provider_microsoft_entra_list( + configuration: &configuration::Configuration, + expression: Option<&str>, + managed: Option>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + pm_uuid: Option<&str>, + search: Option<&str>, +) -> Result< + models::PaginatedMicrosoftEntraProviderMappingList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_expression = expression; + let p_query_managed = managed; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_pm_uuid = pm_uuid; + let p_query_search = search; + + let uri_str = format!( + "{}/propertymappings/provider/microsoft_entra/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_expression { + req_builder = req_builder.query(&[("expression", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_pm_uuid { + req_builder = req_builder.query(&[("pm_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedMicrosoftEntraProviderMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedMicrosoftEntraProviderMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProviderMapping Viewset +pub async fn propertymappings_provider_microsoft_entra_partial_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + patched_microsoft_entra_provider_mapping_request: Option< + models::PatchedMicrosoftEntraProviderMappingRequest, + >, +) -> Result< + models::MicrosoftEntraProviderMapping, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_patched_microsoft_entra_provider_mapping_request = + patched_microsoft_entra_provider_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/microsoft_entra/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_microsoft_entra_provider_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProviderMapping Viewset +pub async fn propertymappings_provider_microsoft_entra_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result< + models::MicrosoftEntraProviderMapping, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/microsoft_entra/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProviderMapping Viewset +pub async fn propertymappings_provider_microsoft_entra_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + microsoft_entra_provider_mapping_request: models::MicrosoftEntraProviderMappingRequest, +) -> Result< + models::MicrosoftEntraProviderMapping, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_microsoft_entra_provider_mapping_request = microsoft_entra_provider_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/microsoft_entra/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_microsoft_entra_provider_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_provider_microsoft_entra_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/microsoft_entra/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RACPropertyMapping Viewset +pub async fn propertymappings_provider_rac_create( + configuration: &configuration::Configuration, + rac_property_mapping_request: models::RacPropertyMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_rac_property_mapping_request = rac_property_mapping_request; + + let uri_str = format!("{}/propertymappings/provider/rac/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_rac_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RacPropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RacPropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RACPropertyMapping Viewset +pub async fn propertymappings_provider_rac_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/rac/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RACPropertyMapping Viewset +pub async fn propertymappings_provider_rac_list( + configuration: &configuration::Configuration, + managed: Option>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_managed = managed; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/propertymappings/provider/rac/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedRacPropertyMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedRacPropertyMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RACPropertyMapping Viewset +pub async fn propertymappings_provider_rac_partial_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + patched_rac_property_mapping_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_patched_rac_property_mapping_request = patched_rac_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/rac/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_rac_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RacPropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RacPropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RACPropertyMapping Viewset +pub async fn propertymappings_provider_rac_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/rac/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RacPropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RacPropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RACPropertyMapping Viewset +pub async fn propertymappings_provider_rac_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + rac_property_mapping_request: models::RacPropertyMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_rac_property_mapping_request = rac_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/rac/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_rac_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RacPropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RacPropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_provider_rac_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/rac/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RadiusProviderPropertyMapping Viewset +pub async fn propertymappings_provider_radius_create( + configuration: &configuration::Configuration, + radius_provider_property_mapping_request: models::RadiusProviderPropertyMappingRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_body_radius_provider_property_mapping_request = radius_provider_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/radius/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_radius_provider_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RadiusProviderPropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RadiusProviderPropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RadiusProviderPropertyMapping Viewset +pub async fn propertymappings_provider_radius_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/radius/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RadiusProviderPropertyMapping Viewset +pub async fn propertymappings_provider_radius_list( + configuration: &configuration::Configuration, + managed: Option>, + managed__isnull: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result< + models::PaginatedRadiusProviderPropertyMappingList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_managed = managed; + let p_query_managed__isnull = managed__isnull; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!( + "{}/propertymappings/provider/radius/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_managed__isnull { + req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedRadiusProviderPropertyMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedRadiusProviderPropertyMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RadiusProviderPropertyMapping Viewset +pub async fn propertymappings_provider_radius_partial_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + patched_radius_provider_property_mapping_request: Option< + models::PatchedRadiusProviderPropertyMappingRequest, + >, +) -> Result< + models::RadiusProviderPropertyMapping, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_patched_radius_provider_property_mapping_request = + patched_radius_provider_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/radius/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_radius_provider_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RadiusProviderPropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RadiusProviderPropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RadiusProviderPropertyMapping Viewset +pub async fn propertymappings_provider_radius_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/radius/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RadiusProviderPropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RadiusProviderPropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RadiusProviderPropertyMapping Viewset +pub async fn propertymappings_provider_radius_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + radius_provider_property_mapping_request: models::RadiusProviderPropertyMappingRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_radius_provider_property_mapping_request = radius_provider_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/radius/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_radius_provider_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RadiusProviderPropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RadiusProviderPropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_provider_radius_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/radius/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLPropertyMapping Viewset +pub async fn propertymappings_provider_saml_create( + configuration: &configuration::Configuration, + saml_property_mapping_request: models::SamlPropertyMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_saml_property_mapping_request = saml_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/saml/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_saml_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlPropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlPropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLPropertyMapping Viewset +pub async fn propertymappings_provider_saml_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/saml/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLPropertyMapping Viewset +pub async fn propertymappings_provider_saml_list( + configuration: &configuration::Configuration, + friendly_name: Option<&str>, + managed: Option>, + managed__isnull: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + saml_name: Option<&str>, + search: Option<&str>, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_query_friendly_name = friendly_name; + let p_query_managed = managed; + let p_query_managed__isnull = managed__isnull; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_saml_name = saml_name; + let p_query_search = search; + + let uri_str = format!( + "{}/propertymappings/provider/saml/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_friendly_name { + req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_managed__isnull { + req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_saml_name { + req_builder = req_builder.query(&[("saml_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedSamlPropertyMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedSamlPropertyMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLPropertyMapping Viewset +pub async fn propertymappings_provider_saml_partial_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + patched_saml_property_mapping_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_patched_saml_property_mapping_request = patched_saml_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/saml/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_saml_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlPropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlPropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLPropertyMapping Viewset +pub async fn propertymappings_provider_saml_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/saml/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlPropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlPropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLPropertyMapping Viewset +pub async fn propertymappings_provider_saml_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + saml_property_mapping_request: models::SamlPropertyMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_saml_property_mapping_request = saml_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/saml/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_saml_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlPropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlPropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_provider_saml_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/saml/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMMapping Viewset +pub async fn propertymappings_provider_scim_create( + configuration: &configuration::Configuration, + scim_mapping_request: models::ScimMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_scim_mapping_request = scim_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/scim/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scim_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMMapping Viewset +pub async fn propertymappings_provider_scim_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/scim/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMMapping Viewset +pub async fn propertymappings_provider_scim_list( + configuration: &configuration::Configuration, + managed: Option>, + managed__isnull: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_managed = managed; + let p_query_managed__isnull = managed__isnull; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!( + "{}/propertymappings/provider/scim/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_managed__isnull { + req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedScimMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedScimMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMMapping Viewset +pub async fn propertymappings_provider_scim_partial_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + patched_scim_mapping_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_patched_scim_mapping_request = patched_scim_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/scim/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_scim_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMMapping Viewset +pub async fn propertymappings_provider_scim_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/scim/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMMapping Viewset +pub async fn propertymappings_provider_scim_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + scim_mapping_request: models::ScimMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_scim_mapping_request = scim_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/scim/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scim_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_provider_scim_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/scim/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ScopeMapping Viewset +pub async fn propertymappings_provider_scope_create( + configuration: &configuration::Configuration, + scope_mapping_request: models::ScopeMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_scope_mapping_request = scope_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/scope/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scope_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScopeMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScopeMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ScopeMapping Viewset +pub async fn propertymappings_provider_scope_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/scope/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ScopeMapping Viewset +pub async fn propertymappings_provider_scope_list( + configuration: &configuration::Configuration, + managed: Option>, + managed__isnull: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + scope_name: Option<&str>, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_managed = managed; + let p_query_managed__isnull = managed__isnull; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_scope_name = scope_name; + let p_query_search = search; + + let uri_str = format!( + "{}/propertymappings/provider/scope/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_managed__isnull { + req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_scope_name { + req_builder = req_builder.query(&[("scope_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedScopeMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedScopeMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ScopeMapping Viewset +pub async fn propertymappings_provider_scope_partial_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + patched_scope_mapping_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_patched_scope_mapping_request = patched_scope_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/scope/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_scope_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScopeMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScopeMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ScopeMapping Viewset +pub async fn propertymappings_provider_scope_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/scope/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScopeMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScopeMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ScopeMapping Viewset +pub async fn propertymappings_provider_scope_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + scope_mapping_request: models::ScopeMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_scope_mapping_request = scope_mapping_request; + + let uri_str = format!( + "{}/propertymappings/provider/scope/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scope_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScopeMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScopeMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_provider_scope_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/provider/scope/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// KerberosSource PropertyMapping Viewset +pub async fn propertymappings_source_kerberos_create( + configuration: &configuration::Configuration, + kerberos_source_property_mapping_request: models::KerberosSourcePropertyMappingRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_body_kerberos_source_property_mapping_request = kerberos_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/kerberos/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_kerberos_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::KerberosSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::KerberosSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// KerberosSource PropertyMapping Viewset +pub async fn propertymappings_source_kerberos_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/kerberos/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// KerberosSource PropertyMapping Viewset +pub async fn propertymappings_source_kerberos_list( + configuration: &configuration::Configuration, + managed: Option>, + managed__isnull: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result< + models::PaginatedKerberosSourcePropertyMappingList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_managed = managed; + let p_query_managed__isnull = managed__isnull; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!( + "{}/propertymappings/source/kerberos/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_managed__isnull { + req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedKerberosSourcePropertyMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedKerberosSourcePropertyMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// KerberosSource PropertyMapping Viewset +pub async fn propertymappings_source_kerberos_partial_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + patched_kerberos_source_property_mapping_request: Option< + models::PatchedKerberosSourcePropertyMappingRequest, + >, +) -> Result< + models::KerberosSourcePropertyMapping, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_patched_kerberos_source_property_mapping_request = + patched_kerberos_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/kerberos/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_kerberos_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::KerberosSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::KerberosSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// KerberosSource PropertyMapping Viewset +pub async fn propertymappings_source_kerberos_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/kerberos/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::KerberosSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::KerberosSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// KerberosSource PropertyMapping Viewset +pub async fn propertymappings_source_kerberos_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + kerberos_source_property_mapping_request: models::KerberosSourcePropertyMappingRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_kerberos_source_property_mapping_request = kerberos_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/kerberos/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_kerberos_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::KerberosSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::KerberosSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_source_kerberos_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/kerberos/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAP PropertyMapping Viewset +pub async fn propertymappings_source_ldap_create( + configuration: &configuration::Configuration, + ldap_source_property_mapping_request: models::LdapSourcePropertyMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_ldap_source_property_mapping_request = ldap_source_property_mapping_request; + + let uri_str = format!("{}/propertymappings/source/ldap/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_ldap_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LdapSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LdapSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAP PropertyMapping Viewset +pub async fn propertymappings_source_ldap_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/ldap/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAP PropertyMapping Viewset +pub async fn propertymappings_source_ldap_list( + configuration: &configuration::Configuration, + managed: Option>, + managed__isnull: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result< + models::PaginatedLdapSourcePropertyMappingList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_managed = managed; + let p_query_managed__isnull = managed__isnull; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/propertymappings/source/ldap/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_managed__isnull { + req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedLdapSourcePropertyMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedLdapSourcePropertyMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAP PropertyMapping Viewset +pub async fn propertymappings_source_ldap_partial_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + patched_ldap_source_property_mapping_request: Option< + models::PatchedLdapSourcePropertyMappingRequest, + >, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_patched_ldap_source_property_mapping_request = + patched_ldap_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/ldap/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_ldap_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LdapSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LdapSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAP PropertyMapping Viewset +pub async fn propertymappings_source_ldap_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/ldap/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LdapSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LdapSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAP PropertyMapping Viewset +pub async fn propertymappings_source_ldap_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + ldap_source_property_mapping_request: models::LdapSourcePropertyMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_ldap_source_property_mapping_request = ldap_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/ldap/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_ldap_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LdapSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LdapSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_source_ldap_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/ldap/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// OAuthSourcePropertyMapping Viewset +pub async fn propertymappings_source_oauth_create( + configuration: &configuration::Configuration, + o_auth_source_property_mapping_request: models::OAuthSourcePropertyMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_o_auth_source_property_mapping_request = o_auth_source_property_mapping_request; + + let uri_str = format!("{}/propertymappings/source/oauth/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_o_auth_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::OAuthSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::OAuthSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// OAuthSourcePropertyMapping Viewset +pub async fn propertymappings_source_oauth_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/oauth/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// OAuthSourcePropertyMapping Viewset +pub async fn propertymappings_source_oauth_list( + configuration: &configuration::Configuration, + managed: Option>, + managed__isnull: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result< + models::PaginatedOAuthSourcePropertyMappingList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_managed = managed; + let p_query_managed__isnull = managed__isnull; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/propertymappings/source/oauth/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_managed__isnull { + req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedOAuthSourcePropertyMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedOAuthSourcePropertyMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// OAuthSourcePropertyMapping Viewset +pub async fn propertymappings_source_oauth_partial_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + patched_o_auth_source_property_mapping_request: Option< + models::PatchedOAuthSourcePropertyMappingRequest, + >, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_patched_o_auth_source_property_mapping_request = + patched_o_auth_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/oauth/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_o_auth_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::OAuthSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::OAuthSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// OAuthSourcePropertyMapping Viewset +pub async fn propertymappings_source_oauth_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/oauth/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::OAuthSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::OAuthSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// OAuthSourcePropertyMapping Viewset +pub async fn propertymappings_source_oauth_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + o_auth_source_property_mapping_request: models::OAuthSourcePropertyMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_o_auth_source_property_mapping_request = o_auth_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/oauth/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_o_auth_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::OAuthSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::OAuthSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_source_oauth_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/oauth/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PlexSourcePropertyMapping Viewset +pub async fn propertymappings_source_plex_create( + configuration: &configuration::Configuration, + plex_source_property_mapping_request: models::PlexSourcePropertyMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_plex_source_property_mapping_request = plex_source_property_mapping_request; + + let uri_str = format!("{}/propertymappings/source/plex/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_plex_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PlexSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PlexSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PlexSourcePropertyMapping Viewset +pub async fn propertymappings_source_plex_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/plex/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PlexSourcePropertyMapping Viewset +pub async fn propertymappings_source_plex_list( + configuration: &configuration::Configuration, + managed: Option>, + managed__isnull: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result< + models::PaginatedPlexSourcePropertyMappingList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_managed = managed; + let p_query_managed__isnull = managed__isnull; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/propertymappings/source/plex/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_managed__isnull { + req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedPlexSourcePropertyMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedPlexSourcePropertyMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PlexSourcePropertyMapping Viewset +pub async fn propertymappings_source_plex_partial_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + patched_plex_source_property_mapping_request: Option< + models::PatchedPlexSourcePropertyMappingRequest, + >, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_patched_plex_source_property_mapping_request = + patched_plex_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/plex/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_plex_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PlexSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PlexSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PlexSourcePropertyMapping Viewset +pub async fn propertymappings_source_plex_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/plex/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PlexSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PlexSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PlexSourcePropertyMapping Viewset +pub async fn propertymappings_source_plex_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + plex_source_property_mapping_request: models::PlexSourcePropertyMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_plex_source_property_mapping_request = plex_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/plex/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_plex_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PlexSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PlexSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_source_plex_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/plex/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLSourcePropertyMapping Viewset +pub async fn propertymappings_source_saml_create( + configuration: &configuration::Configuration, + saml_source_property_mapping_request: models::SamlSourcePropertyMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_saml_source_property_mapping_request = saml_source_property_mapping_request; + + let uri_str = format!("{}/propertymappings/source/saml/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_saml_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLSourcePropertyMapping Viewset +pub async fn propertymappings_source_saml_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/saml/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLSourcePropertyMapping Viewset +pub async fn propertymappings_source_saml_list( + configuration: &configuration::Configuration, + managed: Option>, + managed__isnull: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result< + models::PaginatedSamlSourcePropertyMappingList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_managed = managed; + let p_query_managed__isnull = managed__isnull; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/propertymappings/source/saml/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_managed__isnull { + req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedSamlSourcePropertyMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedSamlSourcePropertyMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLSourcePropertyMapping Viewset +pub async fn propertymappings_source_saml_partial_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + patched_saml_source_property_mapping_request: Option< + models::PatchedSamlSourcePropertyMappingRequest, + >, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_patched_saml_source_property_mapping_request = + patched_saml_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/saml/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_saml_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLSourcePropertyMapping Viewset +pub async fn propertymappings_source_saml_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/saml/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLSourcePropertyMapping Viewset +pub async fn propertymappings_source_saml_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + saml_source_property_mapping_request: models::SamlSourcePropertyMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_saml_source_property_mapping_request = saml_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/saml/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_saml_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_source_saml_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/saml/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourcePropertyMapping Viewset +pub async fn propertymappings_source_scim_create( + configuration: &configuration::Configuration, + scim_source_property_mapping_request: models::ScimSourcePropertyMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_scim_source_property_mapping_request = scim_source_property_mapping_request; + + let uri_str = format!("{}/propertymappings/source/scim/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scim_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourcePropertyMapping Viewset +pub async fn propertymappings_source_scim_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/scim/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourcePropertyMapping Viewset +pub async fn propertymappings_source_scim_list( + configuration: &configuration::Configuration, + managed: Option>, + managed__isnull: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result< + models::PaginatedScimSourcePropertyMappingList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_managed = managed; + let p_query_managed__isnull = managed__isnull; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/propertymappings/source/scim/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_managed__isnull { + req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedScimSourcePropertyMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedScimSourcePropertyMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourcePropertyMapping Viewset +pub async fn propertymappings_source_scim_partial_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + patched_scim_source_property_mapping_request: Option< + models::PatchedScimSourcePropertyMappingRequest, + >, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_patched_scim_source_property_mapping_request = + patched_scim_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/scim/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_scim_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourcePropertyMapping Viewset +pub async fn propertymappings_source_scim_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/scim/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourcePropertyMapping Viewset +pub async fn propertymappings_source_scim_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + scim_source_property_mapping_request: models::ScimSourcePropertyMappingRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_scim_source_property_mapping_request = scim_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/scim/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scim_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_source_scim_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/scim/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// TelegramSourcePropertyMapping Viewset +pub async fn propertymappings_source_telegram_create( + configuration: &configuration::Configuration, + telegram_source_property_mapping_request: models::TelegramSourcePropertyMappingRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_body_telegram_source_property_mapping_request = telegram_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/telegram/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_telegram_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TelegramSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TelegramSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// TelegramSourcePropertyMapping Viewset +pub async fn propertymappings_source_telegram_destroy( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/telegram/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// TelegramSourcePropertyMapping Viewset +pub async fn propertymappings_source_telegram_list( + configuration: &configuration::Configuration, + managed: Option>, + managed__isnull: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result< + models::PaginatedTelegramSourcePropertyMappingList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_managed = managed; + let p_query_managed__isnull = managed__isnull; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!( + "{}/propertymappings/source/telegram/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_managed__isnull { + req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedTelegramSourcePropertyMappingList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedTelegramSourcePropertyMappingList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// TelegramSourcePropertyMapping Viewset +pub async fn propertymappings_source_telegram_partial_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + patched_telegram_source_property_mapping_request: Option< + models::PatchedTelegramSourcePropertyMappingRequest, + >, +) -> Result< + models::TelegramSourcePropertyMapping, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_patched_telegram_source_property_mapping_request = + patched_telegram_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/telegram/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_telegram_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TelegramSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TelegramSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// TelegramSourcePropertyMapping Viewset +pub async fn propertymappings_source_telegram_retrieve( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/telegram/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TelegramSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TelegramSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// TelegramSourcePropertyMapping Viewset +pub async fn propertymappings_source_telegram_update( + configuration: &configuration::Configuration, + pm_uuid: &str, + telegram_source_property_mapping_request: models::TelegramSourcePropertyMappingRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + let p_body_telegram_source_property_mapping_request = telegram_source_property_mapping_request; + + let uri_str = format!( + "{}/propertymappings/source/telegram/{pm_uuid}/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_telegram_source_property_mapping_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TelegramSourcePropertyMapping`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TelegramSourcePropertyMapping`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn propertymappings_source_telegram_used_by_list( + configuration: &configuration::Configuration, + pm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pm_uuid = pm_uuid; + + let uri_str = format!( + "{}/propertymappings/source/telegram/{pm_uuid}/used_by/", + configuration.base_path, + pm_uuid = crate::apis::urlencode(p_path_pm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/providers_api.rs b/packages/client-rust/src/apis/providers_api.rs new file mode 100644 index 0000000000..b2e48d4008 --- /dev/null +++ b/packages/client-rust/src/apis/providers_api.rs @@ -0,0 +1,9690 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use tokio::fs::File as TokioFile; +use tokio_util::codec::{BytesCodec, FramedRead}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`providers_all_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersAllDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_all_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersAllListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_all_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersAllRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_all_types_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersAllTypesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_all_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersAllUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_groups_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceGroupsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_groups_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceGroupsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_groups_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceGroupsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_groups_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceGroupsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_groups_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceGroupsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspacePartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_sync_object_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceSyncObjectCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_sync_status_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceSyncStatusRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_users_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceUsersCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_users_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceUsersDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_users_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceUsersListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_users_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceUsersRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_google_workspace_users_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersGoogleWorkspaceUsersUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_ldap_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersLdapCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_ldap_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersLdapDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_ldap_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersLdapListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_ldap_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersLdapPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_ldap_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersLdapRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_ldap_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersLdapUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_ldap_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersLdapUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_groups_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraGroupsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_groups_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraGroupsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_groups_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraGroupsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_groups_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraGroupsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_groups_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraGroupsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_sync_object_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraSyncObjectCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_sync_status_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraSyncStatusRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_users_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraUsersCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_users_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraUsersDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_users_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraUsersListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_users_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraUsersRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_microsoft_entra_users_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersMicrosoftEntraUsersUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_oauth2_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersOauth2CreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_oauth2_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersOauth2DestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_oauth2_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersOauth2ListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_oauth2_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersOauth2PartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_oauth2_preview_user_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersOauth2PreviewUserRetrieveError { + Status400(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_oauth2_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersOauth2RetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_oauth2_setup_urls_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersOauth2SetupUrlsRetrieveError { + Status404(), + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_oauth2_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersOauth2UpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_oauth2_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersOauth2UsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_proxy_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersProxyCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_proxy_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersProxyDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_proxy_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersProxyListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_proxy_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersProxyPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_proxy_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersProxyRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_proxy_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersProxyUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_proxy_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersProxyUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_rac_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersRacCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_rac_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersRacDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_rac_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersRacListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_rac_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersRacPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_rac_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersRacRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_rac_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersRacUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_rac_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersRacUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_radius_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersRadiusCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_radius_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersRadiusDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_radius_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersRadiusListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_radius_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersRadiusPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_radius_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersRadiusRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_radius_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersRadiusUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_radius_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersRadiusUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_saml_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSamlCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_saml_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSamlDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_saml_import_metadata_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSamlImportMetadataCreateError { + Status400(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_saml_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSamlListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_saml_metadata_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSamlMetadataRetrieveError { + Status404(), + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_saml_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSamlPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_saml_preview_user_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSamlPreviewUserRetrieveError { + Status400(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_saml_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSamlRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_saml_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSamlUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_saml_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSamlUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_groups_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimGroupsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_groups_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimGroupsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_groups_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimGroupsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_groups_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimGroupsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_groups_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimGroupsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_sync_object_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimSyncObjectCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_sync_status_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimSyncStatusRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_users_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimUsersCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_users_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimUsersDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_users_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimUsersListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_users_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimUsersRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_scim_users_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersScimUsersUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_ssf_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSsfCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_ssf_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSsfDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_ssf_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSsfListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_ssf_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSsfPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_ssf_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSsfRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_ssf_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSsfUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_ssf_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersSsfUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_wsfed_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersWsfedCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_wsfed_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersWsfedDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_wsfed_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersWsfedListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_wsfed_metadata_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersWsfedMetadataRetrieveError { + Status404(), + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_wsfed_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersWsfedPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_wsfed_preview_user_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersWsfedPreviewUserRetrieveError { + Status400(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_wsfed_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersWsfedRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_wsfed_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersWsfedUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`providers_wsfed_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProvidersWsfedUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// Provider Viewset +pub async fn providers_all_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/all/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Provider Viewset +pub async fn providers_all_list( + configuration: &configuration::Configuration, + application__isnull: Option, + backchannel: Option, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_application__isnull = application__isnull; + let p_query_backchannel = backchannel; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/providers/all/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_application__isnull { + req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_backchannel { + req_builder = req_builder.query(&[("backchannel", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedProviderList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedProviderList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Provider Viewset +pub async fn providers_all_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/all/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Provider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Provider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all creatable types +pub async fn providers_all_types_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/providers/all/types/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_all_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/all/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProvider Viewset +pub async fn providers_google_workspace_create( + configuration: &configuration::Configuration, + google_workspace_provider_request: models::GoogleWorkspaceProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_google_workspace_provider_request = google_workspace_provider_request; + + let uri_str = format!("{}/providers/google_workspace/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_google_workspace_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleWorkspaceProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleWorkspaceProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProvider Viewset +pub async fn providers_google_workspace_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/google_workspace/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProviderGroup Viewset +pub async fn providers_google_workspace_groups_create( + configuration: &configuration::Configuration, + google_workspace_provider_group_request: models::GoogleWorkspaceProviderGroupRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_body_google_workspace_provider_group_request = google_workspace_provider_group_request; + + let uri_str = format!( + "{}/providers/google_workspace_groups/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_google_workspace_provider_group_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderGroup`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderGroup`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProviderGroup Viewset +pub async fn providers_google_workspace_groups_destroy( + configuration: &configuration::Configuration, + id: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/google_workspace_groups/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProviderGroup Viewset +pub async fn providers_google_workspace_groups_list( + configuration: &configuration::Configuration, + group__group_uuid: Option<&str>, + group__name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + provider__id: Option, + search: Option<&str>, +) -> Result< + models::PaginatedGoogleWorkspaceProviderGroupList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_group__group_uuid = group__group_uuid; + let p_query_group__name = group__name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_provider__id = provider__id; + let p_query_search = search; + + let uri_str = format!( + "{}/providers/google_workspace_groups/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_group__group_uuid { + req_builder = req_builder.query(&[("group__group_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_group__name { + req_builder = req_builder.query(&[("group__name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_provider__id { + req_builder = req_builder.query(&[("provider__id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGoogleWorkspaceProviderGroupList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGoogleWorkspaceProviderGroupList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProviderGroup Viewset +pub async fn providers_google_workspace_groups_retrieve( + configuration: &configuration::Configuration, + id: &str, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/google_workspace_groups/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderGroup`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderGroup`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_google_workspace_groups_used_by_list( + configuration: &configuration::Configuration, + id: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/google_workspace_groups/{id}/used_by/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProvider Viewset +pub async fn providers_google_workspace_list( + configuration: &configuration::Configuration, + delegated_subject: Option<&str>, + exclude_users_service_account: Option, + filter_group: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_query_delegated_subject = delegated_subject; + let p_query_exclude_users_service_account = exclude_users_service_account; + let p_query_filter_group = filter_group; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/providers/google_workspace/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_delegated_subject { + req_builder = req_builder.query(&[("delegated_subject", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_exclude_users_service_account { + req_builder = + req_builder.query(&[("exclude_users_service_account", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_filter_group { + req_builder = req_builder.query(&[("filter_group", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGoogleWorkspaceProviderList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGoogleWorkspaceProviderList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProvider Viewset +pub async fn providers_google_workspace_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_google_workspace_provider_request: Option< + models::PatchedGoogleWorkspaceProviderRequest, + >, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_google_workspace_provider_request = + patched_google_workspace_provider_request; + + let uri_str = format!( + "{}/providers/google_workspace/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_google_workspace_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleWorkspaceProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleWorkspaceProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProvider Viewset +pub async fn providers_google_workspace_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/google_workspace/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleWorkspaceProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleWorkspaceProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Sync/Re-sync a single user/group object +pub async fn providers_google_workspace_sync_object_create( + configuration: &configuration::Configuration, + id: i32, + sync_object_request: models::SyncObjectRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_sync_object_request = sync_object_request; + + let uri_str = format!( + "{}/providers/google_workspace/{id}/sync/object/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_sync_object_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SyncObjectResult`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SyncObjectResult`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get provider's sync status +pub async fn providers_google_workspace_sync_status_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/google_workspace/{id}/sync/status/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SyncStatus`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SyncStatus`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProvider Viewset +pub async fn providers_google_workspace_update( + configuration: &configuration::Configuration, + id: i32, + google_workspace_provider_request: models::GoogleWorkspaceProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_google_workspace_provider_request = google_workspace_provider_request; + + let uri_str = format!( + "{}/providers/google_workspace/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_google_workspace_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleWorkspaceProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleWorkspaceProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_google_workspace_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/google_workspace/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProviderUser Viewset +pub async fn providers_google_workspace_users_create( + configuration: &configuration::Configuration, + google_workspace_provider_user_request: models::GoogleWorkspaceProviderUserRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_google_workspace_provider_user_request = google_workspace_provider_user_request; + + let uri_str = format!( + "{}/providers/google_workspace_users/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_google_workspace_provider_user_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderUser`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderUser`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProviderUser Viewset +pub async fn providers_google_workspace_users_destroy( + configuration: &configuration::Configuration, + id: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/google_workspace_users/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProviderUser Viewset +pub async fn providers_google_workspace_users_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + provider__id: Option, + search: Option<&str>, + user__id: Option, + user__username: Option<&str>, +) -> Result< + models::PaginatedGoogleWorkspaceProviderUserList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_provider__id = provider__id; + let p_query_search = search; + let p_query_user__id = user__id; + let p_query_user__username = user__username; + + let uri_str = format!( + "{}/providers/google_workspace_users/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_provider__id { + req_builder = req_builder.query(&[("provider__id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user__id { + req_builder = req_builder.query(&[("user__id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user__username { + req_builder = req_builder.query(&[("user__username", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGoogleWorkspaceProviderUserList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGoogleWorkspaceProviderUserList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// GoogleWorkspaceProviderUser Viewset +pub async fn providers_google_workspace_users_retrieve( + configuration: &configuration::Configuration, + id: &str, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/google_workspace_users/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderUser`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GoogleWorkspaceProviderUser`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_google_workspace_users_used_by_list( + configuration: &configuration::Configuration, + id: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/google_workspace_users/{id}/used_by/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAPProvider Viewset +pub async fn providers_ldap_create( + configuration: &configuration::Configuration, + ldap_provider_request: models::LdapProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_ldap_provider_request = ldap_provider_request; + + let uri_str = format!("{}/providers/ldap/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_ldap_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LdapProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LdapProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAPProvider Viewset +pub async fn providers_ldap_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/ldap/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAPProvider Viewset +pub async fn providers_ldap_list( + configuration: &configuration::Configuration, + application__isnull: Option, + authorization_flow__slug__iexact: Option<&str>, + base_dn__iexact: Option<&str>, + certificate__kp_uuid__iexact: Option<&str>, + certificate__name__iexact: Option<&str>, + gid_start_number__iexact: Option, + name__iexact: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + tls_server_name__iexact: Option<&str>, + uid_start_number__iexact: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_application__isnull = application__isnull; + let p_query_authorization_flow__slug__iexact = authorization_flow__slug__iexact; + let p_query_base_dn__iexact = base_dn__iexact; + let p_query_certificate__kp_uuid__iexact = certificate__kp_uuid__iexact; + let p_query_certificate__name__iexact = certificate__name__iexact; + let p_query_gid_start_number__iexact = gid_start_number__iexact; + let p_query_name__iexact = name__iexact; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_tls_server_name__iexact = tls_server_name__iexact; + let p_query_uid_start_number__iexact = uid_start_number__iexact; + + let uri_str = format!("{}/providers/ldap/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_application__isnull { + req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_authorization_flow__slug__iexact { + req_builder = + req_builder.query(&[("authorization_flow__slug__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_base_dn__iexact { + req_builder = req_builder.query(&[("base_dn__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_certificate__kp_uuid__iexact { + req_builder = + req_builder.query(&[("certificate__kp_uuid__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_certificate__name__iexact { + req_builder = req_builder.query(&[("certificate__name__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_gid_start_number__iexact { + req_builder = req_builder.query(&[("gid_start_number__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name__iexact { + req_builder = req_builder.query(&[("name__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_tls_server_name__iexact { + req_builder = req_builder.query(&[("tls_server_name__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_uid_start_number__iexact { + req_builder = req_builder.query(&[("uid_start_number__iexact", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedLdapProviderList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedLdapProviderList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAPProvider Viewset +pub async fn providers_ldap_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_ldap_provider_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_ldap_provider_request = patched_ldap_provider_request; + + let uri_str = format!( + "{}/providers/ldap/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_ldap_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LdapProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LdapProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAPProvider Viewset +pub async fn providers_ldap_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/ldap/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LdapProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LdapProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAPProvider Viewset +pub async fn providers_ldap_update( + configuration: &configuration::Configuration, + id: i32, + ldap_provider_request: models::LdapProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_ldap_provider_request = ldap_provider_request; + + let uri_str = format!( + "{}/providers/ldap/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_ldap_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LdapProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LdapProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_ldap_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/ldap/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProvider Viewset +pub async fn providers_microsoft_entra_create( + configuration: &configuration::Configuration, + microsoft_entra_provider_request: models::MicrosoftEntraProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_microsoft_entra_provider_request = microsoft_entra_provider_request; + + let uri_str = format!("{}/providers/microsoft_entra/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_microsoft_entra_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MicrosoftEntraProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MicrosoftEntraProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProvider Viewset +pub async fn providers_microsoft_entra_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/microsoft_entra/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProviderGroup Viewset +pub async fn providers_microsoft_entra_groups_create( + configuration: &configuration::Configuration, + microsoft_entra_provider_group_request: models::MicrosoftEntraProviderGroupRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_microsoft_entra_provider_group_request = microsoft_entra_provider_group_request; + + let uri_str = format!( + "{}/providers/microsoft_entra_groups/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_microsoft_entra_provider_group_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderGroup`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderGroup`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProviderGroup Viewset +pub async fn providers_microsoft_entra_groups_destroy( + configuration: &configuration::Configuration, + id: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/microsoft_entra_groups/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProviderGroup Viewset +pub async fn providers_microsoft_entra_groups_list( + configuration: &configuration::Configuration, + group__group_uuid: Option<&str>, + group__name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + provider__id: Option, + search: Option<&str>, +) -> Result< + models::PaginatedMicrosoftEntraProviderGroupList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_group__group_uuid = group__group_uuid; + let p_query_group__name = group__name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_provider__id = provider__id; + let p_query_search = search; + + let uri_str = format!( + "{}/providers/microsoft_entra_groups/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_group__group_uuid { + req_builder = req_builder.query(&[("group__group_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_group__name { + req_builder = req_builder.query(&[("group__name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_provider__id { + req_builder = req_builder.query(&[("provider__id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedMicrosoftEntraProviderGroupList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedMicrosoftEntraProviderGroupList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProviderGroup Viewset +pub async fn providers_microsoft_entra_groups_retrieve( + configuration: &configuration::Configuration, + id: &str, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/microsoft_entra_groups/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderGroup`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderGroup`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_microsoft_entra_groups_used_by_list( + configuration: &configuration::Configuration, + id: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/microsoft_entra_groups/{id}/used_by/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProvider Viewset +pub async fn providers_microsoft_entra_list( + configuration: &configuration::Configuration, + exclude_users_service_account: Option, + filter_group: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_exclude_users_service_account = exclude_users_service_account; + let p_query_filter_group = filter_group; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/providers/microsoft_entra/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_exclude_users_service_account { + req_builder = + req_builder.query(&[("exclude_users_service_account", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_filter_group { + req_builder = req_builder.query(&[("filter_group", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedMicrosoftEntraProviderList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedMicrosoftEntraProviderList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProvider Viewset +pub async fn providers_microsoft_entra_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_microsoft_entra_provider_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_microsoft_entra_provider_request = patched_microsoft_entra_provider_request; + + let uri_str = format!( + "{}/providers/microsoft_entra/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_microsoft_entra_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MicrosoftEntraProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MicrosoftEntraProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProvider Viewset +pub async fn providers_microsoft_entra_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/microsoft_entra/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MicrosoftEntraProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MicrosoftEntraProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Sync/Re-sync a single user/group object +pub async fn providers_microsoft_entra_sync_object_create( + configuration: &configuration::Configuration, + id: i32, + sync_object_request: models::SyncObjectRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_sync_object_request = sync_object_request; + + let uri_str = format!( + "{}/providers/microsoft_entra/{id}/sync/object/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_sync_object_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SyncObjectResult`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SyncObjectResult`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get provider's sync status +pub async fn providers_microsoft_entra_sync_status_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/microsoft_entra/{id}/sync/status/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SyncStatus`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SyncStatus`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProvider Viewset +pub async fn providers_microsoft_entra_update( + configuration: &configuration::Configuration, + id: i32, + microsoft_entra_provider_request: models::MicrosoftEntraProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_microsoft_entra_provider_request = microsoft_entra_provider_request; + + let uri_str = format!( + "{}/providers/microsoft_entra/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_microsoft_entra_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MicrosoftEntraProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MicrosoftEntraProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_microsoft_entra_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/microsoft_entra/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProviderUser Viewset +pub async fn providers_microsoft_entra_users_create( + configuration: &configuration::Configuration, + microsoft_entra_provider_user_request: models::MicrosoftEntraProviderUserRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_microsoft_entra_provider_user_request = microsoft_entra_provider_user_request; + + let uri_str = format!( + "{}/providers/microsoft_entra_users/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_microsoft_entra_provider_user_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderUser`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderUser`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProviderUser Viewset +pub async fn providers_microsoft_entra_users_destroy( + configuration: &configuration::Configuration, + id: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/microsoft_entra_users/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProviderUser Viewset +pub async fn providers_microsoft_entra_users_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + provider__id: Option, + search: Option<&str>, + user__id: Option, + user__username: Option<&str>, +) -> Result< + models::PaginatedMicrosoftEntraProviderUserList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_provider__id = provider__id; + let p_query_search = search; + let p_query_user__id = user__id; + let p_query_user__username = user__username; + + let uri_str = format!( + "{}/providers/microsoft_entra_users/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_provider__id { + req_builder = req_builder.query(&[("provider__id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user__id { + req_builder = req_builder.query(&[("user__id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user__username { + req_builder = req_builder.query(&[("user__username", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedMicrosoftEntraProviderUserList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedMicrosoftEntraProviderUserList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MicrosoftEntraProviderUser Viewset +pub async fn providers_microsoft_entra_users_retrieve( + configuration: &configuration::Configuration, + id: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/microsoft_entra_users/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderUser`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MicrosoftEntraProviderUser`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_microsoft_entra_users_used_by_list( + configuration: &configuration::Configuration, + id: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/microsoft_entra_users/{id}/used_by/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// OAuth2Provider Viewset +pub async fn providers_oauth2_create( + configuration: &configuration::Configuration, + o_auth2_provider_request: models::OAuth2ProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_o_auth2_provider_request = o_auth2_provider_request; + + let uri_str = format!("{}/providers/oauth2/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_o_auth2_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::OAuth2Provider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::OAuth2Provider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// OAuth2Provider Viewset +pub async fn providers_oauth2_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/oauth2/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// OAuth2Provider Viewset +pub async fn providers_oauth2_list( + configuration: &configuration::Configuration, + access_code_validity: Option<&str>, + access_token_validity: Option<&str>, + application: Option<&str>, + authorization_flow: Option<&str>, + client_id: Option<&str>, + client_type: Option<&str>, + include_claims_in_id_token: Option, + issuer_mode: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + property_mappings: Option>, + refresh_token_validity: Option<&str>, + search: Option<&str>, + signing_key: Option<&str>, + sub_mode: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_access_code_validity = access_code_validity; + let p_query_access_token_validity = access_token_validity; + let p_query_application = application; + let p_query_authorization_flow = authorization_flow; + let p_query_client_id = client_id; + let p_query_client_type = client_type; + let p_query_include_claims_in_id_token = include_claims_in_id_token; + let p_query_issuer_mode = issuer_mode; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_property_mappings = property_mappings; + let p_query_refresh_token_validity = refresh_token_validity; + let p_query_search = search; + let p_query_signing_key = signing_key; + let p_query_sub_mode = sub_mode; + + let uri_str = format!("{}/providers/oauth2/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_access_code_validity { + req_builder = req_builder.query(&[("access_code_validity", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_access_token_validity { + req_builder = req_builder.query(&[("access_token_validity", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_application { + req_builder = req_builder.query(&[("application", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_authorization_flow { + req_builder = req_builder.query(&[("authorization_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_client_id { + req_builder = req_builder.query(&[("client_id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_client_type { + req_builder = req_builder.query(&[("client_type", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_include_claims_in_id_token { + req_builder = + req_builder.query(&[("include_claims_in_id_token", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_issuer_mode { + req_builder = req_builder.query(&[("issuer_mode", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_property_mappings { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("property_mappings".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "property_mappings", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_refresh_token_validity { + req_builder = req_builder.query(&[("refresh_token_validity", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_signing_key { + req_builder = req_builder.query(&[("signing_key", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sub_mode { + req_builder = req_builder.query(&[("sub_mode", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedOAuth2ProviderList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedOAuth2ProviderList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// OAuth2Provider Viewset +pub async fn providers_oauth2_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_o_auth2_provider_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_o_auth2_provider_request = patched_o_auth2_provider_request; + + let uri_str = format!( + "{}/providers/oauth2/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_o_auth2_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::OAuth2Provider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::OAuth2Provider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Preview user data for provider +pub async fn providers_oauth2_preview_user_retrieve( + configuration: &configuration::Configuration, + id: i32, + for_user: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_query_for_user = for_user; + + let uri_str = format!( + "{}/providers/oauth2/{id}/preview_user/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_for_user { + req_builder = req_builder.query(&[("for_user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PropertyMappingPreview`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PropertyMappingPreview`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// OAuth2Provider Viewset +pub async fn providers_oauth2_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/oauth2/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::OAuth2Provider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::OAuth2Provider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get Providers setup URLs +pub async fn providers_oauth2_setup_urls_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/oauth2/{id}/setup_urls/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::OAuth2ProviderSetupUrls`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::OAuth2ProviderSetupUrls`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// OAuth2Provider Viewset +pub async fn providers_oauth2_update( + configuration: &configuration::Configuration, + id: i32, + o_auth2_provider_request: models::OAuth2ProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_o_auth2_provider_request = o_auth2_provider_request; + + let uri_str = format!( + "{}/providers/oauth2/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_o_auth2_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::OAuth2Provider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::OAuth2Provider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_oauth2_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/oauth2/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ProxyProvider Viewset +pub async fn providers_proxy_create( + configuration: &configuration::Configuration, + proxy_provider_request: models::ProxyProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_proxy_provider_request = proxy_provider_request; + + let uri_str = format!("{}/providers/proxy/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_proxy_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ProxyProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ProxyProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ProxyProvider Viewset +pub async fn providers_proxy_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/proxy/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ProxyProvider Viewset +pub async fn providers_proxy_list( + configuration: &configuration::Configuration, + application__isnull: Option, + authorization_flow__slug__iexact: Option<&str>, + basic_auth_enabled__iexact: Option, + basic_auth_password_attribute__iexact: Option<&str>, + basic_auth_user_attribute__iexact: Option<&str>, + certificate__kp_uuid__iexact: Option<&str>, + certificate__name__iexact: Option<&str>, + cookie_domain__iexact: Option<&str>, + external_host__iexact: Option<&str>, + internal_host__iexact: Option<&str>, + internal_host_ssl_validation__iexact: Option, + mode__iexact: Option<&str>, + name__iexact: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + property_mappings__iexact: Option>, + search: Option<&str>, + skip_path_regex__iexact: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_application__isnull = application__isnull; + let p_query_authorization_flow__slug__iexact = authorization_flow__slug__iexact; + let p_query_basic_auth_enabled__iexact = basic_auth_enabled__iexact; + let p_query_basic_auth_password_attribute__iexact = basic_auth_password_attribute__iexact; + let p_query_basic_auth_user_attribute__iexact = basic_auth_user_attribute__iexact; + let p_query_certificate__kp_uuid__iexact = certificate__kp_uuid__iexact; + let p_query_certificate__name__iexact = certificate__name__iexact; + let p_query_cookie_domain__iexact = cookie_domain__iexact; + let p_query_external_host__iexact = external_host__iexact; + let p_query_internal_host__iexact = internal_host__iexact; + let p_query_internal_host_ssl_validation__iexact = internal_host_ssl_validation__iexact; + let p_query_mode__iexact = mode__iexact; + let p_query_name__iexact = name__iexact; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_property_mappings__iexact = property_mappings__iexact; + let p_query_search = search; + let p_query_skip_path_regex__iexact = skip_path_regex__iexact; + + let uri_str = format!("{}/providers/proxy/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_application__isnull { + req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_authorization_flow__slug__iexact { + req_builder = + req_builder.query(&[("authorization_flow__slug__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_basic_auth_enabled__iexact { + req_builder = + req_builder.query(&[("basic_auth_enabled__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_basic_auth_password_attribute__iexact { + req_builder = req_builder.query(&[( + "basic_auth_password_attribute__iexact", + ¶m_value.to_string(), + )]); + } + if let Some(ref param_value) = p_query_basic_auth_user_attribute__iexact { + req_builder = req_builder.query(&[( + "basic_auth_user_attribute__iexact", + ¶m_value.to_string(), + )]); + } + if let Some(ref param_value) = p_query_certificate__kp_uuid__iexact { + req_builder = + req_builder.query(&[("certificate__kp_uuid__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_certificate__name__iexact { + req_builder = req_builder.query(&[("certificate__name__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_cookie_domain__iexact { + req_builder = req_builder.query(&[("cookie_domain__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_external_host__iexact { + req_builder = req_builder.query(&[("external_host__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_internal_host__iexact { + req_builder = req_builder.query(&[("internal_host__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_internal_host_ssl_validation__iexact { + req_builder = req_builder.query(&[( + "internal_host_ssl_validation__iexact", + ¶m_value.to_string(), + )]); + } + if let Some(ref param_value) = p_query_mode__iexact { + req_builder = req_builder.query(&[("mode__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name__iexact { + req_builder = req_builder.query(&[("name__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_property_mappings__iexact { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("property_mappings__iexact".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "property_mappings__iexact", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_skip_path_regex__iexact { + req_builder = req_builder.query(&[("skip_path_regex__iexact", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedProxyProviderList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedProxyProviderList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ProxyProvider Viewset +pub async fn providers_proxy_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_proxy_provider_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_proxy_provider_request = patched_proxy_provider_request; + + let uri_str = format!( + "{}/providers/proxy/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_proxy_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ProxyProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ProxyProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ProxyProvider Viewset +pub async fn providers_proxy_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/proxy/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ProxyProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ProxyProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ProxyProvider Viewset +pub async fn providers_proxy_update( + configuration: &configuration::Configuration, + id: i32, + proxy_provider_request: models::ProxyProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_proxy_provider_request = proxy_provider_request; + + let uri_str = format!( + "{}/providers/proxy/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_proxy_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ProxyProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ProxyProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_proxy_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/proxy/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RACProvider Viewset +pub async fn providers_rac_create( + configuration: &configuration::Configuration, + rac_provider_request: models::RacProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_rac_provider_request = rac_provider_request; + + let uri_str = format!("{}/providers/rac/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_rac_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RacProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RacProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RACProvider Viewset +pub async fn providers_rac_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/rac/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RACProvider Viewset +pub async fn providers_rac_list( + configuration: &configuration::Configuration, + application__isnull: Option, + name__iexact: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_application__isnull = application__isnull; + let p_query_name__iexact = name__iexact; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/providers/rac/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_application__isnull { + req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name__iexact { + req_builder = req_builder.query(&[("name__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedRacProviderList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedRacProviderList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RACProvider Viewset +pub async fn providers_rac_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_rac_provider_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_rac_provider_request = patched_rac_provider_request; + + let uri_str = format!( + "{}/providers/rac/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_rac_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RacProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RacProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RACProvider Viewset +pub async fn providers_rac_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/rac/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RacProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RacProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RACProvider Viewset +pub async fn providers_rac_update( + configuration: &configuration::Configuration, + id: i32, + rac_provider_request: models::RacProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_rac_provider_request = rac_provider_request; + + let uri_str = format!( + "{}/providers/rac/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_rac_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RacProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RacProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_rac_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/rac/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RadiusProvider Viewset +pub async fn providers_radius_create( + configuration: &configuration::Configuration, + radius_provider_request: models::RadiusProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_radius_provider_request = radius_provider_request; + + let uri_str = format!("{}/providers/radius/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_radius_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RadiusProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RadiusProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RadiusProvider Viewset +pub async fn providers_radius_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/radius/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RadiusProvider Viewset +pub async fn providers_radius_list( + configuration: &configuration::Configuration, + application__isnull: Option, + authorization_flow__slug__iexact: Option<&str>, + client_networks__iexact: Option<&str>, + name__iexact: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_application__isnull = application__isnull; + let p_query_authorization_flow__slug__iexact = authorization_flow__slug__iexact; + let p_query_client_networks__iexact = client_networks__iexact; + let p_query_name__iexact = name__iexact; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/providers/radius/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_application__isnull { + req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_authorization_flow__slug__iexact { + req_builder = + req_builder.query(&[("authorization_flow__slug__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_client_networks__iexact { + req_builder = req_builder.query(&[("client_networks__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name__iexact { + req_builder = req_builder.query(&[("name__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedRadiusProviderList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedRadiusProviderList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RadiusProvider Viewset +pub async fn providers_radius_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_radius_provider_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_radius_provider_request = patched_radius_provider_request; + + let uri_str = format!( + "{}/providers/radius/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_radius_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RadiusProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RadiusProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RadiusProvider Viewset +pub async fn providers_radius_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/radius/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RadiusProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RadiusProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RadiusProvider Viewset +pub async fn providers_radius_update( + configuration: &configuration::Configuration, + id: i32, + radius_provider_request: models::RadiusProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_radius_provider_request = radius_provider_request; + + let uri_str = format!( + "{}/providers/radius/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_radius_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RadiusProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RadiusProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_radius_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/radius/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLProvider Viewset +pub async fn providers_saml_create( + configuration: &configuration::Configuration, + saml_provider_request: models::SamlProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_saml_provider_request = saml_provider_request; + + let uri_str = format!("{}/providers/saml/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_saml_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLProvider Viewset +pub async fn providers_saml_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/saml/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Create provider from SAML Metadata +pub async fn providers_saml_import_metadata_create( + configuration: &configuration::Configuration, + name: &str, + authorization_flow: &str, + invalidation_flow: &str, + file: std::path::PathBuf, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_form_name = name; + let p_form_authorization_flow = authorization_flow; + let p_form_invalidation_flow = invalidation_flow; + let p_form_file = file; + + let uri_str = format!( + "{}/providers/saml/import_metadata/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + let mut multipart_form = reqwest::multipart::Form::new(); + multipart_form = multipart_form.text("name", p_form_name.to_string()); + multipart_form = + multipart_form.text("authorization_flow", p_form_authorization_flow.to_string()); + multipart_form = multipart_form.text("invalidation_flow", p_form_invalidation_flow.to_string()); + let file = TokioFile::open(&p_form_file).await?; + let stream = FramedRead::new(file, BytesCodec::new()); + let file_name = p_form_file + .file_name() + .map(|n| n.to_string_lossy().to_string()) + .unwrap_or_default(); + let file_part = + reqwest::multipart::Part::stream(reqwest::Body::wrap_stream(stream)).file_name(file_name); + multipart_form = multipart_form.part("file", file_part); + req_builder = req_builder.multipart(multipart_form); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLProvider Viewset +pub async fn providers_saml_list( + configuration: &configuration::Configuration, + acs_url: Option<&str>, + assertion_valid_not_before: Option<&str>, + assertion_valid_not_on_or_after: Option<&str>, + audience: Option<&str>, + authentication_flow: Option<&str>, + authn_context_class_ref_mapping: Option<&str>, + authorization_flow: Option<&str>, + backchannel_application: Option<&str>, + default_name_id_policy: Option<&str>, + default_relay_state: Option<&str>, + digest_algorithm: Option<&str>, + encryption_kp: Option<&str>, + invalidation_flow: Option<&str>, + is_backchannel: Option, + issuer: Option<&str>, + logout_method: Option<&str>, + name: Option<&str>, + name_id_mapping: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + property_mappings: Option>, + search: Option<&str>, + session_valid_not_on_or_after: Option<&str>, + sign_assertion: Option, + sign_logout_request: Option, + sign_logout_response: Option, + sign_response: Option, + signature_algorithm: Option<&str>, + signing_kp: Option<&str>, + sls_binding: Option<&str>, + sls_url: Option<&str>, + sp_binding: Option<&str>, + verification_kp: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_acs_url = acs_url; + let p_query_assertion_valid_not_before = assertion_valid_not_before; + let p_query_assertion_valid_not_on_or_after = assertion_valid_not_on_or_after; + let p_query_audience = audience; + let p_query_authentication_flow = authentication_flow; + let p_query_authn_context_class_ref_mapping = authn_context_class_ref_mapping; + let p_query_authorization_flow = authorization_flow; + let p_query_backchannel_application = backchannel_application; + let p_query_default_name_id_policy = default_name_id_policy; + let p_query_default_relay_state = default_relay_state; + let p_query_digest_algorithm = digest_algorithm; + let p_query_encryption_kp = encryption_kp; + let p_query_invalidation_flow = invalidation_flow; + let p_query_is_backchannel = is_backchannel; + let p_query_issuer = issuer; + let p_query_logout_method = logout_method; + let p_query_name = name; + let p_query_name_id_mapping = name_id_mapping; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_property_mappings = property_mappings; + let p_query_search = search; + let p_query_session_valid_not_on_or_after = session_valid_not_on_or_after; + let p_query_sign_assertion = sign_assertion; + let p_query_sign_logout_request = sign_logout_request; + let p_query_sign_logout_response = sign_logout_response; + let p_query_sign_response = sign_response; + let p_query_signature_algorithm = signature_algorithm; + let p_query_signing_kp = signing_kp; + let p_query_sls_binding = sls_binding; + let p_query_sls_url = sls_url; + let p_query_sp_binding = sp_binding; + let p_query_verification_kp = verification_kp; + + let uri_str = format!("{}/providers/saml/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_acs_url { + req_builder = req_builder.query(&[("acs_url", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_assertion_valid_not_before { + req_builder = + req_builder.query(&[("assertion_valid_not_before", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_assertion_valid_not_on_or_after { + req_builder = + req_builder.query(&[("assertion_valid_not_on_or_after", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_audience { + req_builder = req_builder.query(&[("audience", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_authentication_flow { + req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_authn_context_class_ref_mapping { + req_builder = + req_builder.query(&[("authn_context_class_ref_mapping", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_authorization_flow { + req_builder = req_builder.query(&[("authorization_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_backchannel_application { + req_builder = req_builder.query(&[("backchannel_application", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_default_name_id_policy { + req_builder = req_builder.query(&[("default_name_id_policy", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_default_relay_state { + req_builder = req_builder.query(&[("default_relay_state", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_digest_algorithm { + req_builder = req_builder.query(&[("digest_algorithm", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_encryption_kp { + req_builder = req_builder.query(&[("encryption_kp", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_invalidation_flow { + req_builder = req_builder.query(&[("invalidation_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_is_backchannel { + req_builder = req_builder.query(&[("is_backchannel", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_issuer { + req_builder = req_builder.query(&[("issuer", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_logout_method { + req_builder = req_builder.query(&[("logout_method", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name_id_mapping { + req_builder = req_builder.query(&[("name_id_mapping", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_property_mappings { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("property_mappings".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "property_mappings", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_session_valid_not_on_or_after { + req_builder = + req_builder.query(&[("session_valid_not_on_or_after", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sign_assertion { + req_builder = req_builder.query(&[("sign_assertion", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sign_logout_request { + req_builder = req_builder.query(&[("sign_logout_request", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sign_logout_response { + req_builder = req_builder.query(&[("sign_logout_response", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sign_response { + req_builder = req_builder.query(&[("sign_response", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_signature_algorithm { + req_builder = req_builder.query(&[("signature_algorithm", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_signing_kp { + req_builder = req_builder.query(&[("signing_kp", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sls_binding { + req_builder = req_builder.query(&[("sls_binding", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sls_url { + req_builder = req_builder.query(&[("sls_url", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sp_binding { + req_builder = req_builder.query(&[("sp_binding", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_verification_kp { + req_builder = req_builder.query(&[("verification_kp", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedSamlProviderList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedSamlProviderList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Return metadata as XML string +pub async fn providers_saml_metadata_retrieve( + configuration: &configuration::Configuration, + id: i32, + download: Option, + force_binding: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_query_download = download; + let p_query_force_binding = force_binding; + + let uri_str = format!( + "{}/providers/saml/{id}/metadata/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_download { + req_builder = req_builder.query(&[("download", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_force_binding { + req_builder = req_builder.query(&[("force_binding", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlMetadata`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlMetadata`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLProvider Viewset +pub async fn providers_saml_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_saml_provider_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_saml_provider_request = patched_saml_provider_request; + + let uri_str = format!( + "{}/providers/saml/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_saml_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Preview user data for provider +pub async fn providers_saml_preview_user_retrieve( + configuration: &configuration::Configuration, + id: i32, + for_user: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_query_for_user = for_user; + + let uri_str = format!( + "{}/providers/saml/{id}/preview_user/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_for_user { + req_builder = req_builder.query(&[("for_user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PropertyMappingPreview`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PropertyMappingPreview`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLProvider Viewset +pub async fn providers_saml_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/saml/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLProvider Viewset +pub async fn providers_saml_update( + configuration: &configuration::Configuration, + id: i32, + saml_provider_request: models::SamlProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_saml_provider_request = saml_provider_request; + + let uri_str = format!( + "{}/providers/saml/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_saml_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_saml_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/saml/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMProvider Viewset +pub async fn providers_scim_create( + configuration: &configuration::Configuration, + scim_provider_request: models::ScimProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_scim_provider_request = scim_provider_request; + + let uri_str = format!("{}/providers/scim/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scim_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMProvider Viewset +pub async fn providers_scim_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/scim/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMProviderGroup Viewset +pub async fn providers_scim_groups_create( + configuration: &configuration::Configuration, + scim_provider_group_request: models::ScimProviderGroupRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_scim_provider_group_request = scim_provider_group_request; + + let uri_str = format!("{}/providers/scim_groups/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scim_provider_group_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimProviderGroup`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimProviderGroup`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMProviderGroup Viewset +pub async fn providers_scim_groups_destroy( + configuration: &configuration::Configuration, + id: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/scim_groups/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMProviderGroup Viewset +pub async fn providers_scim_groups_list( + configuration: &configuration::Configuration, + group__group_uuid: Option<&str>, + group__name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + provider__id: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_group__group_uuid = group__group_uuid; + let p_query_group__name = group__name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_provider__id = provider__id; + let p_query_search = search; + + let uri_str = format!("{}/providers/scim_groups/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_group__group_uuid { + req_builder = req_builder.query(&[("group__group_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_group__name { + req_builder = req_builder.query(&[("group__name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_provider__id { + req_builder = req_builder.query(&[("provider__id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedScimProviderGroupList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedScimProviderGroupList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMProviderGroup Viewset +pub async fn providers_scim_groups_retrieve( + configuration: &configuration::Configuration, + id: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/scim_groups/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimProviderGroup`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimProviderGroup`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_scim_groups_used_by_list( + configuration: &configuration::Configuration, + id: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/scim_groups/{id}/used_by/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMProvider Viewset +pub async fn providers_scim_list( + configuration: &configuration::Configuration, + exclude_users_service_account: Option, + group_filters: Option>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + url: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_exclude_users_service_account = exclude_users_service_account; + let p_query_group_filters = group_filters; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_url = url; + + let uri_str = format!("{}/providers/scim/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_exclude_users_service_account { + req_builder = + req_builder.query(&[("exclude_users_service_account", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_group_filters { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("group_filters".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "group_filters", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_url { + req_builder = req_builder.query(&[("url", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedScimProviderList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedScimProviderList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMProvider Viewset +pub async fn providers_scim_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_scim_provider_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_scim_provider_request = patched_scim_provider_request; + + let uri_str = format!( + "{}/providers/scim/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_scim_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMProvider Viewset +pub async fn providers_scim_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/scim/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Sync/Re-sync a single user/group object +pub async fn providers_scim_sync_object_create( + configuration: &configuration::Configuration, + id: i32, + sync_object_request: models::SyncObjectRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_sync_object_request = sync_object_request; + + let uri_str = format!( + "{}/providers/scim/{id}/sync/object/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_sync_object_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SyncObjectResult`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SyncObjectResult`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get provider's sync status +pub async fn providers_scim_sync_status_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/scim/{id}/sync/status/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SyncStatus`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SyncStatus`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMProvider Viewset +pub async fn providers_scim_update( + configuration: &configuration::Configuration, + id: i32, + scim_provider_request: models::ScimProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_scim_provider_request = scim_provider_request; + + let uri_str = format!( + "{}/providers/scim/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scim_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_scim_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/scim/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMProviderUser Viewset +pub async fn providers_scim_users_create( + configuration: &configuration::Configuration, + scim_provider_user_request: models::ScimProviderUserRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_scim_provider_user_request = scim_provider_user_request; + + let uri_str = format!("{}/providers/scim_users/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scim_provider_user_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimProviderUser`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimProviderUser`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMProviderUser Viewset +pub async fn providers_scim_users_destroy( + configuration: &configuration::Configuration, + id: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/scim_users/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMProviderUser Viewset +pub async fn providers_scim_users_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + provider__id: Option, + search: Option<&str>, + user__id: Option, + user__username: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_provider__id = provider__id; + let p_query_search = search; + let p_query_user__id = user__id; + let p_query_user__username = user__username; + + let uri_str = format!("{}/providers/scim_users/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_provider__id { + req_builder = req_builder.query(&[("provider__id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user__id { + req_builder = req_builder.query(&[("user__id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user__username { + req_builder = req_builder.query(&[("user__username", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedScimProviderUserList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedScimProviderUserList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMProviderUser Viewset +pub async fn providers_scim_users_retrieve( + configuration: &configuration::Configuration, + id: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/scim_users/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimProviderUser`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimProviderUser`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_scim_users_used_by_list( + configuration: &configuration::Configuration, + id: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/scim_users/{id}/used_by/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SSFProvider Viewset +pub async fn providers_ssf_create( + configuration: &configuration::Configuration, + ssf_provider_request: models::SsfProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_ssf_provider_request = ssf_provider_request; + + let uri_str = format!("{}/providers/ssf/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_ssf_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SsfProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SsfProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SSFProvider Viewset +pub async fn providers_ssf_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/ssf/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SSFProvider Viewset +pub async fn providers_ssf_list( + configuration: &configuration::Configuration, + application__isnull: Option, + name__iexact: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_application__isnull = application__isnull; + let p_query_name__iexact = name__iexact; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/providers/ssf/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_application__isnull { + req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name__iexact { + req_builder = req_builder.query(&[("name__iexact", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedSsfProviderList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedSsfProviderList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SSFProvider Viewset +pub async fn providers_ssf_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_ssf_provider_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_ssf_provider_request = patched_ssf_provider_request; + + let uri_str = format!( + "{}/providers/ssf/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_ssf_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SsfProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SsfProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SSFProvider Viewset +pub async fn providers_ssf_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/ssf/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SsfProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SsfProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SSFProvider Viewset +pub async fn providers_ssf_update( + configuration: &configuration::Configuration, + id: i32, + ssf_provider_request: models::SsfProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_ssf_provider_request = ssf_provider_request; + + let uri_str = format!( + "{}/providers/ssf/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_ssf_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SsfProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SsfProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_ssf_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/ssf/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// WSFederationProvider Viewset +pub async fn providers_wsfed_create( + configuration: &configuration::Configuration, + ws_federation_provider_request: models::WsFederationProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_ws_federation_provider_request = ws_federation_provider_request; + + let uri_str = format!("{}/providers/wsfed/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_ws_federation_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::WsFederationProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::WsFederationProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// WSFederationProvider Viewset +pub async fn providers_wsfed_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/wsfed/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// WSFederationProvider Viewset +pub async fn providers_wsfed_list( + configuration: &configuration::Configuration, + acs_url: Option<&str>, + assertion_valid_not_before: Option<&str>, + assertion_valid_not_on_or_after: Option<&str>, + audience: Option<&str>, + authentication_flow: Option<&str>, + authn_context_class_ref_mapping: Option<&str>, + authorization_flow: Option<&str>, + backchannel_application: Option<&str>, + default_name_id_policy: Option<&str>, + default_relay_state: Option<&str>, + digest_algorithm: Option<&str>, + encryption_kp: Option<&str>, + invalidation_flow: Option<&str>, + is_backchannel: Option, + issuer: Option<&str>, + logout_method: Option<&str>, + name: Option<&str>, + name_id_mapping: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + property_mappings: Option>, + search: Option<&str>, + session_valid_not_on_or_after: Option<&str>, + sign_assertion: Option, + sign_logout_request: Option, + sign_logout_response: Option, + sign_response: Option, + signature_algorithm: Option<&str>, + signing_kp: Option<&str>, + sls_binding: Option<&str>, + sls_url: Option<&str>, + sp_binding: Option<&str>, + verification_kp: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_acs_url = acs_url; + let p_query_assertion_valid_not_before = assertion_valid_not_before; + let p_query_assertion_valid_not_on_or_after = assertion_valid_not_on_or_after; + let p_query_audience = audience; + let p_query_authentication_flow = authentication_flow; + let p_query_authn_context_class_ref_mapping = authn_context_class_ref_mapping; + let p_query_authorization_flow = authorization_flow; + let p_query_backchannel_application = backchannel_application; + let p_query_default_name_id_policy = default_name_id_policy; + let p_query_default_relay_state = default_relay_state; + let p_query_digest_algorithm = digest_algorithm; + let p_query_encryption_kp = encryption_kp; + let p_query_invalidation_flow = invalidation_flow; + let p_query_is_backchannel = is_backchannel; + let p_query_issuer = issuer; + let p_query_logout_method = logout_method; + let p_query_name = name; + let p_query_name_id_mapping = name_id_mapping; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_property_mappings = property_mappings; + let p_query_search = search; + let p_query_session_valid_not_on_or_after = session_valid_not_on_or_after; + let p_query_sign_assertion = sign_assertion; + let p_query_sign_logout_request = sign_logout_request; + let p_query_sign_logout_response = sign_logout_response; + let p_query_sign_response = sign_response; + let p_query_signature_algorithm = signature_algorithm; + let p_query_signing_kp = signing_kp; + let p_query_sls_binding = sls_binding; + let p_query_sls_url = sls_url; + let p_query_sp_binding = sp_binding; + let p_query_verification_kp = verification_kp; + + let uri_str = format!("{}/providers/wsfed/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_acs_url { + req_builder = req_builder.query(&[("acs_url", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_assertion_valid_not_before { + req_builder = + req_builder.query(&[("assertion_valid_not_before", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_assertion_valid_not_on_or_after { + req_builder = + req_builder.query(&[("assertion_valid_not_on_or_after", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_audience { + req_builder = req_builder.query(&[("audience", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_authentication_flow { + req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_authn_context_class_ref_mapping { + req_builder = + req_builder.query(&[("authn_context_class_ref_mapping", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_authorization_flow { + req_builder = req_builder.query(&[("authorization_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_backchannel_application { + req_builder = req_builder.query(&[("backchannel_application", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_default_name_id_policy { + req_builder = req_builder.query(&[("default_name_id_policy", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_default_relay_state { + req_builder = req_builder.query(&[("default_relay_state", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_digest_algorithm { + req_builder = req_builder.query(&[("digest_algorithm", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_encryption_kp { + req_builder = req_builder.query(&[("encryption_kp", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_invalidation_flow { + req_builder = req_builder.query(&[("invalidation_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_is_backchannel { + req_builder = req_builder.query(&[("is_backchannel", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_issuer { + req_builder = req_builder.query(&[("issuer", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_logout_method { + req_builder = req_builder.query(&[("logout_method", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name_id_mapping { + req_builder = req_builder.query(&[("name_id_mapping", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_property_mappings { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("property_mappings".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "property_mappings", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_session_valid_not_on_or_after { + req_builder = + req_builder.query(&[("session_valid_not_on_or_after", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sign_assertion { + req_builder = req_builder.query(&[("sign_assertion", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sign_logout_request { + req_builder = req_builder.query(&[("sign_logout_request", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sign_logout_response { + req_builder = req_builder.query(&[("sign_logout_response", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sign_response { + req_builder = req_builder.query(&[("sign_response", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_signature_algorithm { + req_builder = req_builder.query(&[("signature_algorithm", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_signing_kp { + req_builder = req_builder.query(&[("signing_kp", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sls_binding { + req_builder = req_builder.query(&[("sls_binding", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sls_url { + req_builder = req_builder.query(&[("sls_url", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sp_binding { + req_builder = req_builder.query(&[("sp_binding", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_verification_kp { + req_builder = req_builder.query(&[("verification_kp", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedWsFederationProviderList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedWsFederationProviderList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Return metadata as XML string +pub async fn providers_wsfed_metadata_retrieve( + configuration: &configuration::Configuration, + id: i32, + download: Option, + force_binding: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_query_download = download; + let p_query_force_binding = force_binding; + + let uri_str = format!( + "{}/providers/wsfed/{id}/metadata/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_download { + req_builder = req_builder.query(&[("download", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_force_binding { + req_builder = req_builder.query(&[("force_binding", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlMetadata`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlMetadata`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// WSFederationProvider Viewset +pub async fn providers_wsfed_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_ws_federation_provider_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_ws_federation_provider_request = patched_ws_federation_provider_request; + + let uri_str = format!( + "{}/providers/wsfed/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_ws_federation_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::WsFederationProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::WsFederationProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Preview user data for provider +pub async fn providers_wsfed_preview_user_retrieve( + configuration: &configuration::Configuration, + id: i32, + for_user: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_query_for_user = for_user; + + let uri_str = format!( + "{}/providers/wsfed/{id}/preview_user/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_for_user { + req_builder = req_builder.query(&[("for_user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PropertyMappingPreview`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PropertyMappingPreview`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// WSFederationProvider Viewset +pub async fn providers_wsfed_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/wsfed/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::WsFederationProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::WsFederationProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// WSFederationProvider Viewset +pub async fn providers_wsfed_update( + configuration: &configuration::Configuration, + id: i32, + ws_federation_provider_request: models::WsFederationProviderRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_ws_federation_provider_request = ws_federation_provider_request; + + let uri_str = format!( + "{}/providers/wsfed/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_ws_federation_provider_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::WsFederationProvider`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::WsFederationProvider`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn providers_wsfed_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/providers/wsfed/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/rac_api.rs b/packages/client-rust/src/apis/rac_api.rs new file mode 100644 index 0000000000..f7b51e46f3 --- /dev/null +++ b/packages/client-rust/src/apis/rac_api.rs @@ -0,0 +1,960 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`rac_connection_tokens_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RacConnectionTokensDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rac_connection_tokens_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RacConnectionTokensListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rac_connection_tokens_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RacConnectionTokensPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rac_connection_tokens_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RacConnectionTokensRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rac_connection_tokens_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RacConnectionTokensUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rac_connection_tokens_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RacConnectionTokensUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rac_endpoints_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RacEndpointsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rac_endpoints_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RacEndpointsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rac_endpoints_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RacEndpointsListError { + Status400(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rac_endpoints_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RacEndpointsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rac_endpoints_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RacEndpointsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rac_endpoints_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RacEndpointsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rac_endpoints_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RacEndpointsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// ConnectionToken Viewset +pub async fn rac_connection_tokens_destroy( + configuration: &configuration::Configuration, + connection_token_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connection_token_uuid = connection_token_uuid; + + let uri_str = format!( + "{}/rac/connection_tokens/{connection_token_uuid}/", + configuration.base_path, + connection_token_uuid = crate::apis::urlencode(p_path_connection_token_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ConnectionToken Viewset +pub async fn rac_connection_tokens_list( + configuration: &configuration::Configuration, + endpoint: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + provider: Option, + search: Option<&str>, + session__user: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_endpoint = endpoint; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_provider = provider; + let p_query_search = search; + let p_query_session__user = session__user; + + let uri_str = format!("{}/rac/connection_tokens/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_endpoint { + req_builder = req_builder.query(&[("endpoint", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_provider { + req_builder = req_builder.query(&[("provider", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_session__user { + req_builder = req_builder.query(&[("session__user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedConnectionTokenList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedConnectionTokenList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ConnectionToken Viewset +pub async fn rac_connection_tokens_partial_update( + configuration: &configuration::Configuration, + connection_token_uuid: &str, + patched_connection_token_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connection_token_uuid = connection_token_uuid; + let p_body_patched_connection_token_request = patched_connection_token_request; + + let uri_str = format!( + "{}/rac/connection_tokens/{connection_token_uuid}/", + configuration.base_path, + connection_token_uuid = crate::apis::urlencode(p_path_connection_token_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_connection_token_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ConnectionToken`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ConnectionToken`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ConnectionToken Viewset +pub async fn rac_connection_tokens_retrieve( + configuration: &configuration::Configuration, + connection_token_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connection_token_uuid = connection_token_uuid; + + let uri_str = format!( + "{}/rac/connection_tokens/{connection_token_uuid}/", + configuration.base_path, + connection_token_uuid = crate::apis::urlencode(p_path_connection_token_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ConnectionToken`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ConnectionToken`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ConnectionToken Viewset +pub async fn rac_connection_tokens_update( + configuration: &configuration::Configuration, + connection_token_uuid: &str, + connection_token_request: models::ConnectionTokenRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connection_token_uuid = connection_token_uuid; + let p_body_connection_token_request = connection_token_request; + + let uri_str = format!( + "{}/rac/connection_tokens/{connection_token_uuid}/", + configuration.base_path, + connection_token_uuid = crate::apis::urlencode(p_path_connection_token_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_connection_token_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ConnectionToken`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ConnectionToken`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn rac_connection_tokens_used_by_list( + configuration: &configuration::Configuration, + connection_token_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_connection_token_uuid = connection_token_uuid; + + let uri_str = format!( + "{}/rac/connection_tokens/{connection_token_uuid}/used_by/", + configuration.base_path, + connection_token_uuid = crate::apis::urlencode(p_path_connection_token_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Endpoint Viewset +pub async fn rac_endpoints_create( + configuration: &configuration::Configuration, + endpoint_request: models::EndpointRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_endpoint_request = endpoint_request; + + let uri_str = format!("{}/rac/endpoints/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_endpoint_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Endpoint`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Endpoint`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Endpoint Viewset +pub async fn rac_endpoints_destroy( + configuration: &configuration::Configuration, + pbm_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + + let uri_str = format!( + "{}/rac/endpoints/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// List accessible endpoints +pub async fn rac_endpoints_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + provider: Option, + search: Option<&str>, + superuser_full_list: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_provider = provider; + let p_query_search = search; + let p_query_superuser_full_list = superuser_full_list; + + let uri_str = format!("{}/rac/endpoints/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_provider { + req_builder = req_builder.query(&[("provider", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_superuser_full_list { + req_builder = req_builder.query(&[("superuser_full_list", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedEndpointList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedEndpointList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Endpoint Viewset +pub async fn rac_endpoints_partial_update( + configuration: &configuration::Configuration, + pbm_uuid: &str, + patched_endpoint_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + let p_body_patched_endpoint_request = patched_endpoint_request; + + let uri_str = format!( + "{}/rac/endpoints/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_endpoint_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Endpoint`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Endpoint`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Endpoint Viewset +pub async fn rac_endpoints_retrieve( + configuration: &configuration::Configuration, + pbm_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + + let uri_str = format!( + "{}/rac/endpoints/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Endpoint`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Endpoint`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Endpoint Viewset +pub async fn rac_endpoints_update( + configuration: &configuration::Configuration, + pbm_uuid: &str, + endpoint_request: models::EndpointRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + let p_body_endpoint_request = endpoint_request; + + let uri_str = format!( + "{}/rac/endpoints/{pbm_uuid}/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_endpoint_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Endpoint`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Endpoint`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn rac_endpoints_used_by_list( + configuration: &configuration::Configuration, + pbm_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_pbm_uuid = pbm_uuid; + + let uri_str = format!( + "{}/rac/endpoints/{pbm_uuid}/used_by/", + configuration.base_path, + pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/rbac_api.rs b/packages/client-rust/src/apis/rbac_api.rs new file mode 100644 index 0000000000..3a93dc9f78 --- /dev/null +++ b/packages/client-rust/src/apis/rbac_api.rs @@ -0,0 +1,1657 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`rbac_initial_permissions_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacInitialPermissionsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_initial_permissions_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacInitialPermissionsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_initial_permissions_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacInitialPermissionsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_initial_permissions_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacInitialPermissionsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_initial_permissions_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacInitialPermissionsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_initial_permissions_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacInitialPermissionsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_initial_permissions_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacInitialPermissionsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_permissions_assigned_by_roles_assign`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacPermissionsAssignedByRolesAssignError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_permissions_assigned_by_roles_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacPermissionsAssignedByRolesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_permissions_assigned_by_roles_unassign_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacPermissionsAssignedByRolesUnassignPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_permissions_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacPermissionsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_permissions_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacPermissionsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_permissions_roles_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacPermissionsRolesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_roles_add_user_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacRolesAddUserCreateError { + Status404(), + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_roles_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacRolesCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_roles_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacRolesDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_roles_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacRolesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_roles_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacRolesPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_roles_remove_user_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacRolesRemoveUserCreateError { + Status404(), + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_roles_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacRolesRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_roles_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacRolesUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`rbac_roles_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RbacRolesUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// InitialPermissions viewset +pub async fn rbac_initial_permissions_create( + configuration: &configuration::Configuration, + initial_permissions_request: models::InitialPermissionsRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_initial_permissions_request = initial_permissions_request; + + let uri_str = format!("{}/rbac/initial_permissions/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_initial_permissions_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::InitialPermissions`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::InitialPermissions`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// InitialPermissions viewset +pub async fn rbac_initial_permissions_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/rbac/initial_permissions/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// InitialPermissions viewset +pub async fn rbac_initial_permissions_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/rbac/initial_permissions/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedInitialPermissionsList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedInitialPermissionsList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// InitialPermissions viewset +pub async fn rbac_initial_permissions_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_initial_permissions_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_initial_permissions_request = patched_initial_permissions_request; + + let uri_str = format!( + "{}/rbac/initial_permissions/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_initial_permissions_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::InitialPermissions`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::InitialPermissions`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// InitialPermissions viewset +pub async fn rbac_initial_permissions_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/rbac/initial_permissions/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::InitialPermissions`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::InitialPermissions`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// InitialPermissions viewset +pub async fn rbac_initial_permissions_update( + configuration: &configuration::Configuration, + id: i32, + initial_permissions_request: models::InitialPermissionsRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_initial_permissions_request = initial_permissions_request; + + let uri_str = format!( + "{}/rbac/initial_permissions/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_initial_permissions_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::InitialPermissions`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::InitialPermissions`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn rbac_initial_permissions_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/rbac/initial_permissions/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Assign permission(s) to role. When `object_pk` is set, the permissions are only assigned to the +/// specific object, otherwise they are assigned globally. +pub async fn rbac_permissions_assigned_by_roles_assign( + configuration: &configuration::Configuration, + uuid: &str, + permission_assign_request: models::PermissionAssignRequest, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_permission_assign_request = permission_assign_request; + + let uri_str = format!( + "{}/rbac/permissions/assigned_by_roles/{uuid}/assign/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_permission_assign_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::PermissionAssignResult>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::PermissionAssignResult>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get assigned object permissions for a single object +pub async fn rbac_permissions_assigned_by_roles_list( + configuration: &configuration::Configuration, + model: &str, + object_pk: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result< + models::PaginatedRoleAssignedObjectPermissionList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_model = model; + let p_query_object_pk = object_pk; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!( + "{}/rbac/permissions/assigned_by_roles/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("model", &p_query_model.to_string())]); + if let Some(ref param_value) = p_query_object_pk { + req_builder = req_builder.query(&[("object_pk", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedRoleAssignedObjectPermissionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedRoleAssignedObjectPermissionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Unassign permission(s) to role. When `object_pk` is set, the permissions are only assigned to +/// the specific object, otherwise they are assigned globally. +pub async fn rbac_permissions_assigned_by_roles_unassign_partial_update( + configuration: &configuration::Configuration, + uuid: &str, + patched_permission_assign_request: Option, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_patched_permission_assign_request = patched_permission_assign_request; + + let uri_str = format!( + "{}/rbac/permissions/assigned_by_roles/{uuid}/unassign/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_permission_assign_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Read-only list of all permissions, filterable by model and app +pub async fn rbac_permissions_list( + configuration: &configuration::Configuration, + codename: Option<&str>, + content_type__app_label: Option<&str>, + content_type__model: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + role: Option<&str>, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_codename = codename; + let p_query_content_type__app_label = content_type__app_label; + let p_query_content_type__model = content_type__model; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_role = role; + let p_query_search = search; + + let uri_str = format!("{}/rbac/permissions/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_codename { + req_builder = req_builder.query(&[("codename", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_content_type__app_label { + req_builder = req_builder.query(&[("content_type__app_label", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_content_type__model { + req_builder = req_builder.query(&[("content_type__model", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_role { + req_builder = req_builder.query(&[("role", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedPermissionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedPermissionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Read-only list of all permissions, filterable by model and app +pub async fn rbac_permissions_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/rbac/permissions/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Permission`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Permission`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a role's assigned object permissions +pub async fn rbac_permissions_roles_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + uuid: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_uuid = uuid; + + let uri_str = format!("{}/rbac/permissions/roles/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_uuid { + req_builder = req_builder.query(&[("uuid", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedExtraRoleObjectPermissionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedExtraRoleObjectPermissionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Add user to role +pub async fn rbac_roles_add_user_create( + configuration: &configuration::Configuration, + uuid: &str, + user_account_serializer_for_role_request: models::UserAccountSerializerForRoleRequest, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_user_account_serializer_for_role_request = user_account_serializer_for_role_request; + + let uri_str = format!( + "{}/rbac/roles/{uuid}/add_user/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_account_serializer_for_role_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Role viewset +pub async fn rbac_roles_create( + configuration: &configuration::Configuration, + role_request: models::RoleRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_role_request = role_request; + + let uri_str = format!("{}/rbac/roles/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_role_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Role`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Role`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Role viewset +pub async fn rbac_roles_destroy( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/rbac/roles/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Role viewset +pub async fn rbac_roles_list( + configuration: &configuration::Configuration, + groups: Option<&str>, + inherited: Option, + managed: Option>, + managed__isnull: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + users: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_groups = groups; + let p_query_inherited = inherited; + let p_query_managed = managed; + let p_query_managed__isnull = managed__isnull; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_users = users; + + let uri_str = format!("{}/rbac/roles/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_groups { + req_builder = req_builder.query(&[("groups", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_inherited { + req_builder = req_builder.query(&[("inherited", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_managed { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("managed".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "managed", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_managed__isnull { + req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_users { + req_builder = req_builder.query(&[("users", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedRoleList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedRoleList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Role viewset +pub async fn rbac_roles_partial_update( + configuration: &configuration::Configuration, + uuid: &str, + patched_role_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_patched_role_request = patched_role_request; + + let uri_str = format!( + "{}/rbac/roles/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_role_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Role`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Role`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Remove user from role +pub async fn rbac_roles_remove_user_create( + configuration: &configuration::Configuration, + uuid: &str, + user_account_serializer_for_role_request: models::UserAccountSerializerForRoleRequest, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_user_account_serializer_for_role_request = user_account_serializer_for_role_request; + + let uri_str = format!( + "{}/rbac/roles/{uuid}/remove_user/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_account_serializer_for_role_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Role viewset +pub async fn rbac_roles_retrieve( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/rbac/roles/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Role`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Role`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Role viewset +pub async fn rbac_roles_update( + configuration: &configuration::Configuration, + uuid: &str, + role_request: models::RoleRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + let p_body_role_request = role_request; + + let uri_str = format!( + "{}/rbac/roles/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_role_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Role`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Role`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn rbac_roles_used_by_list( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/rbac/roles/{uuid}/used_by/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/reports_api.rs b/packages/client-rust/src/apis/reports_api.rs new file mode 100644 index 0000000000..0655cb3210 --- /dev/null +++ b/packages/client-rust/src/apis/reports_api.rs @@ -0,0 +1,215 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`reports_exports_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ReportsExportsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`reports_exports_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ReportsExportsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`reports_exports_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ReportsExportsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +pub async fn reports_exports_destroy( + configuration: &configuration::Configuration, + id: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/reports/exports/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn reports_exports_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/reports/exports/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedDataExportList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedDataExportList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn reports_exports_retrieve( + configuration: &configuration::Configuration, + id: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/reports/exports/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DataExport`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DataExport`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/root_api.rs b/packages/client-rust/src/apis/root_api.rs new file mode 100644 index 0000000000..1cf2a03057 --- /dev/null +++ b/packages/client-rust/src/apis/root_api.rs @@ -0,0 +1,75 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`root_config_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RootConfigRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// Retrieve public configuration options +pub async fn root_config_retrieve( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!("{}/root/config/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Config`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Config`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/schema_api.rs b/packages/client-rust/src/apis/schema_api.rs new file mode 100644 index 0000000000..b7049efc95 --- /dev/null +++ b/packages/client-rust/src/apis/schema_api.rs @@ -0,0 +1,88 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`schema_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SchemaRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: +/// application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json +pub async fn schema_retrieve( + configuration: &configuration::Configuration, + format: Option<&str>, + lang: Option<&str>, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_format = format; + let p_query_lang = lang; + + let uri_str = format!("{}/schema/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_format { + req_builder = req_builder.query(&[("format", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_lang { + req_builder = req_builder.query(&[("lang", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `std::collections::HashMap<String, serde_json::Value>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `std::collections::HashMap<String, serde_json::Value>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/sources_api.rs b/packages/client-rust/src/apis/sources_api.rs new file mode 100644 index 0000000000..f8222c576d --- /dev/null +++ b/packages/client-rust/src/apis/sources_api.rs @@ -0,0 +1,13146 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`sources_all_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesAllDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_all_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesAllListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_all_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesAllRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_all_types_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesAllTypesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_all_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesAllUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_all_user_settings_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesAllUserSettingsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_all_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsAllDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_all_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsAllListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_all_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsAllPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_all_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsAllRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_all_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsAllUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_all_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsAllUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_kerberos_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsKerberosCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_kerberos_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsKerberosDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_kerberos_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsKerberosListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_kerberos_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsKerberosPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_kerberos_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsKerberosRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_kerberos_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsKerberosUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_kerberos_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsKerberosUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_ldap_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsLdapCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_ldap_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsLdapDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_ldap_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsLdapListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_ldap_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsLdapPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_ldap_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsLdapRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_ldap_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsLdapUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_ldap_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsLdapUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_oauth_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsOauthCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_oauth_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsOauthDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_oauth_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsOauthListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_oauth_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsOauthPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_oauth_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsOauthRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_oauth_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsOauthUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_oauth_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsOauthUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_plex_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsPlexCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_plex_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsPlexDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_plex_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsPlexListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_plex_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsPlexPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_plex_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsPlexRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_plex_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsPlexUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_plex_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsPlexUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_saml_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsSamlCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_saml_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsSamlDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_saml_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsSamlListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_saml_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsSamlPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_saml_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsSamlRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_saml_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsSamlUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_saml_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsSamlUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_telegram_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsTelegramCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_telegram_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsTelegramDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_telegram_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsTelegramListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_telegram_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsTelegramPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_telegram_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsTelegramRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_telegram_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsTelegramUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_group_connections_telegram_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesGroupConnectionsTelegramUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_kerberos_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesKerberosCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_kerberos_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesKerberosDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_kerberos_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesKerberosListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_kerberos_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesKerberosPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_kerberos_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesKerberosRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_kerberos_sync_status_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesKerberosSyncStatusRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_kerberos_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesKerberosUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_kerberos_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesKerberosUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_ldap_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesLdapCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_ldap_debug_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesLdapDebugRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_ldap_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesLdapDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_ldap_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesLdapListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_ldap_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesLdapPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_ldap_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesLdapRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_ldap_sync_status_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesLdapSyncStatusRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_ldap_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesLdapUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_ldap_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesLdapUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_oauth_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesOauthCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_oauth_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesOauthDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_oauth_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesOauthListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_oauth_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesOauthPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_oauth_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesOauthRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_oauth_source_types_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesOauthSourceTypesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_oauth_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesOauthUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_oauth_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesOauthUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_plex_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesPlexCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_plex_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesPlexDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_plex_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesPlexListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_plex_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesPlexPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_plex_redeem_token_authenticated_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesPlexRedeemTokenAuthenticatedCreateError { + Status400(), + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_plex_redeem_token_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesPlexRedeemTokenCreateError { + Status400(), + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_plex_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesPlexRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_plex_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesPlexUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_plex_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesPlexUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_saml_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesSamlCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_saml_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesSamlDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_saml_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesSamlListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_saml_metadata_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesSamlMetadataRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_saml_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesSamlPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_saml_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesSamlRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_saml_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesSamlUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_saml_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesSamlUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_groups_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimGroupsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_groups_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimGroupsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_groups_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimGroupsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_groups_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimGroupsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_groups_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimGroupsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_groups_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimGroupsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_groups_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimGroupsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_users_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimUsersCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_users_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimUsersDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_users_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimUsersListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_users_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimUsersPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_users_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimUsersRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_users_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimUsersUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_scim_users_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesScimUsersUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_telegram_connect_user_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesTelegramConnectUserCreateError { + Status403(), + Status400(models::ValidationError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_telegram_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesTelegramCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_telegram_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesTelegramDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_telegram_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesTelegramListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_telegram_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesTelegramPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_telegram_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesTelegramRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_telegram_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesTelegramUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_telegram_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesTelegramUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_all_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsAllDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_all_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsAllListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_all_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsAllPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_all_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsAllRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_all_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsAllUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_all_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsAllUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_kerberos_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsKerberosCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_kerberos_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsKerberosDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_kerberos_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsKerberosListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_kerberos_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsKerberosPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_kerberos_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsKerberosRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_kerberos_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsKerberosUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_kerberos_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsKerberosUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_ldap_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsLdapCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_ldap_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsLdapDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_ldap_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsLdapListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_ldap_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsLdapPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_ldap_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsLdapRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_ldap_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsLdapUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_ldap_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsLdapUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_oauth_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsOauthCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_oauth_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsOauthDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_oauth_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsOauthListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_oauth_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsOauthPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_oauth_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsOauthRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_oauth_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsOauthUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_oauth_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsOauthUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_plex_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsPlexCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_plex_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsPlexDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_plex_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsPlexListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_plex_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsPlexPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_plex_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsPlexRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_plex_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsPlexUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_plex_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsPlexUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_saml_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsSamlCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_saml_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsSamlDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_saml_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsSamlListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_saml_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsSamlPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_saml_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsSamlRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_saml_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsSamlUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_saml_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsSamlUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_telegram_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsTelegramCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_telegram_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsTelegramDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_telegram_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsTelegramListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_telegram_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsTelegramPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_telegram_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsTelegramRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_telegram_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsTelegramUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`sources_user_connections_telegram_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SourcesUserConnectionsTelegramUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// Prevent deletion of built-in sources +pub async fn sources_all_destroy( + configuration: &configuration::Configuration, + slug: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/all/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Source Viewset +pub async fn sources_all_list( + configuration: &configuration::Configuration, + managed: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + pbm_uuid: Option<&str>, + search: Option<&str>, + slug: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_managed = managed; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_pbm_uuid = pbm_uuid; + let p_query_search = search; + let p_query_slug = slug; + + let uri_str = format!("{}/sources/all/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_managed { + req_builder = req_builder.query(&[("managed", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_pbm_uuid { + req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_slug { + req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedSourceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedSourceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Source Viewset +pub async fn sources_all_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/all/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Source`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Source`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all creatable types +pub async fn sources_all_types_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/sources/all/types/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_all_used_by_list( + configuration: &configuration::Configuration, + slug: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/all/{slug}/used_by/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all sources the user can configure +pub async fn sources_all_user_settings_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/sources/all/user_settings/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UserSetting>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UserSetting>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_all_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/all/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_all_list( + configuration: &configuration::Configuration, + group: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_query_group = group; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + + let uri_str = format!("{}/sources/group_connections/all/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_group { + req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGroupSourceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGroupSourceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_all_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_group_source_connection_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_group_source_connection_request = patched_group_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/all/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_group_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_all_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/all/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_all_update( + configuration: &configuration::Configuration, + id: i32, + group_source_connection_request: models::GroupSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_group_source_connection_request = group_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/all/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_group_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_group_connections_all_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/all/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_kerberos_create( + configuration: &configuration::Configuration, + group_kerberos_source_connection_request: models::GroupKerberosSourceConnectionRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_body_group_kerberos_source_connection_request = group_kerberos_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/kerberos/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_group_kerberos_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupKerberosSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupKerberosSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_kerberos_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/kerberos/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_kerberos_list( + configuration: &configuration::Configuration, + group: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, +) -> Result< + models::PaginatedGroupKerberosSourceConnectionList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_group = group; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + + let uri_str = format!( + "{}/sources/group_connections/kerberos/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_group { + req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGroupKerberosSourceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGroupKerberosSourceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_kerberos_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_group_kerberos_source_connection_request: Option< + models::PatchedGroupKerberosSourceConnectionRequest, + >, +) -> Result< + models::GroupKerberosSourceConnection, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_group_kerberos_source_connection_request = + patched_group_kerberos_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/kerberos/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_group_kerberos_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupKerberosSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupKerberosSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_kerberos_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result< + models::GroupKerberosSourceConnection, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/kerberos/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupKerberosSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupKerberosSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_kerberos_update( + configuration: &configuration::Configuration, + id: i32, + group_kerberos_source_connection_request: models::GroupKerberosSourceConnectionRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_group_kerberos_source_connection_request = group_kerberos_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/kerberos/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_group_kerberos_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupKerberosSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupKerberosSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_group_connections_kerberos_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/kerberos/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_ldap_create( + configuration: &configuration::Configuration, + group_ldap_source_connection_request: models::GroupLdapSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_group_ldap_source_connection_request = group_ldap_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/ldap/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_group_ldap_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupLdapSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupLdapSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_ldap_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/ldap/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_ldap_list( + configuration: &configuration::Configuration, + group: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, +) -> Result< + models::PaginatedGroupLdapSourceConnectionList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_group = group; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + + let uri_str = format!( + "{}/sources/group_connections/ldap/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_group { + req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGroupLdapSourceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGroupLdapSourceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_ldap_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_group_ldap_source_connection_request: Option< + models::PatchedGroupLdapSourceConnectionRequest, + >, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_group_ldap_source_connection_request = + patched_group_ldap_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/ldap/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_group_ldap_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupLdapSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupLdapSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_ldap_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/ldap/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupLdapSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupLdapSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_ldap_update( + configuration: &configuration::Configuration, + id: i32, + group_ldap_source_connection_request: models::GroupLdapSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_group_ldap_source_connection_request = group_ldap_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/ldap/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_group_ldap_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupLdapSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupLdapSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_group_connections_ldap_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/ldap/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_oauth_create( + configuration: &configuration::Configuration, + group_o_auth_source_connection_request: models::GroupOAuthSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_group_o_auth_source_connection_request = group_o_auth_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/oauth/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_group_o_auth_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupOAuthSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupOAuthSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_oauth_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/oauth/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_oauth_list( + configuration: &configuration::Configuration, + group: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, +) -> Result< + models::PaginatedGroupOAuthSourceConnectionList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_group = group; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + + let uri_str = format!( + "{}/sources/group_connections/oauth/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_group { + req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGroupOAuthSourceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGroupOAuthSourceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_oauth_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_group_o_auth_source_connection_request: Option< + models::PatchedGroupOAuthSourceConnectionRequest, + >, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_group_o_auth_source_connection_request = + patched_group_o_auth_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/oauth/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_group_o_auth_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupOAuthSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupOAuthSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_oauth_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/oauth/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupOAuthSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupOAuthSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_oauth_update( + configuration: &configuration::Configuration, + id: i32, + group_o_auth_source_connection_request: models::GroupOAuthSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_group_o_auth_source_connection_request = group_o_auth_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/oauth/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_group_o_auth_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupOAuthSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupOAuthSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_group_connections_oauth_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/oauth/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_plex_create( + configuration: &configuration::Configuration, + group_plex_source_connection_request: models::GroupPlexSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_group_plex_source_connection_request = group_plex_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/plex/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_group_plex_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupPlexSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupPlexSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_plex_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/plex/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_plex_list( + configuration: &configuration::Configuration, + group: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, +) -> Result< + models::PaginatedGroupPlexSourceConnectionList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_group = group; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + + let uri_str = format!( + "{}/sources/group_connections/plex/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_group { + req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGroupPlexSourceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGroupPlexSourceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_plex_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_group_plex_source_connection_request: Option< + models::PatchedGroupPlexSourceConnectionRequest, + >, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_group_plex_source_connection_request = + patched_group_plex_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/plex/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_group_plex_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupPlexSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupPlexSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_plex_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/plex/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupPlexSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupPlexSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_plex_update( + configuration: &configuration::Configuration, + id: i32, + group_plex_source_connection_request: models::GroupPlexSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_group_plex_source_connection_request = group_plex_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/plex/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_group_plex_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupPlexSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupPlexSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_group_connections_plex_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/plex/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_saml_create( + configuration: &configuration::Configuration, + group_saml_source_connection_request: models::GroupSamlSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_group_saml_source_connection_request = group_saml_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/saml/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_group_saml_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupSamlSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupSamlSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_saml_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/saml/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_saml_list( + configuration: &configuration::Configuration, + group: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, +) -> Result< + models::PaginatedGroupSamlSourceConnectionList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_group = group; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + + let uri_str = format!( + "{}/sources/group_connections/saml/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_group { + req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGroupSamlSourceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGroupSamlSourceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_saml_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_group_saml_source_connection_request: Option< + models::PatchedGroupSamlSourceConnectionRequest, + >, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_group_saml_source_connection_request = + patched_group_saml_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/saml/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_group_saml_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupSamlSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupSamlSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_saml_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/saml/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupSamlSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupSamlSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_saml_update( + configuration: &configuration::Configuration, + id: i32, + group_saml_source_connection_request: models::GroupSamlSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_group_saml_source_connection_request = group_saml_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/saml/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_group_saml_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupSamlSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupSamlSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_group_connections_saml_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/saml/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_telegram_create( + configuration: &configuration::Configuration, + group_telegram_source_connection_request: models::GroupTelegramSourceConnectionRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_body_group_telegram_source_connection_request = group_telegram_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/telegram/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_group_telegram_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupTelegramSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupTelegramSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_telegram_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/telegram/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_telegram_list( + configuration: &configuration::Configuration, + group: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, +) -> Result< + models::PaginatedGroupTelegramSourceConnectionList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_group = group; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + + let uri_str = format!( + "{}/sources/group_connections/telegram/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_group { + req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedGroupTelegramSourceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedGroupTelegramSourceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_telegram_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_group_telegram_source_connection_request: Option< + models::PatchedGroupTelegramSourceConnectionRequest, + >, +) -> Result< + models::GroupTelegramSourceConnection, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_group_telegram_source_connection_request = + patched_group_telegram_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/telegram/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_group_telegram_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupTelegramSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupTelegramSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_telegram_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result< + models::GroupTelegramSourceConnection, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/telegram/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupTelegramSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupTelegramSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Group-source connection Viewset +pub async fn sources_group_connections_telegram_update( + configuration: &configuration::Configuration, + id: i32, + group_telegram_source_connection_request: models::GroupTelegramSourceConnectionRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_group_telegram_source_connection_request = group_telegram_source_connection_request; + + let uri_str = format!( + "{}/sources/group_connections/telegram/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_group_telegram_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GroupTelegramSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GroupTelegramSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_group_connections_telegram_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/group_connections/telegram/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Kerberos Source Viewset +pub async fn sources_kerberos_create( + configuration: &configuration::Configuration, + kerberos_source_request: models::KerberosSourceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_kerberos_source_request = kerberos_source_request; + + let uri_str = format!("{}/sources/kerberos/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_kerberos_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::KerberosSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::KerberosSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Kerberos Source Viewset +pub async fn sources_kerberos_destroy( + configuration: &configuration::Configuration, + slug: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/kerberos/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Kerberos Source Viewset +pub async fn sources_kerberos_list( + configuration: &configuration::Configuration, + enabled: Option, + kadmin_type: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + password_login_update_internal_password: Option, + pbm_uuid: Option<&str>, + realm: Option<&str>, + search: Option<&str>, + slug: Option<&str>, + spnego_server_name: Option<&str>, + sync_principal: Option<&str>, + sync_users: Option, + sync_users_password: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_enabled = enabled; + let p_query_kadmin_type = kadmin_type; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_password_login_update_internal_password = password_login_update_internal_password; + let p_query_pbm_uuid = pbm_uuid; + let p_query_realm = realm; + let p_query_search = search; + let p_query_slug = slug; + let p_query_spnego_server_name = spnego_server_name; + let p_query_sync_principal = sync_principal; + let p_query_sync_users = sync_users; + let p_query_sync_users_password = sync_users_password; + + let uri_str = format!("{}/sources/kerberos/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_enabled { + req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_kadmin_type { + req_builder = req_builder.query(&[("kadmin_type", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_password_login_update_internal_password { + req_builder = req_builder.query(&[( + "password_login_update_internal_password", + ¶m_value.to_string(), + )]); + } + if let Some(ref param_value) = p_query_pbm_uuid { + req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_realm { + req_builder = req_builder.query(&[("realm", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_slug { + req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_spnego_server_name { + req_builder = req_builder.query(&[("spnego_server_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sync_principal { + req_builder = req_builder.query(&[("sync_principal", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sync_users { + req_builder = req_builder.query(&[("sync_users", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sync_users_password { + req_builder = req_builder.query(&[("sync_users_password", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedKerberosSourceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedKerberosSourceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Kerberos Source Viewset +pub async fn sources_kerberos_partial_update( + configuration: &configuration::Configuration, + slug: &str, + patched_kerberos_source_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_patched_kerberos_source_request = patched_kerberos_source_request; + + let uri_str = format!( + "{}/sources/kerberos/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_kerberos_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::KerberosSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::KerberosSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Kerberos Source Viewset +pub async fn sources_kerberos_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/kerberos/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::KerberosSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::KerberosSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get provider's sync status +pub async fn sources_kerberos_sync_status_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/kerberos/{slug}/sync/status/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SyncStatus`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SyncStatus`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Kerberos Source Viewset +pub async fn sources_kerberos_update( + configuration: &configuration::Configuration, + slug: &str, + kerberos_source_request: models::KerberosSourceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_kerberos_source_request = kerberos_source_request; + + let uri_str = format!( + "{}/sources/kerberos/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_kerberos_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::KerberosSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::KerberosSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_kerberos_used_by_list( + configuration: &configuration::Configuration, + slug: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/kerberos/{slug}/used_by/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAP Source Viewset +pub async fn sources_ldap_create( + configuration: &configuration::Configuration, + ldap_source_request: models::LdapSourceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_ldap_source_request = ldap_source_request; + + let uri_str = format!("{}/sources/ldap/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_ldap_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LdapSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LdapSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get raw LDAP data to debug +pub async fn sources_ldap_debug_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/ldap/{slug}/debug/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LdapDebug`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LdapDebug`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAP Source Viewset +pub async fn sources_ldap_destroy( + configuration: &configuration::Configuration, + slug: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/ldap/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAP Source Viewset +pub async fn sources_ldap_list( + configuration: &configuration::Configuration, + additional_group_dn: Option<&str>, + additional_user_dn: Option<&str>, + base_dn: Option<&str>, + bind_cn: Option<&str>, + client_certificate: Option<&str>, + delete_not_found_objects: Option, + enabled: Option, + group_membership_field: Option<&str>, + group_object_filter: Option<&str>, + group_property_mappings: Option>, + lookup_groups_from_user: Option, + name: Option<&str>, + object_uniqueness_field: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + password_login_update_internal_password: Option, + pbm_uuid: Option<&str>, + peer_certificate: Option<&str>, + search: Option<&str>, + server_uri: Option<&str>, + slug: Option<&str>, + sni: Option, + start_tls: Option, + sync_groups: Option, + sync_parent_group: Option<&str>, + sync_users: Option, + sync_users_password: Option, + user_membership_attribute: Option<&str>, + user_object_filter: Option<&str>, + user_property_mappings: Option>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_additional_group_dn = additional_group_dn; + let p_query_additional_user_dn = additional_user_dn; + let p_query_base_dn = base_dn; + let p_query_bind_cn = bind_cn; + let p_query_client_certificate = client_certificate; + let p_query_delete_not_found_objects = delete_not_found_objects; + let p_query_enabled = enabled; + let p_query_group_membership_field = group_membership_field; + let p_query_group_object_filter = group_object_filter; + let p_query_group_property_mappings = group_property_mappings; + let p_query_lookup_groups_from_user = lookup_groups_from_user; + let p_query_name = name; + let p_query_object_uniqueness_field = object_uniqueness_field; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_password_login_update_internal_password = password_login_update_internal_password; + let p_query_pbm_uuid = pbm_uuid; + let p_query_peer_certificate = peer_certificate; + let p_query_search = search; + let p_query_server_uri = server_uri; + let p_query_slug = slug; + let p_query_sni = sni; + let p_query_start_tls = start_tls; + let p_query_sync_groups = sync_groups; + let p_query_sync_parent_group = sync_parent_group; + let p_query_sync_users = sync_users; + let p_query_sync_users_password = sync_users_password; + let p_query_user_membership_attribute = user_membership_attribute; + let p_query_user_object_filter = user_object_filter; + let p_query_user_property_mappings = user_property_mappings; + + let uri_str = format!("{}/sources/ldap/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_additional_group_dn { + req_builder = req_builder.query(&[("additional_group_dn", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_additional_user_dn { + req_builder = req_builder.query(&[("additional_user_dn", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_base_dn { + req_builder = req_builder.query(&[("base_dn", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_bind_cn { + req_builder = req_builder.query(&[("bind_cn", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_client_certificate { + req_builder = req_builder.query(&[("client_certificate", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_delete_not_found_objects { + req_builder = req_builder.query(&[("delete_not_found_objects", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_enabled { + req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_group_membership_field { + req_builder = req_builder.query(&[("group_membership_field", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_group_object_filter { + req_builder = req_builder.query(&[("group_object_filter", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_group_property_mappings { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("group_property_mappings".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "group_property_mappings", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_lookup_groups_from_user { + req_builder = req_builder.query(&[("lookup_groups_from_user", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_object_uniqueness_field { + req_builder = req_builder.query(&[("object_uniqueness_field", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_password_login_update_internal_password { + req_builder = req_builder.query(&[( + "password_login_update_internal_password", + ¶m_value.to_string(), + )]); + } + if let Some(ref param_value) = p_query_pbm_uuid { + req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_peer_certificate { + req_builder = req_builder.query(&[("peer_certificate", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_server_uri { + req_builder = req_builder.query(&[("server_uri", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_slug { + req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sni { + req_builder = req_builder.query(&[("sni", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_start_tls { + req_builder = req_builder.query(&[("start_tls", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sync_groups { + req_builder = req_builder.query(&[("sync_groups", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sync_parent_group { + req_builder = req_builder.query(&[("sync_parent_group", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sync_users { + req_builder = req_builder.query(&[("sync_users", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sync_users_password { + req_builder = req_builder.query(&[("sync_users_password", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user_membership_attribute { + req_builder = req_builder.query(&[("user_membership_attribute", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user_object_filter { + req_builder = req_builder.query(&[("user_object_filter", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user_property_mappings { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("user_property_mappings".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "user_property_mappings", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedLdapSourceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedLdapSourceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAP Source Viewset +pub async fn sources_ldap_partial_update( + configuration: &configuration::Configuration, + slug: &str, + patched_ldap_source_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_patched_ldap_source_request = patched_ldap_source_request; + + let uri_str = format!( + "{}/sources/ldap/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_ldap_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LdapSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LdapSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAP Source Viewset +pub async fn sources_ldap_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/ldap/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LdapSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LdapSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get provider's sync status +pub async fn sources_ldap_sync_status_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/ldap/{slug}/sync/status/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SyncStatus`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SyncStatus`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// LDAP Source Viewset +pub async fn sources_ldap_update( + configuration: &configuration::Configuration, + slug: &str, + ldap_source_request: models::LdapSourceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_ldap_source_request = ldap_source_request; + + let uri_str = format!( + "{}/sources/ldap/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_ldap_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::LdapSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::LdapSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_ldap_used_by_list( + configuration: &configuration::Configuration, + slug: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/ldap/{slug}/used_by/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Source Viewset +pub async fn sources_oauth_create( + configuration: &configuration::Configuration, + o_auth_source_request: models::OAuthSourceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_o_auth_source_request = o_auth_source_request; + + let uri_str = format!("{}/sources/oauth/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_o_auth_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::OAuthSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::OAuthSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Source Viewset +pub async fn sources_oauth_destroy( + configuration: &configuration::Configuration, + slug: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/oauth/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Source Viewset +pub async fn sources_oauth_list( + configuration: &configuration::Configuration, + access_token_url: Option<&str>, + additional_scopes: Option<&str>, + authentication_flow: Option<&str>, + authorization_url: Option<&str>, + consumer_key: Option<&str>, + enabled: Option, + enrollment_flow: Option<&str>, + group_matching_mode: Option<&str>, + has_jwks: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + pbm_uuid: Option<&str>, + policy_engine_mode: Option<&str>, + profile_url: Option<&str>, + provider_type: Option<&str>, + request_token_url: Option<&str>, + search: Option<&str>, + slug: Option<&str>, + user_matching_mode: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_access_token_url = access_token_url; + let p_query_additional_scopes = additional_scopes; + let p_query_authentication_flow = authentication_flow; + let p_query_authorization_url = authorization_url; + let p_query_consumer_key = consumer_key; + let p_query_enabled = enabled; + let p_query_enrollment_flow = enrollment_flow; + let p_query_group_matching_mode = group_matching_mode; + let p_query_has_jwks = has_jwks; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_pbm_uuid = pbm_uuid; + let p_query_policy_engine_mode = policy_engine_mode; + let p_query_profile_url = profile_url; + let p_query_provider_type = provider_type; + let p_query_request_token_url = request_token_url; + let p_query_search = search; + let p_query_slug = slug; + let p_query_user_matching_mode = user_matching_mode; + + let uri_str = format!("{}/sources/oauth/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_access_token_url { + req_builder = req_builder.query(&[("access_token_url", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_additional_scopes { + req_builder = req_builder.query(&[("additional_scopes", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_authentication_flow { + req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_authorization_url { + req_builder = req_builder.query(&[("authorization_url", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_consumer_key { + req_builder = req_builder.query(&[("consumer_key", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_enabled { + req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_enrollment_flow { + req_builder = req_builder.query(&[("enrollment_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_group_matching_mode { + req_builder = req_builder.query(&[("group_matching_mode", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_has_jwks { + req_builder = req_builder.query(&[("has_jwks", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_pbm_uuid { + req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policy_engine_mode { + req_builder = req_builder.query(&[("policy_engine_mode", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_profile_url { + req_builder = req_builder.query(&[("profile_url", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_provider_type { + req_builder = req_builder.query(&[("provider_type", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_request_token_url { + req_builder = req_builder.query(&[("request_token_url", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_slug { + req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user_matching_mode { + req_builder = req_builder.query(&[("user_matching_mode", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedOAuthSourceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedOAuthSourceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Source Viewset +pub async fn sources_oauth_partial_update( + configuration: &configuration::Configuration, + slug: &str, + patched_o_auth_source_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_patched_o_auth_source_request = patched_o_auth_source_request; + + let uri_str = format!( + "{}/sources/oauth/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_o_auth_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::OAuthSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::OAuthSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Source Viewset +pub async fn sources_oauth_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/oauth/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::OAuthSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::OAuthSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all creatable source types. If ?name is set, only returns the type for . If +/// isn't found, returns the default type. +pub async fn sources_oauth_source_types_list( + configuration: &configuration::Configuration, + name: Option<&str>, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + + let uri_str = format!("{}/sources/oauth/source_types/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::SourceType>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::SourceType>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Source Viewset +pub async fn sources_oauth_update( + configuration: &configuration::Configuration, + slug: &str, + o_auth_source_request: models::OAuthSourceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_o_auth_source_request = o_auth_source_request; + + let uri_str = format!( + "{}/sources/oauth/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_o_auth_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::OAuthSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::OAuthSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_oauth_used_by_list( + configuration: &configuration::Configuration, + slug: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/oauth/{slug}/used_by/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Plex source Viewset +pub async fn sources_plex_create( + configuration: &configuration::Configuration, + plex_source_request: models::PlexSourceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_plex_source_request = plex_source_request; + + let uri_str = format!("{}/sources/plex/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_plex_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PlexSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PlexSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Plex source Viewset +pub async fn sources_plex_destroy( + configuration: &configuration::Configuration, + slug: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/plex/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Plex source Viewset +pub async fn sources_plex_list( + configuration: &configuration::Configuration, + allow_friends: Option, + authentication_flow: Option<&str>, + client_id: Option<&str>, + enabled: Option, + enrollment_flow: Option<&str>, + group_matching_mode: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + pbm_uuid: Option<&str>, + policy_engine_mode: Option<&str>, + search: Option<&str>, + slug: Option<&str>, + user_matching_mode: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_allow_friends = allow_friends; + let p_query_authentication_flow = authentication_flow; + let p_query_client_id = client_id; + let p_query_enabled = enabled; + let p_query_enrollment_flow = enrollment_flow; + let p_query_group_matching_mode = group_matching_mode; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_pbm_uuid = pbm_uuid; + let p_query_policy_engine_mode = policy_engine_mode; + let p_query_search = search; + let p_query_slug = slug; + let p_query_user_matching_mode = user_matching_mode; + + let uri_str = format!("{}/sources/plex/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_allow_friends { + req_builder = req_builder.query(&[("allow_friends", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_authentication_flow { + req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_client_id { + req_builder = req_builder.query(&[("client_id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_enabled { + req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_enrollment_flow { + req_builder = req_builder.query(&[("enrollment_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_group_matching_mode { + req_builder = req_builder.query(&[("group_matching_mode", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_pbm_uuid { + req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policy_engine_mode { + req_builder = req_builder.query(&[("policy_engine_mode", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_slug { + req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user_matching_mode { + req_builder = req_builder.query(&[("user_matching_mode", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedPlexSourceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedPlexSourceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Plex source Viewset +pub async fn sources_plex_partial_update( + configuration: &configuration::Configuration, + slug: &str, + patched_plex_source_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_patched_plex_source_request = patched_plex_source_request; + + let uri_str = format!( + "{}/sources/plex/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_plex_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PlexSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PlexSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Redeem a plex token for an authenticated user, creating a connection +pub async fn sources_plex_redeem_token_authenticated_create( + configuration: &configuration::Configuration, + plex_token_redeem_request: models::PlexTokenRedeemRequest, + slug: Option<&str>, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_plex_token_redeem_request = plex_token_redeem_request; + let p_query_slug = slug; + + let uri_str = format!( + "{}/sources/plex/redeem_token_authenticated/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref param_value) = p_query_slug { + req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_plex_token_redeem_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Redeem a plex token, check it's access to resources against what's allowed for the source, and +/// redirect to an authentication/enrollment flow. +pub async fn sources_plex_redeem_token_create( + configuration: &configuration::Configuration, + plex_token_redeem_request: models::PlexTokenRedeemRequest, + slug: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_plex_token_redeem_request = plex_token_redeem_request; + let p_query_slug = slug; + + let uri_str = format!("{}/sources/plex/redeem_token/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref param_value) = p_query_slug { + req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_plex_token_redeem_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RedirectChallenge`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RedirectChallenge`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Plex source Viewset +pub async fn sources_plex_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/plex/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PlexSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PlexSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Plex source Viewset +pub async fn sources_plex_update( + configuration: &configuration::Configuration, + slug: &str, + plex_source_request: models::PlexSourceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_plex_source_request = plex_source_request; + + let uri_str = format!( + "{}/sources/plex/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_plex_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PlexSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PlexSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_plex_used_by_list( + configuration: &configuration::Configuration, + slug: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/plex/{slug}/used_by/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLSource Viewset +pub async fn sources_saml_create( + configuration: &configuration::Configuration, + saml_source_request: models::SamlSourceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_saml_source_request = saml_source_request; + + let uri_str = format!("{}/sources/saml/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_saml_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLSource Viewset +pub async fn sources_saml_destroy( + configuration: &configuration::Configuration, + slug: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/saml/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLSource Viewset +pub async fn sources_saml_list( + configuration: &configuration::Configuration, + allow_idp_initiated: Option, + authentication_flow: Option<&str>, + binding_type: Option<&str>, + digest_algorithm: Option<&str>, + enabled: Option, + enrollment_flow: Option<&str>, + issuer: Option<&str>, + managed: Option<&str>, + name: Option<&str>, + name_id_policy: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + pbm_uuid: Option<&str>, + policy_engine_mode: Option<&str>, + pre_authentication_flow: Option<&str>, + search: Option<&str>, + signature_algorithm: Option<&str>, + signed_assertion: Option, + signed_response: Option, + signing_kp: Option<&str>, + slo_url: Option<&str>, + slug: Option<&str>, + sso_url: Option<&str>, + temporary_user_delete_after: Option<&str>, + user_matching_mode: Option<&str>, + verification_kp: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_allow_idp_initiated = allow_idp_initiated; + let p_query_authentication_flow = authentication_flow; + let p_query_binding_type = binding_type; + let p_query_digest_algorithm = digest_algorithm; + let p_query_enabled = enabled; + let p_query_enrollment_flow = enrollment_flow; + let p_query_issuer = issuer; + let p_query_managed = managed; + let p_query_name = name; + let p_query_name_id_policy = name_id_policy; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_pbm_uuid = pbm_uuid; + let p_query_policy_engine_mode = policy_engine_mode; + let p_query_pre_authentication_flow = pre_authentication_flow; + let p_query_search = search; + let p_query_signature_algorithm = signature_algorithm; + let p_query_signed_assertion = signed_assertion; + let p_query_signed_response = signed_response; + let p_query_signing_kp = signing_kp; + let p_query_slo_url = slo_url; + let p_query_slug = slug; + let p_query_sso_url = sso_url; + let p_query_temporary_user_delete_after = temporary_user_delete_after; + let p_query_user_matching_mode = user_matching_mode; + let p_query_verification_kp = verification_kp; + + let uri_str = format!("{}/sources/saml/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_allow_idp_initiated { + req_builder = req_builder.query(&[("allow_idp_initiated", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_authentication_flow { + req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_binding_type { + req_builder = req_builder.query(&[("binding_type", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_digest_algorithm { + req_builder = req_builder.query(&[("digest_algorithm", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_enabled { + req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_enrollment_flow { + req_builder = req_builder.query(&[("enrollment_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_issuer { + req_builder = req_builder.query(&[("issuer", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_managed { + req_builder = req_builder.query(&[("managed", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name_id_policy { + req_builder = req_builder.query(&[("name_id_policy", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_pbm_uuid { + req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policy_engine_mode { + req_builder = req_builder.query(&[("policy_engine_mode", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_pre_authentication_flow { + req_builder = req_builder.query(&[("pre_authentication_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_signature_algorithm { + req_builder = req_builder.query(&[("signature_algorithm", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_signed_assertion { + req_builder = req_builder.query(&[("signed_assertion", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_signed_response { + req_builder = req_builder.query(&[("signed_response", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_signing_kp { + req_builder = req_builder.query(&[("signing_kp", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_slo_url { + req_builder = req_builder.query(&[("slo_url", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_slug { + req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_sso_url { + req_builder = req_builder.query(&[("sso_url", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_temporary_user_delete_after { + req_builder = + req_builder.query(&[("temporary_user_delete_after", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user_matching_mode { + req_builder = req_builder.query(&[("user_matching_mode", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_verification_kp { + req_builder = req_builder.query(&[("verification_kp", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedSamlSourceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedSamlSourceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Return metadata as XML string +pub async fn sources_saml_metadata_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/saml/{slug}/metadata/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlMetadata`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlMetadata`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLSource Viewset +pub async fn sources_saml_partial_update( + configuration: &configuration::Configuration, + slug: &str, + patched_saml_source_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_patched_saml_source_request = patched_saml_source_request; + + let uri_str = format!( + "{}/sources/saml/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_saml_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLSource Viewset +pub async fn sources_saml_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/saml/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SAMLSource Viewset +pub async fn sources_saml_update( + configuration: &configuration::Configuration, + slug: &str, + saml_source_request: models::SamlSourceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_saml_source_request = saml_source_request; + + let uri_str = format!( + "{}/sources/saml/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_saml_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SamlSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SamlSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_saml_used_by_list( + configuration: &configuration::Configuration, + slug: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/saml/{slug}/used_by/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSource Viewset +pub async fn sources_scim_create( + configuration: &configuration::Configuration, + scim_source_request: models::ScimSourceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_scim_source_request = scim_source_request; + + let uri_str = format!("{}/sources/scim/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scim_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSource Viewset +pub async fn sources_scim_destroy( + configuration: &configuration::Configuration, + slug: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/scim/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourceGroup Viewset +pub async fn sources_scim_groups_create( + configuration: &configuration::Configuration, + scim_source_group_request: models::ScimSourceGroupRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_scim_source_group_request = scim_source_group_request; + + let uri_str = format!("{}/sources/scim_groups/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scim_source_group_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSourceGroup`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSourceGroup`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourceGroup Viewset +pub async fn sources_scim_groups_destroy( + configuration: &configuration::Configuration, + id: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/scim_groups/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourceGroup Viewset +pub async fn sources_scim_groups_list( + configuration: &configuration::Configuration, + group__group_uuid: Option<&str>, + group__name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_group__group_uuid = group__group_uuid; + let p_query_group__name = group__name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + + let uri_str = format!("{}/sources/scim_groups/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_group__group_uuid { + req_builder = req_builder.query(&[("group__group_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_group__name { + req_builder = req_builder.query(&[("group__name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedScimSourceGroupList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedScimSourceGroupList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourceGroup Viewset +pub async fn sources_scim_groups_partial_update( + configuration: &configuration::Configuration, + id: &str, + patched_scim_source_group_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_scim_source_group_request = patched_scim_source_group_request; + + let uri_str = format!( + "{}/sources/scim_groups/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_scim_source_group_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSourceGroup`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSourceGroup`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourceGroup Viewset +pub async fn sources_scim_groups_retrieve( + configuration: &configuration::Configuration, + id: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/scim_groups/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSourceGroup`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSourceGroup`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourceGroup Viewset +pub async fn sources_scim_groups_update( + configuration: &configuration::Configuration, + id: &str, + scim_source_group_request: models::ScimSourceGroupRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_scim_source_group_request = scim_source_group_request; + + let uri_str = format!( + "{}/sources/scim_groups/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scim_source_group_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSourceGroup`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSourceGroup`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_scim_groups_used_by_list( + configuration: &configuration::Configuration, + id: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/scim_groups/{id}/used_by/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSource Viewset +pub async fn sources_scim_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + pbm_uuid: Option<&str>, + search: Option<&str>, + slug: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_pbm_uuid = pbm_uuid; + let p_query_search = search; + let p_query_slug = slug; + + let uri_str = format!("{}/sources/scim/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_pbm_uuid { + req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_slug { + req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedScimSourceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedScimSourceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSource Viewset +pub async fn sources_scim_partial_update( + configuration: &configuration::Configuration, + slug: &str, + patched_scim_source_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_patched_scim_source_request = patched_scim_source_request; + + let uri_str = format!( + "{}/sources/scim/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_scim_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSource Viewset +pub async fn sources_scim_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/scim/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSource Viewset +pub async fn sources_scim_update( + configuration: &configuration::Configuration, + slug: &str, + scim_source_request: models::ScimSourceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_scim_source_request = scim_source_request; + + let uri_str = format!( + "{}/sources/scim/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scim_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_scim_used_by_list( + configuration: &configuration::Configuration, + slug: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/scim/{slug}/used_by/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourceUser Viewset +pub async fn sources_scim_users_create( + configuration: &configuration::Configuration, + scim_source_user_request: models::ScimSourceUserRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_scim_source_user_request = scim_source_user_request; + + let uri_str = format!("{}/sources/scim_users/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scim_source_user_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSourceUser`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSourceUser`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourceUser Viewset +pub async fn sources_scim_users_destroy( + configuration: &configuration::Configuration, + id: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/scim_users/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourceUser Viewset +pub async fn sources_scim_users_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, + user__id: Option, + user__username: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + let p_query_user__id = user__id; + let p_query_user__username = user__username; + + let uri_str = format!("{}/sources/scim_users/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user__id { + req_builder = req_builder.query(&[("user__id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user__username { + req_builder = req_builder.query(&[("user__username", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedScimSourceUserList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedScimSourceUserList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourceUser Viewset +pub async fn sources_scim_users_partial_update( + configuration: &configuration::Configuration, + id: &str, + patched_scim_source_user_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_scim_source_user_request = patched_scim_source_user_request; + + let uri_str = format!( + "{}/sources/scim_users/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_scim_source_user_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSourceUser`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSourceUser`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourceUser Viewset +pub async fn sources_scim_users_retrieve( + configuration: &configuration::Configuration, + id: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/scim_users/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSourceUser`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSourceUser`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SCIMSourceUser Viewset +pub async fn sources_scim_users_update( + configuration: &configuration::Configuration, + id: &str, + scim_source_user_request: models::ScimSourceUserRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_scim_source_user_request = scim_source_user_request; + + let uri_str = format!( + "{}/sources/scim_users/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_scim_source_user_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ScimSourceUser`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ScimSourceUser`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_scim_users_used_by_list( + configuration: &configuration::Configuration, + id: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/scim_users/{id}/used_by/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn sources_telegram_connect_user_create( + configuration: &configuration::Configuration, + slug: &str, + telegram_auth_request: models::TelegramAuthRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_telegram_auth_request = telegram_auth_request; + + let uri_str = format!( + "{}/sources/telegram/{slug}/connect_user/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_telegram_auth_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserTelegramSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserTelegramSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn sources_telegram_create( + configuration: &configuration::Configuration, + telegram_source_request: models::TelegramSourceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_telegram_source_request = telegram_source_request; + + let uri_str = format!("{}/sources/telegram/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_telegram_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TelegramSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TelegramSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn sources_telegram_destroy( + configuration: &configuration::Configuration, + slug: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/telegram/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn sources_telegram_list( + configuration: &configuration::Configuration, + authentication_flow: Option<&str>, + bot_username: Option<&str>, + enabled: Option, + enrollment_flow: Option<&str>, + group_matching_mode: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + pbm_uuid: Option<&str>, + policy_engine_mode: Option<&str>, + request_message_access: Option, + search: Option<&str>, + slug: Option<&str>, + user_matching_mode: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_authentication_flow = authentication_flow; + let p_query_bot_username = bot_username; + let p_query_enabled = enabled; + let p_query_enrollment_flow = enrollment_flow; + let p_query_group_matching_mode = group_matching_mode; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_pbm_uuid = pbm_uuid; + let p_query_policy_engine_mode = policy_engine_mode; + let p_query_request_message_access = request_message_access; + let p_query_search = search; + let p_query_slug = slug; + let p_query_user_matching_mode = user_matching_mode; + + let uri_str = format!("{}/sources/telegram/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_authentication_flow { + req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_bot_username { + req_builder = req_builder.query(&[("bot_username", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_enabled { + req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_enrollment_flow { + req_builder = req_builder.query(&[("enrollment_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_group_matching_mode { + req_builder = req_builder.query(&[("group_matching_mode", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_pbm_uuid { + req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_policy_engine_mode { + req_builder = req_builder.query(&[("policy_engine_mode", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_request_message_access { + req_builder = req_builder.query(&[("request_message_access", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_slug { + req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user_matching_mode { + req_builder = req_builder.query(&[("user_matching_mode", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedTelegramSourceList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedTelegramSourceList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn sources_telegram_partial_update( + configuration: &configuration::Configuration, + slug: &str, + patched_telegram_source_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_patched_telegram_source_request = patched_telegram_source_request; + + let uri_str = format!( + "{}/sources/telegram/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_telegram_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TelegramSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TelegramSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn sources_telegram_retrieve( + configuration: &configuration::Configuration, + slug: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/telegram/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TelegramSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TelegramSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Mixin to add a used_by endpoint to return a list of all objects using this object +pub async fn sources_telegram_update( + configuration: &configuration::Configuration, + slug: &str, + telegram_source_request: models::TelegramSourceRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + let p_body_telegram_source_request = telegram_source_request; + + let uri_str = format!( + "{}/sources/telegram/{slug}/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_telegram_source_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TelegramSource`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TelegramSource`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_telegram_used_by_list( + configuration: &configuration::Configuration, + slug: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_slug = slug; + + let uri_str = format!( + "{}/sources/telegram/{slug}/used_by/", + configuration.base_path, + slug = crate::apis::urlencode(p_path_slug) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_all_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/all/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_all_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, + user: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + let p_query_user = user; + + let uri_str = format!("{}/sources/user_connections/all/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user { + req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedUserSourceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedUserSourceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_all_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_user_source_connection_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_user_source_connection_request = patched_user_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/all/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_user_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_all_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/all/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_all_update( + configuration: &configuration::Configuration, + id: i32, + user_source_connection_request: models::UserSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_user_source_connection_request = user_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/all/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_user_connections_all_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/all/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_kerberos_create( + configuration: &configuration::Configuration, + user_kerberos_source_connection_request: models::UserKerberosSourceConnectionRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_body_user_kerberos_source_connection_request = user_kerberos_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/kerberos/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_kerberos_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserKerberosSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserKerberosSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_kerberos_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/kerberos/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_kerberos_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, + user: Option, +) -> Result< + models::PaginatedUserKerberosSourceConnectionList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + let p_query_user = user; + + let uri_str = format!( + "{}/sources/user_connections/kerberos/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user { + req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedUserKerberosSourceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedUserKerberosSourceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_kerberos_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_user_kerberos_source_connection_request: Option< + models::PatchedUserKerberosSourceConnectionRequest, + >, +) -> Result< + models::UserKerberosSourceConnection, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_user_kerberos_source_connection_request = + patched_user_kerberos_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/kerberos/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_user_kerberos_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserKerberosSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserKerberosSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_kerberos_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/kerberos/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserKerberosSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserKerberosSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_kerberos_update( + configuration: &configuration::Configuration, + id: i32, + user_kerberos_source_connection_request: models::UserKerberosSourceConnectionRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_user_kerberos_source_connection_request = user_kerberos_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/kerberos/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_kerberos_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserKerberosSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserKerberosSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_user_connections_kerberos_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/kerberos/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_ldap_create( + configuration: &configuration::Configuration, + user_ldap_source_connection_request: models::UserLdapSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_user_ldap_source_connection_request = user_ldap_source_connection_request; + + let uri_str = format!("{}/sources/user_connections/ldap/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_ldap_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserLdapSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserLdapSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_ldap_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/ldap/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_ldap_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, + user: Option, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + let p_query_user = user; + + let uri_str = format!("{}/sources/user_connections/ldap/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user { + req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedUserLdapSourceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedUserLdapSourceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_ldap_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_user_ldap_source_connection_request: Option< + models::PatchedUserLdapSourceConnectionRequest, + >, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_user_ldap_source_connection_request = + patched_user_ldap_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/ldap/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_user_ldap_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserLdapSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserLdapSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_ldap_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/ldap/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserLdapSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserLdapSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_ldap_update( + configuration: &configuration::Configuration, + id: i32, + user_ldap_source_connection_request: models::UserLdapSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_user_ldap_source_connection_request = user_ldap_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/ldap/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_ldap_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserLdapSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserLdapSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_user_connections_ldap_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/ldap/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_oauth_create( + configuration: &configuration::Configuration, + user_o_auth_source_connection_request: models::UserOAuthSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_user_o_auth_source_connection_request = user_o_auth_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/oauth/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_o_auth_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserOAuthSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserOAuthSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_oauth_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/oauth/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_oauth_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, + user: Option, +) -> Result< + models::PaginatedUserOAuthSourceConnectionList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + let p_query_user = user; + + let uri_str = format!( + "{}/sources/user_connections/oauth/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user { + req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedUserOAuthSourceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedUserOAuthSourceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_oauth_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_user_o_auth_source_connection_request: Option< + models::PatchedUserOAuthSourceConnectionRequest, + >, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_user_o_auth_source_connection_request = + patched_user_o_auth_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/oauth/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_user_o_auth_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserOAuthSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserOAuthSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_oauth_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/oauth/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserOAuthSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserOAuthSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_oauth_update( + configuration: &configuration::Configuration, + id: i32, + user_o_auth_source_connection_request: models::UserOAuthSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_user_o_auth_source_connection_request = user_o_auth_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/oauth/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_o_auth_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserOAuthSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserOAuthSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_user_connections_oauth_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/oauth/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_plex_create( + configuration: &configuration::Configuration, + user_plex_source_connection_request: models::UserPlexSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_user_plex_source_connection_request = user_plex_source_connection_request; + + let uri_str = format!("{}/sources/user_connections/plex/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_plex_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserPlexSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserPlexSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_plex_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/plex/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_plex_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, + user: Option, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + let p_query_user = user; + + let uri_str = format!("{}/sources/user_connections/plex/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user { + req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedUserPlexSourceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedUserPlexSourceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_plex_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_user_plex_source_connection_request: Option< + models::PatchedUserPlexSourceConnectionRequest, + >, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_user_plex_source_connection_request = + patched_user_plex_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/plex/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_user_plex_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserPlexSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserPlexSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_plex_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/plex/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserPlexSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserPlexSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_plex_update( + configuration: &configuration::Configuration, + id: i32, + user_plex_source_connection_request: models::UserPlexSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_user_plex_source_connection_request = user_plex_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/plex/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_plex_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserPlexSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserPlexSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_user_connections_plex_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/plex/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_saml_create( + configuration: &configuration::Configuration, + user_saml_source_connection_request: models::UserSamlSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_user_saml_source_connection_request = user_saml_source_connection_request; + + let uri_str = format!("{}/sources/user_connections/saml/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_saml_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserSamlSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserSamlSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_saml_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/saml/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_saml_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, + user: Option, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + let p_query_user = user; + + let uri_str = format!("{}/sources/user_connections/saml/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user { + req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedUserSamlSourceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedUserSamlSourceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_saml_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_user_saml_source_connection_request: Option< + models::PatchedUserSamlSourceConnectionRequest, + >, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_user_saml_source_connection_request = + patched_user_saml_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/saml/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_user_saml_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserSamlSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserSamlSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_saml_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/saml/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserSamlSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserSamlSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_saml_update( + configuration: &configuration::Configuration, + id: i32, + user_saml_source_connection_request: models::UserSamlSourceConnectionRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_user_saml_source_connection_request = user_saml_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/saml/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_saml_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserSamlSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserSamlSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_user_connections_saml_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/saml/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_telegram_create( + configuration: &configuration::Configuration, + user_telegram_source_connection_request: models::UserTelegramSourceConnectionRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_body_user_telegram_source_connection_request = user_telegram_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/telegram/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_telegram_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserTelegramSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserTelegramSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_telegram_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/telegram/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_telegram_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + source__slug: Option<&str>, + user: Option, +) -> Result< + models::PaginatedUserTelegramSourceConnectionList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_source__slug = source__slug; + let p_query_user = user; + + let uri_str = format!( + "{}/sources/user_connections/telegram/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source__slug { + req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user { + req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedUserTelegramSourceConnectionList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedUserTelegramSourceConnectionList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_telegram_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_user_telegram_source_connection_request: Option< + models::PatchedUserTelegramSourceConnectionRequest, + >, +) -> Result< + models::UserTelegramSourceConnection, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_user_telegram_source_connection_request = + patched_user_telegram_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/telegram/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_user_telegram_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserTelegramSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserTelegramSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_telegram_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/telegram/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserTelegramSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserTelegramSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// User-source connection Viewset +pub async fn sources_user_connections_telegram_update( + configuration: &configuration::Configuration, + id: i32, + user_telegram_source_connection_request: models::UserTelegramSourceConnectionRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_user_telegram_source_connection_request = user_telegram_source_connection_request; + + let uri_str = format!( + "{}/sources/user_connections/telegram/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_telegram_source_connection_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserTelegramSourceConnection`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserTelegramSourceConnection`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn sources_user_connections_telegram_used_by_list( + configuration: &configuration::Configuration, + id: i32, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/sources/user_connections/telegram/{id}/used_by/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/ssf_api.rs b/packages/client-rust/src/apis/ssf_api.rs new file mode 100644 index 0000000000..3315e46d6a --- /dev/null +++ b/packages/client-rust/src/apis/ssf_api.rs @@ -0,0 +1,182 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`ssf_streams_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SsfStreamsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`ssf_streams_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SsfStreamsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// SSFStream Viewset +pub async fn ssf_streams_list( + configuration: &configuration::Configuration, + delivery_method: Option<&str>, + endpoint_url: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + provider: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_delivery_method = delivery_method; + let p_query_endpoint_url = endpoint_url; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_provider = provider; + let p_query_search = search; + + let uri_str = format!("{}/ssf/streams/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_delivery_method { + req_builder = req_builder.query(&[("delivery_method", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_endpoint_url { + req_builder = req_builder.query(&[("endpoint_url", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_provider { + req_builder = req_builder.query(&[("provider", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedSsfStreamList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedSsfStreamList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SSFStream Viewset +pub async fn ssf_streams_retrieve( + configuration: &configuration::Configuration, + uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_uuid = uuid; + + let uri_str = format!( + "{}/ssf/streams/{uuid}/", + configuration.base_path, + uuid = crate::apis::urlencode(p_path_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SsfStream`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SsfStream`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/stages_api.rs b/packages/client-rust/src/apis/stages_api.rs new file mode 100644 index 0000000000..76646f861e --- /dev/null +++ b/packages/client-rust/src/apis/stages_api.rs @@ -0,0 +1,15173 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`stages_all_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAllDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_all_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAllListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_all_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAllRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_all_types_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAllTypesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_all_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAllUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_all_user_settings_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAllUserSettingsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_duo_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorDuoCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_duo_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorDuoDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_duo_enrollment_status_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorDuoEnrollmentStatusCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_duo_import_device_manual_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorDuoImportDeviceManualCreateError { + Status400(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_duo_import_devices_automatic_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorDuoImportDevicesAutomaticCreateError { + Status400(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_duo_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorDuoListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_duo_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorDuoPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_duo_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorDuoRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_duo_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorDuoUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_duo_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorDuoUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_email_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorEmailCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_email_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorEmailDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_email_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorEmailListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_email_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorEmailPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_email_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorEmailRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_email_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorEmailUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_email_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorEmailUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_endpoint_gdtc_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorEndpointGdtcCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_endpoint_gdtc_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorEndpointGdtcDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_endpoint_gdtc_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorEndpointGdtcListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_endpoint_gdtc_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorEndpointGdtcPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_endpoint_gdtc_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorEndpointGdtcRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_endpoint_gdtc_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorEndpointGdtcUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_endpoint_gdtc_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorEndpointGdtcUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_sms_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorSmsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_sms_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorSmsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_sms_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorSmsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_sms_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorSmsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_sms_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorSmsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_sms_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorSmsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_sms_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorSmsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_static_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorStaticCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_static_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorStaticDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_static_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorStaticListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_static_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorStaticPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_static_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorStaticRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_static_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorStaticUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_static_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorStaticUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_totp_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorTotpCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_totp_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorTotpDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_totp_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorTotpListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_totp_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorTotpPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_totp_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorTotpRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_totp_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorTotpUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_totp_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorTotpUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_validate_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorValidateCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_validate_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorValidateDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_validate_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorValidateListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_validate_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorValidatePartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_validate_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorValidateRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_validate_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorValidateUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_validate_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorValidateUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_webauthn_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorWebauthnCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_webauthn_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorWebauthnDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_webauthn_device_types_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorWebauthnDeviceTypesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_webauthn_device_types_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorWebauthnDeviceTypesRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_webauthn_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorWebauthnListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_webauthn_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorWebauthnPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_webauthn_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorWebauthnRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_webauthn_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorWebauthnUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_authenticator_webauthn_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesAuthenticatorWebauthnUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_captcha_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesCaptchaCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_captcha_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesCaptchaDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_captcha_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesCaptchaListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_captcha_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesCaptchaPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_captcha_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesCaptchaRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_captcha_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesCaptchaUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_captcha_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesCaptchaUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_consent_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesConsentCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_consent_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesConsentDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_consent_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesConsentListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_consent_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesConsentPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_consent_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesConsentRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_consent_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesConsentUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_consent_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesConsentUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_deny_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesDenyCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_deny_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesDenyDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_deny_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesDenyListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_deny_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesDenyPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_deny_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesDenyRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_deny_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesDenyUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_deny_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesDenyUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_dummy_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesDummyCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_dummy_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesDummyDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_dummy_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesDummyListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_dummy_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesDummyPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_dummy_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesDummyRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_dummy_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesDummyUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_dummy_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesDummyUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_email_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesEmailCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_email_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesEmailDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_email_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesEmailListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_email_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesEmailPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_email_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesEmailRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_email_templates_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesEmailTemplatesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_email_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesEmailUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_email_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesEmailUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_endpoints_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesEndpointsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_endpoints_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesEndpointsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_endpoints_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesEndpointsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_endpoints_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesEndpointsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_endpoints_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesEndpointsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_endpoints_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesEndpointsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_endpoints_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesEndpointsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_identification_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesIdentificationCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_identification_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesIdentificationDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_identification_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesIdentificationListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_identification_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesIdentificationPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_identification_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesIdentificationRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_identification_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesIdentificationUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_identification_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesIdentificationUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_invitation_invitations_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesInvitationInvitationsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_invitation_invitations_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesInvitationInvitationsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_invitation_invitations_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesInvitationInvitationsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_invitation_invitations_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesInvitationInvitationsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_invitation_invitations_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesInvitationInvitationsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_invitation_invitations_send_email_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesInvitationInvitationsSendEmailCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_invitation_invitations_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesInvitationInvitationsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_invitation_invitations_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesInvitationInvitationsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_invitation_stages_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesInvitationStagesCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_invitation_stages_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesInvitationStagesDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_invitation_stages_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesInvitationStagesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_invitation_stages_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesInvitationStagesPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_invitation_stages_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesInvitationStagesRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_invitation_stages_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesInvitationStagesUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_invitation_stages_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesInvitationStagesUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_mtls_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesMtlsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_mtls_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesMtlsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_mtls_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesMtlsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_mtls_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesMtlsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_mtls_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesMtlsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_mtls_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesMtlsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_mtls_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesMtlsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_password_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPasswordCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_password_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPasswordDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_password_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPasswordListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_password_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPasswordPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_password_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPasswordRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_password_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPasswordUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_password_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPasswordUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_prompt_prompts_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPromptPromptsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_prompt_prompts_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPromptPromptsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_prompt_prompts_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPromptPromptsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_prompt_prompts_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPromptPromptsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_prompt_prompts_preview_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPromptPromptsPreviewCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_prompt_prompts_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPromptPromptsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_prompt_prompts_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPromptPromptsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_prompt_prompts_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPromptPromptsUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_prompt_stages_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPromptStagesCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_prompt_stages_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPromptStagesDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_prompt_stages_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPromptStagesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_prompt_stages_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPromptStagesPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_prompt_stages_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPromptStagesRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_prompt_stages_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPromptStagesUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_prompt_stages_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesPromptStagesUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_redirect_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesRedirectCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_redirect_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesRedirectDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_redirect_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesRedirectListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_redirect_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesRedirectPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_redirect_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesRedirectRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_redirect_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesRedirectUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_redirect_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesRedirectUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_source_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesSourceCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_source_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesSourceDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_source_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesSourceListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_source_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesSourcePartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_source_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesSourceRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_source_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesSourceUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_source_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesSourceUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_delete_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserDeleteCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_delete_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserDeleteDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_delete_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserDeleteListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_delete_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserDeletePartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_delete_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserDeleteRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_delete_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserDeleteUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_delete_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserDeleteUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_login_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserLoginCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_login_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserLoginDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_login_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserLoginListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_login_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserLoginPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_login_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserLoginRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_login_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserLoginUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_login_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserLoginUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_logout_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserLogoutCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_logout_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserLogoutDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_logout_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserLogoutListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_logout_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserLogoutPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_logout_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserLogoutRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_logout_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserLogoutUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_logout_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserLogoutUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_write_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserWriteCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_write_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserWriteDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_write_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserWriteListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_write_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserWritePartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_write_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserWriteRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_write_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserWriteUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`stages_user_write_used_by_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StagesUserWriteUsedByListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// Stage Viewset +pub async fn stages_all_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/all/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Stage Viewset +pub async fn stages_all_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/stages/all/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Stage Viewset +pub async fn stages_all_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/all/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Stage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Stage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all creatable types +pub async fn stages_all_types_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/stages/all/types/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_all_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/all/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all stages the user can configure +pub async fn stages_all_user_settings_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/stages/all/user_settings/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UserSetting>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UserSetting>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorDuoStage Viewset +pub async fn stages_authenticator_duo_create( + configuration: &configuration::Configuration, + authenticator_duo_stage_request: models::AuthenticatorDuoStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_authenticator_duo_stage_request = authenticator_duo_stage_request; + + let uri_str = format!("{}/stages/authenticator/duo/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_duo_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorDuoStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorDuoStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorDuoStage Viewset +pub async fn stages_authenticator_duo_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/duo/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Check enrollment status of user details in current session +pub async fn stages_authenticator_duo_enrollment_status_create( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result< + models::DuoDeviceEnrollmentStatus, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/duo/{stage_uuid}/enrollment_status/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DuoDeviceEnrollmentStatus`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DuoDeviceEnrollmentStatus`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Import duo devices into authentik +pub async fn stages_authenticator_duo_import_device_manual_create( + configuration: &configuration::Configuration, + stage_uuid: &str, + authenticator_duo_stage_manual_device_import_request: models::AuthenticatorDuoStageManualDeviceImportRequest, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_authenticator_duo_stage_manual_device_import_request = + authenticator_duo_stage_manual_device_import_request; + + let uri_str = format!( + "{}/stages/authenticator/duo/{stage_uuid}/import_device_manual/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_duo_stage_manual_device_import_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Import duo devices into authentik +pub async fn stages_authenticator_duo_import_devices_automatic_create( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result< + models::AuthenticatorDuoStageDeviceImportResponse, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/duo/{stage_uuid}/import_devices_automatic/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorDuoStageDeviceImportResponse`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorDuoStageDeviceImportResponse`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorDuoStage Viewset +pub async fn stages_authenticator_duo_list( + configuration: &configuration::Configuration, + api_hostname: Option<&str>, + client_id: Option<&str>, + configure_flow: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_api_hostname = api_hostname; + let p_query_client_id = client_id; + let p_query_configure_flow = configure_flow; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/stages/authenticator/duo/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_api_hostname { + req_builder = req_builder.query(&[("api_hostname", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_client_id { + req_builder = req_builder.query(&[("client_id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_configure_flow { + req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorDuoStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorDuoStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorDuoStage Viewset +pub async fn stages_authenticator_duo_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_authenticator_duo_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_authenticator_duo_stage_request = patched_authenticator_duo_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/duo/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_authenticator_duo_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorDuoStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorDuoStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorDuoStage Viewset +pub async fn stages_authenticator_duo_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/duo/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorDuoStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorDuoStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorDuoStage Viewset +pub async fn stages_authenticator_duo_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + authenticator_duo_stage_request: models::AuthenticatorDuoStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_authenticator_duo_stage_request = authenticator_duo_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/duo/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_duo_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorDuoStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorDuoStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_authenticator_duo_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/duo/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorEmailStage Viewset +pub async fn stages_authenticator_email_create( + configuration: &configuration::Configuration, + authenticator_email_stage_request: models::AuthenticatorEmailStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_authenticator_email_stage_request = authenticator_email_stage_request; + + let uri_str = format!("{}/stages/authenticator/email/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_email_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorEmailStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorEmailStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorEmailStage Viewset +pub async fn stages_authenticator_email_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/email/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorEmailStage Viewset +pub async fn stages_authenticator_email_list( + configuration: &configuration::Configuration, + configure_flow: Option<&str>, + friendly_name: Option<&str>, + from_address: Option<&str>, + host: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + password: Option<&str>, + port: Option, + search: Option<&str>, + stage_uuid: Option<&str>, + subject: Option<&str>, + template: Option<&str>, + timeout: Option, + token_expiry: Option<&str>, + use_global_settings: Option, + use_ssl: Option, + use_tls: Option, + username: Option<&str>, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_query_configure_flow = configure_flow; + let p_query_friendly_name = friendly_name; + let p_query_from_address = from_address; + let p_query_host = host; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_password = password; + let p_query_port = port; + let p_query_search = search; + let p_query_stage_uuid = stage_uuid; + let p_query_subject = subject; + let p_query_template = template; + let p_query_timeout = timeout; + let p_query_token_expiry = token_expiry; + let p_query_use_global_settings = use_global_settings; + let p_query_use_ssl = use_ssl; + let p_query_use_tls = use_tls; + let p_query_username = username; + + let uri_str = format!("{}/stages/authenticator/email/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_configure_flow { + req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_friendly_name { + req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_from_address { + req_builder = req_builder.query(&[("from_address", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_host { + req_builder = req_builder.query(&[("host", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_password { + req_builder = req_builder.query(&[("password", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_port { + req_builder = req_builder.query(&[("port", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage_uuid { + req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_subject { + req_builder = req_builder.query(&[("subject", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_template { + req_builder = req_builder.query(&[("template", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_timeout { + req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_token_expiry { + req_builder = req_builder.query(&[("token_expiry", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_use_global_settings { + req_builder = req_builder.query(&[("use_global_settings", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_use_ssl { + req_builder = req_builder.query(&[("use_ssl", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_use_tls { + req_builder = req_builder.query(&[("use_tls", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_username { + req_builder = req_builder.query(&[("username", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorEmailStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorEmailStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorEmailStage Viewset +pub async fn stages_authenticator_email_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_authenticator_email_stage_request: Option< + models::PatchedAuthenticatorEmailStageRequest, + >, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_authenticator_email_stage_request = + patched_authenticator_email_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/email/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_authenticator_email_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorEmailStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorEmailStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorEmailStage Viewset +pub async fn stages_authenticator_email_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/email/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorEmailStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorEmailStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorEmailStage Viewset +pub async fn stages_authenticator_email_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + authenticator_email_stage_request: models::AuthenticatorEmailStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_authenticator_email_stage_request = authenticator_email_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/email/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_email_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorEmailStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorEmailStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_authenticator_email_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/email/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorEndpointGDTCStage Viewset +pub async fn stages_authenticator_endpoint_gdtc_create( + configuration: &configuration::Configuration, + authenticator_endpoint_gdtc_stage_request: models::AuthenticatorEndpointGdtcStageRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_body_authenticator_endpoint_gdtc_stage_request = + authenticator_endpoint_gdtc_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/endpoint_gdtc/", + configuration.base_path + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_endpoint_gdtc_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorEndpointGdtcStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorEndpointGdtcStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorEndpointGDTCStage Viewset +pub async fn stages_authenticator_endpoint_gdtc_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/endpoint_gdtc/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorEndpointGDTCStage Viewset +pub async fn stages_authenticator_endpoint_gdtc_list( + configuration: &configuration::Configuration, + configure_flow: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result< + models::PaginatedAuthenticatorEndpointGdtcStageList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_configure_flow = configure_flow; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!( + "{}/stages/authenticator/endpoint_gdtc/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_configure_flow { + req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorEndpointGdtcStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorEndpointGdtcStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorEndpointGDTCStage Viewset +pub async fn stages_authenticator_endpoint_gdtc_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_authenticator_endpoint_gdtc_stage_request: Option< + models::PatchedAuthenticatorEndpointGdtcStageRequest, + >, +) -> Result< + models::AuthenticatorEndpointGdtcStage, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_authenticator_endpoint_gdtc_stage_request = + patched_authenticator_endpoint_gdtc_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/endpoint_gdtc/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_authenticator_endpoint_gdtc_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorEndpointGdtcStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorEndpointGdtcStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorEndpointGDTCStage Viewset +pub async fn stages_authenticator_endpoint_gdtc_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result< + models::AuthenticatorEndpointGdtcStage, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/endpoint_gdtc/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorEndpointGdtcStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorEndpointGdtcStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorEndpointGDTCStage Viewset +pub async fn stages_authenticator_endpoint_gdtc_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + authenticator_endpoint_gdtc_stage_request: models::AuthenticatorEndpointGdtcStageRequest, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_authenticator_endpoint_gdtc_stage_request = + authenticator_endpoint_gdtc_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/endpoint_gdtc/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_endpoint_gdtc_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorEndpointGdtcStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorEndpointGdtcStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_authenticator_endpoint_gdtc_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/endpoint_gdtc/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorSMSStage Viewset +pub async fn stages_authenticator_sms_create( + configuration: &configuration::Configuration, + authenticator_sms_stage_request: models::AuthenticatorSmsStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_authenticator_sms_stage_request = authenticator_sms_stage_request; + + let uri_str = format!("{}/stages/authenticator/sms/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_sms_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorSmsStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorSmsStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorSMSStage Viewset +pub async fn stages_authenticator_sms_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/sms/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorSMSStage Viewset +pub async fn stages_authenticator_sms_list( + configuration: &configuration::Configuration, + account_sid: Option<&str>, + auth: Option<&str>, + auth_password: Option<&str>, + auth_type: Option<&str>, + configure_flow: Option<&str>, + friendly_name: Option<&str>, + from_number: Option<&str>, + mapping: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + provider: Option<&str>, + search: Option<&str>, + stage_uuid: Option<&str>, + verify_only: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_account_sid = account_sid; + let p_query_auth = auth; + let p_query_auth_password = auth_password; + let p_query_auth_type = auth_type; + let p_query_configure_flow = configure_flow; + let p_query_friendly_name = friendly_name; + let p_query_from_number = from_number; + let p_query_mapping = mapping; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_provider = provider; + let p_query_search = search; + let p_query_stage_uuid = stage_uuid; + let p_query_verify_only = verify_only; + + let uri_str = format!("{}/stages/authenticator/sms/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_account_sid { + req_builder = req_builder.query(&[("account_sid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_auth { + req_builder = req_builder.query(&[("auth", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_auth_password { + req_builder = req_builder.query(&[("auth_password", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_auth_type { + req_builder = req_builder.query(&[("auth_type", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_configure_flow { + req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_friendly_name { + req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_from_number { + req_builder = req_builder.query(&[("from_number", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_mapping { + req_builder = req_builder.query(&[("mapping", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_provider { + req_builder = req_builder.query(&[("provider", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage_uuid { + req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_verify_only { + req_builder = req_builder.query(&[("verify_only", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorSmsStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorSmsStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorSMSStage Viewset +pub async fn stages_authenticator_sms_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_authenticator_sms_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_authenticator_sms_stage_request = patched_authenticator_sms_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/sms/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_authenticator_sms_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorSmsStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorSmsStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorSMSStage Viewset +pub async fn stages_authenticator_sms_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/sms/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorSmsStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorSmsStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorSMSStage Viewset +pub async fn stages_authenticator_sms_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + authenticator_sms_stage_request: models::AuthenticatorSmsStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_authenticator_sms_stage_request = authenticator_sms_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/sms/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_sms_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorSmsStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorSmsStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_authenticator_sms_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/sms/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorStaticStage Viewset +pub async fn stages_authenticator_static_create( + configuration: &configuration::Configuration, + authenticator_static_stage_request: models::AuthenticatorStaticStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_authenticator_static_stage_request = authenticator_static_stage_request; + + let uri_str = format!("{}/stages/authenticator/static/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_static_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorStaticStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorStaticStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorStaticStage Viewset +pub async fn stages_authenticator_static_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/static/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorStaticStage Viewset +pub async fn stages_authenticator_static_list( + configuration: &configuration::Configuration, + configure_flow: Option<&str>, + friendly_name: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + stage_uuid: Option<&str>, + token_count: Option, + token_length: Option, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_query_configure_flow = configure_flow; + let p_query_friendly_name = friendly_name; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_stage_uuid = stage_uuid; + let p_query_token_count = token_count; + let p_query_token_length = token_length; + + let uri_str = format!("{}/stages/authenticator/static/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_configure_flow { + req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_friendly_name { + req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage_uuid { + req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_token_count { + req_builder = req_builder.query(&[("token_count", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_token_length { + req_builder = req_builder.query(&[("token_length", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorStaticStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorStaticStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorStaticStage Viewset +pub async fn stages_authenticator_static_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_authenticator_static_stage_request: Option< + models::PatchedAuthenticatorStaticStageRequest, + >, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_authenticator_static_stage_request = + patched_authenticator_static_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/static/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_authenticator_static_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorStaticStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorStaticStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorStaticStage Viewset +pub async fn stages_authenticator_static_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/static/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorStaticStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorStaticStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorStaticStage Viewset +pub async fn stages_authenticator_static_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + authenticator_static_stage_request: models::AuthenticatorStaticStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_authenticator_static_stage_request = authenticator_static_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/static/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_static_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorStaticStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorStaticStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_authenticator_static_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/static/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorTOTPStage Viewset +pub async fn stages_authenticator_totp_create( + configuration: &configuration::Configuration, + authenticator_totp_stage_request: models::AuthenticatorTotpStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_authenticator_totp_stage_request = authenticator_totp_stage_request; + + let uri_str = format!("{}/stages/authenticator/totp/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_totp_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorTotpStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorTotpStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorTOTPStage Viewset +pub async fn stages_authenticator_totp_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/totp/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorTOTPStage Viewset +pub async fn stages_authenticator_totp_list( + configuration: &configuration::Configuration, + configure_flow: Option<&str>, + digits: Option<&str>, + friendly_name: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + stage_uuid: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_configure_flow = configure_flow; + let p_query_digits = digits; + let p_query_friendly_name = friendly_name; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_stage_uuid = stage_uuid; + + let uri_str = format!("{}/stages/authenticator/totp/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_configure_flow { + req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_digits { + req_builder = req_builder.query(&[("digits", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_friendly_name { + req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage_uuid { + req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorTotpStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorTotpStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorTOTPStage Viewset +pub async fn stages_authenticator_totp_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_authenticator_totp_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_authenticator_totp_stage_request = patched_authenticator_totp_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/totp/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_authenticator_totp_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorTotpStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorTotpStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorTOTPStage Viewset +pub async fn stages_authenticator_totp_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/totp/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorTotpStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorTotpStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorTOTPStage Viewset +pub async fn stages_authenticator_totp_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + authenticator_totp_stage_request: models::AuthenticatorTotpStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_authenticator_totp_stage_request = authenticator_totp_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/totp/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_totp_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorTotpStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorTotpStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_authenticator_totp_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/totp/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorValidateStage Viewset +pub async fn stages_authenticator_validate_create( + configuration: &configuration::Configuration, + authenticator_validate_stage_request: models::AuthenticatorValidateStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_authenticator_validate_stage_request = authenticator_validate_stage_request; + + let uri_str = format!("{}/stages/authenticator/validate/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_validate_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorValidateStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorValidateStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorValidateStage Viewset +pub async fn stages_authenticator_validate_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/validate/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorValidateStage Viewset +pub async fn stages_authenticator_validate_list( + configuration: &configuration::Configuration, + configuration_stages: Option>, + name: Option<&str>, + not_configured_action: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result< + models::PaginatedAuthenticatorValidateStageList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_configuration_stages = configuration_stages; + let p_query_name = name; + let p_query_not_configured_action = not_configured_action; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/stages/authenticator/validate/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_configuration_stages { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("configuration_stages".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "configuration_stages", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_not_configured_action { + req_builder = req_builder.query(&[("not_configured_action", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorValidateStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorValidateStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorValidateStage Viewset +pub async fn stages_authenticator_validate_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_authenticator_validate_stage_request: Option< + models::PatchedAuthenticatorValidateStageRequest, + >, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_authenticator_validate_stage_request = + patched_authenticator_validate_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/validate/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_authenticator_validate_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorValidateStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorValidateStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorValidateStage Viewset +pub async fn stages_authenticator_validate_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/validate/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorValidateStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorValidateStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorValidateStage Viewset +pub async fn stages_authenticator_validate_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + authenticator_validate_stage_request: models::AuthenticatorValidateStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_authenticator_validate_stage_request = authenticator_validate_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/validate/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_validate_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorValidateStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorValidateStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_authenticator_validate_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/validate/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorWebAuthnStage Viewset +pub async fn stages_authenticator_webauthn_create( + configuration: &configuration::Configuration, + authenticator_web_authn_stage_request: models::AuthenticatorWebAuthnStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_authenticator_web_authn_stage_request = authenticator_web_authn_stage_request; + + let uri_str = format!("{}/stages/authenticator/webauthn/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_web_authn_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorWebAuthnStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorWebAuthnStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorWebAuthnStage Viewset +pub async fn stages_authenticator_webauthn_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/webauthn/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// WebAuthnDeviceType Viewset +pub async fn stages_authenticator_webauthn_device_types_list( + configuration: &configuration::Configuration, + aaguid: Option<&str>, + description: Option<&str>, + icon: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result< + models::PaginatedWebAuthnDeviceTypeList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_aaguid = aaguid; + let p_query_description = description; + let p_query_icon = icon; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!( + "{}/stages/authenticator/webauthn_device_types/", + configuration.base_path + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_aaguid { + req_builder = req_builder.query(&[("aaguid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_description { + req_builder = req_builder.query(&[("description", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_icon { + req_builder = req_builder.query(&[("icon", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedWebAuthnDeviceTypeList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedWebAuthnDeviceTypeList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// WebAuthnDeviceType Viewset +pub async fn stages_authenticator_webauthn_device_types_retrieve( + configuration: &configuration::Configuration, + aaguid: &str, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_aaguid = aaguid; + + let uri_str = format!( + "{}/stages/authenticator/webauthn_device_types/{aaguid}/", + configuration.base_path, + aaguid = crate::apis::urlencode(p_path_aaguid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::WebAuthnDeviceType`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::WebAuthnDeviceType`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorWebAuthnStage Viewset +pub async fn stages_authenticator_webauthn_list( + configuration: &configuration::Configuration, + authenticator_attachment: Option<&str>, + configure_flow: Option<&str>, + device_type_restrictions: Option>, + max_attempts: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + resident_key_requirement: Option<&str>, + search: Option<&str>, + user_verification: Option<&str>, +) -> Result< + models::PaginatedAuthenticatorWebAuthnStageList, + Error, +> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_authenticator_attachment = authenticator_attachment; + let p_query_configure_flow = configure_flow; + let p_query_device_type_restrictions = device_type_restrictions; + let p_query_max_attempts = max_attempts; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_resident_key_requirement = resident_key_requirement; + let p_query_search = search; + let p_query_user_verification = user_verification; + + let uri_str = format!("{}/stages/authenticator/webauthn/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_authenticator_attachment { + req_builder = req_builder.query(&[("authenticator_attachment", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_configure_flow { + req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_device_type_restrictions { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("device_type_restrictions".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "device_type_restrictions", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_max_attempts { + req_builder = req_builder.query(&[("max_attempts", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_resident_key_requirement { + req_builder = req_builder.query(&[("resident_key_requirement", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user_verification { + req_builder = req_builder.query(&[("user_verification", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorWebAuthnStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedAuthenticatorWebAuthnStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorWebAuthnStage Viewset +pub async fn stages_authenticator_webauthn_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_authenticator_web_authn_stage_request: Option< + models::PatchedAuthenticatorWebAuthnStageRequest, + >, +) -> Result> +{ + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_authenticator_web_authn_stage_request = + patched_authenticator_web_authn_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/webauthn/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_authenticator_web_authn_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorWebAuthnStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorWebAuthnStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorWebAuthnStage Viewset +pub async fn stages_authenticator_webauthn_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/webauthn/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorWebAuthnStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorWebAuthnStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// AuthenticatorWebAuthnStage Viewset +pub async fn stages_authenticator_webauthn_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + authenticator_web_authn_stage_request: models::AuthenticatorWebAuthnStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_authenticator_web_authn_stage_request = authenticator_web_authn_stage_request; + + let uri_str = format!( + "{}/stages/authenticator/webauthn/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_authenticator_web_authn_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::AuthenticatorWebAuthnStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::AuthenticatorWebAuthnStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_authenticator_webauthn_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/authenticator/webauthn/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// CaptchaStage Viewset +pub async fn stages_captcha_create( + configuration: &configuration::Configuration, + captcha_stage_request: models::CaptchaStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_captcha_stage_request = captcha_stage_request; + + let uri_str = format!("{}/stages/captcha/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_captcha_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::CaptchaStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::CaptchaStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// CaptchaStage Viewset +pub async fn stages_captcha_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/captcha/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// CaptchaStage Viewset +pub async fn stages_captcha_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + public_key: Option<&str>, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_public_key = public_key; + let p_query_search = search; + + let uri_str = format!("{}/stages/captcha/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_public_key { + req_builder = req_builder.query(&[("public_key", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedCaptchaStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedCaptchaStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// CaptchaStage Viewset +pub async fn stages_captcha_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_captcha_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_captcha_stage_request = patched_captcha_stage_request; + + let uri_str = format!( + "{}/stages/captcha/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_captcha_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::CaptchaStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::CaptchaStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// CaptchaStage Viewset +pub async fn stages_captcha_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/captcha/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::CaptchaStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::CaptchaStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// CaptchaStage Viewset +pub async fn stages_captcha_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + captcha_stage_request: models::CaptchaStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_captcha_stage_request = captcha_stage_request; + + let uri_str = format!( + "{}/stages/captcha/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_captcha_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::CaptchaStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::CaptchaStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_captcha_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/captcha/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ConsentStage Viewset +pub async fn stages_consent_create( + configuration: &configuration::Configuration, + consent_stage_request: models::ConsentStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_consent_stage_request = consent_stage_request; + + let uri_str = format!("{}/stages/consent/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_consent_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ConsentStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ConsentStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ConsentStage Viewset +pub async fn stages_consent_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/consent/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ConsentStage Viewset +pub async fn stages_consent_list( + configuration: &configuration::Configuration, + consent_expire_in: Option<&str>, + mode: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + stage_uuid: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_consent_expire_in = consent_expire_in; + let p_query_mode = mode; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_stage_uuid = stage_uuid; + + let uri_str = format!("{}/stages/consent/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_consent_expire_in { + req_builder = req_builder.query(&[("consent_expire_in", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_mode { + req_builder = req_builder.query(&[("mode", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage_uuid { + req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedConsentStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedConsentStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ConsentStage Viewset +pub async fn stages_consent_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_consent_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_consent_stage_request = patched_consent_stage_request; + + let uri_str = format!( + "{}/stages/consent/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_consent_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ConsentStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ConsentStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ConsentStage Viewset +pub async fn stages_consent_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/consent/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ConsentStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ConsentStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// ConsentStage Viewset +pub async fn stages_consent_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + consent_stage_request: models::ConsentStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_consent_stage_request = consent_stage_request; + + let uri_str = format!( + "{}/stages/consent/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_consent_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::ConsentStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::ConsentStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_consent_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/consent/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DenyStage Viewset +pub async fn stages_deny_create( + configuration: &configuration::Configuration, + deny_stage_request: models::DenyStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_deny_stage_request = deny_stage_request; + + let uri_str = format!("{}/stages/deny/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_deny_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DenyStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DenyStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DenyStage Viewset +pub async fn stages_deny_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/deny/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DenyStage Viewset +pub async fn stages_deny_list( + configuration: &configuration::Configuration, + deny_message: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + stage_uuid: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_deny_message = deny_message; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_stage_uuid = stage_uuid; + + let uri_str = format!("{}/stages/deny/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_deny_message { + req_builder = req_builder.query(&[("deny_message", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage_uuid { + req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedDenyStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedDenyStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DenyStage Viewset +pub async fn stages_deny_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_deny_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_deny_stage_request = patched_deny_stage_request; + + let uri_str = format!( + "{}/stages/deny/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_deny_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DenyStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DenyStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DenyStage Viewset +pub async fn stages_deny_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/deny/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DenyStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DenyStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DenyStage Viewset +pub async fn stages_deny_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + deny_stage_request: models::DenyStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_deny_stage_request = deny_stage_request; + + let uri_str = format!( + "{}/stages/deny/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_deny_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DenyStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DenyStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_deny_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/deny/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DummyStage Viewset +pub async fn stages_dummy_create( + configuration: &configuration::Configuration, + dummy_stage_request: models::DummyStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_dummy_stage_request = dummy_stage_request; + + let uri_str = format!("{}/stages/dummy/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_dummy_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DummyStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DummyStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DummyStage Viewset +pub async fn stages_dummy_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/dummy/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DummyStage Viewset +pub async fn stages_dummy_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + stage_uuid: Option<&str>, + throw_error: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_stage_uuid = stage_uuid; + let p_query_throw_error = throw_error; + + let uri_str = format!("{}/stages/dummy/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage_uuid { + req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_throw_error { + req_builder = req_builder.query(&[("throw_error", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedDummyStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedDummyStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DummyStage Viewset +pub async fn stages_dummy_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_dummy_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_dummy_stage_request = patched_dummy_stage_request; + + let uri_str = format!( + "{}/stages/dummy/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_dummy_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DummyStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DummyStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DummyStage Viewset +pub async fn stages_dummy_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/dummy/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DummyStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DummyStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// DummyStage Viewset +pub async fn stages_dummy_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + dummy_stage_request: models::DummyStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_dummy_stage_request = dummy_stage_request; + + let uri_str = format!( + "{}/stages/dummy/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_dummy_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::DummyStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::DummyStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_dummy_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/dummy/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// EmailStage Viewset +pub async fn stages_email_create( + configuration: &configuration::Configuration, + email_stage_request: models::EmailStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_email_stage_request = email_stage_request; + + let uri_str = format!("{}/stages/email/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_email_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EmailStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EmailStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// EmailStage Viewset +pub async fn stages_email_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/email/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// EmailStage Viewset +pub async fn stages_email_list( + configuration: &configuration::Configuration, + activate_user_on_success: Option, + from_address: Option<&str>, + host: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + port: Option, + search: Option<&str>, + subject: Option<&str>, + template: Option<&str>, + timeout: Option, + token_expiry: Option<&str>, + use_global_settings: Option, + use_ssl: Option, + use_tls: Option, + username: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_activate_user_on_success = activate_user_on_success; + let p_query_from_address = from_address; + let p_query_host = host; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_port = port; + let p_query_search = search; + let p_query_subject = subject; + let p_query_template = template; + let p_query_timeout = timeout; + let p_query_token_expiry = token_expiry; + let p_query_use_global_settings = use_global_settings; + let p_query_use_ssl = use_ssl; + let p_query_use_tls = use_tls; + let p_query_username = username; + + let uri_str = format!("{}/stages/email/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_activate_user_on_success { + req_builder = req_builder.query(&[("activate_user_on_success", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_from_address { + req_builder = req_builder.query(&[("from_address", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_host { + req_builder = req_builder.query(&[("host", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_port { + req_builder = req_builder.query(&[("port", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_subject { + req_builder = req_builder.query(&[("subject", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_template { + req_builder = req_builder.query(&[("template", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_timeout { + req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_token_expiry { + req_builder = req_builder.query(&[("token_expiry", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_use_global_settings { + req_builder = req_builder.query(&[("use_global_settings", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_use_ssl { + req_builder = req_builder.query(&[("use_ssl", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_use_tls { + req_builder = req_builder.query(&[("use_tls", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_username { + req_builder = req_builder.query(&[("username", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedEmailStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedEmailStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// EmailStage Viewset +pub async fn stages_email_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_email_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_email_stage_request = patched_email_stage_request; + + let uri_str = format!( + "{}/stages/email/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_email_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EmailStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EmailStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// EmailStage Viewset +pub async fn stages_email_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/email/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EmailStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EmailStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all available templates, including custom templates +pub async fn stages_email_templates_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/stages/email/templates/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::TypeCreate>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// EmailStage Viewset +pub async fn stages_email_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + email_stage_request: models::EmailStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_email_stage_request = email_stage_request; + + let uri_str = format!( + "{}/stages/email/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_email_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EmailStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EmailStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_email_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/email/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// EndpointStage Viewset +pub async fn stages_endpoints_create( + configuration: &configuration::Configuration, + endpoint_stage_request: models::EndpointStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_endpoint_stage_request = endpoint_stage_request; + + let uri_str = format!("{}/stages/endpoints/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_endpoint_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EndpointStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EndpointStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// EndpointStage Viewset +pub async fn stages_endpoints_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/endpoints/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// EndpointStage Viewset +pub async fn stages_endpoints_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/stages/endpoints/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedEndpointStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedEndpointStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// EndpointStage Viewset +pub async fn stages_endpoints_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_endpoint_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_endpoint_stage_request = patched_endpoint_stage_request; + + let uri_str = format!( + "{}/stages/endpoints/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_endpoint_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EndpointStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EndpointStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// EndpointStage Viewset +pub async fn stages_endpoints_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/endpoints/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EndpointStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EndpointStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// EndpointStage Viewset +pub async fn stages_endpoints_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + endpoint_stage_request: models::EndpointStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_endpoint_stage_request = endpoint_stage_request; + + let uri_str = format!( + "{}/stages/endpoints/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_endpoint_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::EndpointStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::EndpointStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_endpoints_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/endpoints/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// IdentificationStage Viewset +pub async fn stages_identification_create( + configuration: &configuration::Configuration, + identification_stage_request: models::IdentificationStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_identification_stage_request = identification_stage_request; + + let uri_str = format!("{}/stages/identification/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_identification_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::IdentificationStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::IdentificationStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// IdentificationStage Viewset +pub async fn stages_identification_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/identification/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// IdentificationStage Viewset +pub async fn stages_identification_list( + configuration: &configuration::Configuration, + captcha_stage: Option<&str>, + case_insensitive_matching: Option, + enrollment_flow: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + password_stage: Option<&str>, + passwordless_flow: Option<&str>, + recovery_flow: Option<&str>, + search: Option<&str>, + show_matched_user: Option, + show_source_labels: Option, + webauthn_stage: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_captcha_stage = captcha_stage; + let p_query_case_insensitive_matching = case_insensitive_matching; + let p_query_enrollment_flow = enrollment_flow; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_password_stage = password_stage; + let p_query_passwordless_flow = passwordless_flow; + let p_query_recovery_flow = recovery_flow; + let p_query_search = search; + let p_query_show_matched_user = show_matched_user; + let p_query_show_source_labels = show_source_labels; + let p_query_webauthn_stage = webauthn_stage; + + let uri_str = format!("{}/stages/identification/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_captcha_stage { + req_builder = req_builder.query(&[("captcha_stage", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_case_insensitive_matching { + req_builder = req_builder.query(&[("case_insensitive_matching", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_enrollment_flow { + req_builder = req_builder.query(&[("enrollment_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_password_stage { + req_builder = req_builder.query(&[("password_stage", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_passwordless_flow { + req_builder = req_builder.query(&[("passwordless_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_recovery_flow { + req_builder = req_builder.query(&[("recovery_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_show_matched_user { + req_builder = req_builder.query(&[("show_matched_user", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_show_source_labels { + req_builder = req_builder.query(&[("show_source_labels", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_webauthn_stage { + req_builder = req_builder.query(&[("webauthn_stage", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedIdentificationStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedIdentificationStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// IdentificationStage Viewset +pub async fn stages_identification_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_identification_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_identification_stage_request = patched_identification_stage_request; + + let uri_str = format!( + "{}/stages/identification/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_identification_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::IdentificationStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::IdentificationStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// IdentificationStage Viewset +pub async fn stages_identification_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/identification/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::IdentificationStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::IdentificationStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// IdentificationStage Viewset +pub async fn stages_identification_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + identification_stage_request: models::IdentificationStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_identification_stage_request = identification_stage_request; + + let uri_str = format!( + "{}/stages/identification/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_identification_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::IdentificationStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::IdentificationStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_identification_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/identification/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Invitation Viewset +pub async fn stages_invitation_invitations_create( + configuration: &configuration::Configuration, + invitation_request: models::InvitationRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_invitation_request = invitation_request; + + let uri_str = format!("{}/stages/invitation/invitations/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_invitation_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Invitation`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Invitation`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Invitation Viewset +pub async fn stages_invitation_invitations_destroy( + configuration: &configuration::Configuration, + invite_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_invite_uuid = invite_uuid; + + let uri_str = format!( + "{}/stages/invitation/invitations/{invite_uuid}/", + configuration.base_path, + invite_uuid = crate::apis::urlencode(p_path_invite_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Invitation Viewset +pub async fn stages_invitation_invitations_list( + configuration: &configuration::Configuration, + created_by__username: Option<&str>, + expires: Option, + flow__slug: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_created_by__username = created_by__username; + let p_query_expires = expires; + let p_query_flow__slug = flow__slug; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/stages/invitation/invitations/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_created_by__username { + req_builder = req_builder.query(&[("created_by__username", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_expires { + req_builder = req_builder.query(&[("expires", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_flow__slug { + req_builder = req_builder.query(&[("flow__slug", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedInvitationList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedInvitationList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Invitation Viewset +pub async fn stages_invitation_invitations_partial_update( + configuration: &configuration::Configuration, + invite_uuid: &str, + patched_invitation_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_invite_uuid = invite_uuid; + let p_body_patched_invitation_request = patched_invitation_request; + + let uri_str = format!( + "{}/stages/invitation/invitations/{invite_uuid}/", + configuration.base_path, + invite_uuid = crate::apis::urlencode(p_path_invite_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_invitation_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Invitation`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Invitation`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Invitation Viewset +pub async fn stages_invitation_invitations_retrieve( + configuration: &configuration::Configuration, + invite_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_invite_uuid = invite_uuid; + + let uri_str = format!( + "{}/stages/invitation/invitations/{invite_uuid}/", + configuration.base_path, + invite_uuid = crate::apis::urlencode(p_path_invite_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Invitation`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Invitation`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Send invitation link via email to one or more addresses +pub async fn stages_invitation_invitations_send_email_create( + configuration: &configuration::Configuration, + invite_uuid: &str, + invitation_send_email_request: models::InvitationSendEmailRequest, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_invite_uuid = invite_uuid; + let p_body_invitation_send_email_request = invitation_send_email_request; + + let uri_str = format!( + "{}/stages/invitation/invitations/{invite_uuid}/send_email/", + configuration.base_path, + invite_uuid = crate::apis::urlencode(p_path_invite_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_invitation_send_email_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Invitation Viewset +pub async fn stages_invitation_invitations_update( + configuration: &configuration::Configuration, + invite_uuid: &str, + invitation_request: models::InvitationRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_invite_uuid = invite_uuid; + let p_body_invitation_request = invitation_request; + + let uri_str = format!( + "{}/stages/invitation/invitations/{invite_uuid}/", + configuration.base_path, + invite_uuid = crate::apis::urlencode(p_path_invite_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_invitation_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Invitation`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Invitation`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_invitation_invitations_used_by_list( + configuration: &configuration::Configuration, + invite_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_invite_uuid = invite_uuid; + + let uri_str = format!( + "{}/stages/invitation/invitations/{invite_uuid}/used_by/", + configuration.base_path, + invite_uuid = crate::apis::urlencode(p_path_invite_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// InvitationStage Viewset +pub async fn stages_invitation_stages_create( + configuration: &configuration::Configuration, + invitation_stage_request: models::InvitationStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_invitation_stage_request = invitation_stage_request; + + let uri_str = format!("{}/stages/invitation/stages/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_invitation_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::InvitationStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::InvitationStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// InvitationStage Viewset +pub async fn stages_invitation_stages_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/invitation/stages/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// InvitationStage Viewset +pub async fn stages_invitation_stages_list( + configuration: &configuration::Configuration, + continue_flow_without_invitation: Option, + name: Option<&str>, + no_flows: Option, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + stage_uuid: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_continue_flow_without_invitation = continue_flow_without_invitation; + let p_query_name = name; + let p_query_no_flows = no_flows; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_stage_uuid = stage_uuid; + + let uri_str = format!("{}/stages/invitation/stages/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_continue_flow_without_invitation { + req_builder = + req_builder.query(&[("continue_flow_without_invitation", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_no_flows { + req_builder = req_builder.query(&[("no_flows", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage_uuid { + req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedInvitationStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedInvitationStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// InvitationStage Viewset +pub async fn stages_invitation_stages_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_invitation_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_invitation_stage_request = patched_invitation_stage_request; + + let uri_str = format!( + "{}/stages/invitation/stages/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_invitation_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::InvitationStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::InvitationStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// InvitationStage Viewset +pub async fn stages_invitation_stages_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/invitation/stages/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::InvitationStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::InvitationStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// InvitationStage Viewset +pub async fn stages_invitation_stages_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + invitation_stage_request: models::InvitationStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_invitation_stage_request = invitation_stage_request; + + let uri_str = format!( + "{}/stages/invitation/stages/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_invitation_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::InvitationStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::InvitationStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_invitation_stages_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/invitation/stages/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MutualTLSStage Viewset +pub async fn stages_mtls_create( + configuration: &configuration::Configuration, + mutual_tls_stage_request: models::MutualTlsStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_mutual_tls_stage_request = mutual_tls_stage_request; + + let uri_str = format!("{}/stages/mtls/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_mutual_tls_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MutualTlsStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MutualTlsStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MutualTLSStage Viewset +pub async fn stages_mtls_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/mtls/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MutualTLSStage Viewset +pub async fn stages_mtls_list( + configuration: &configuration::Configuration, + cert_attribute: Option<&str>, + certificate_authorities: Option>, + mode: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + stage_uuid: Option<&str>, + user_attribute: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_cert_attribute = cert_attribute; + let p_query_certificate_authorities = certificate_authorities; + let p_query_mode = mode; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_stage_uuid = stage_uuid; + let p_query_user_attribute = user_attribute; + + let uri_str = format!("{}/stages/mtls/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_cert_attribute { + req_builder = req_builder.query(&[("cert_attribute", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_certificate_authorities { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("certificate_authorities".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "certificate_authorities", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_mode { + req_builder = req_builder.query(&[("mode", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage_uuid { + req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user_attribute { + req_builder = req_builder.query(&[("user_attribute", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedMutualTlsStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedMutualTlsStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MutualTLSStage Viewset +pub async fn stages_mtls_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_mutual_tls_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_mutual_tls_stage_request = patched_mutual_tls_stage_request; + + let uri_str = format!( + "{}/stages/mtls/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_mutual_tls_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MutualTlsStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MutualTlsStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MutualTLSStage Viewset +pub async fn stages_mtls_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/mtls/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MutualTlsStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MutualTlsStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// MutualTLSStage Viewset +pub async fn stages_mtls_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + mutual_tls_stage_request: models::MutualTlsStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_mutual_tls_stage_request = mutual_tls_stage_request; + + let uri_str = format!( + "{}/stages/mtls/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_mutual_tls_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::MutualTlsStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::MutualTlsStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_mtls_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/mtls/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PasswordStage Viewset +pub async fn stages_password_create( + configuration: &configuration::Configuration, + password_stage_request: models::PasswordStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_password_stage_request = password_stage_request; + + let uri_str = format!("{}/stages/password/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_password_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PasswordStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PasswordStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PasswordStage Viewset +pub async fn stages_password_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/password/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PasswordStage Viewset +pub async fn stages_password_list( + configuration: &configuration::Configuration, + allow_show_password: Option, + configure_flow: Option<&str>, + failed_attempts_before_cancel: Option, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_allow_show_password = allow_show_password; + let p_query_configure_flow = configure_flow; + let p_query_failed_attempts_before_cancel = failed_attempts_before_cancel; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/stages/password/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_allow_show_password { + req_builder = req_builder.query(&[("allow_show_password", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_configure_flow { + req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_failed_attempts_before_cancel { + req_builder = + req_builder.query(&[("failed_attempts_before_cancel", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedPasswordStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedPasswordStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PasswordStage Viewset +pub async fn stages_password_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_password_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_password_stage_request = patched_password_stage_request; + + let uri_str = format!( + "{}/stages/password/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_password_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PasswordStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PasswordStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PasswordStage Viewset +pub async fn stages_password_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/password/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PasswordStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PasswordStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PasswordStage Viewset +pub async fn stages_password_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + password_stage_request: models::PasswordStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_password_stage_request = password_stage_request; + + let uri_str = format!( + "{}/stages/password/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_password_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PasswordStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PasswordStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_password_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/password/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Prompt Viewset +pub async fn stages_prompt_prompts_create( + configuration: &configuration::Configuration, + prompt_request: models::PromptRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_prompt_request = prompt_request; + + let uri_str = format!("{}/stages/prompt/prompts/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_prompt_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Prompt`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Prompt`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Prompt Viewset +pub async fn stages_prompt_prompts_destroy( + configuration: &configuration::Configuration, + prompt_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_prompt_uuid = prompt_uuid; + + let uri_str = format!( + "{}/stages/prompt/prompts/{prompt_uuid}/", + configuration.base_path, + prompt_uuid = crate::apis::urlencode(p_path_prompt_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Prompt Viewset +pub async fn stages_prompt_prompts_list( + configuration: &configuration::Configuration, + field_key: Option<&str>, + label: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + placeholder: Option<&str>, + search: Option<&str>, + r#type: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_field_key = field_key; + let p_query_label = label; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_placeholder = placeholder; + let p_query_search = search; + let p_query_type = r#type; + + let uri_str = format!("{}/stages/prompt/prompts/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_field_key { + req_builder = req_builder.query(&[("field_key", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_label { + req_builder = req_builder.query(&[("label", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_placeholder { + req_builder = req_builder.query(&[("placeholder", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_type { + req_builder = req_builder.query(&[("type", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedPromptList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedPromptList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Prompt Viewset +pub async fn stages_prompt_prompts_partial_update( + configuration: &configuration::Configuration, + prompt_uuid: &str, + patched_prompt_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_prompt_uuid = prompt_uuid; + let p_body_patched_prompt_request = patched_prompt_request; + + let uri_str = format!( + "{}/stages/prompt/prompts/{prompt_uuid}/", + configuration.base_path, + prompt_uuid = crate::apis::urlencode(p_path_prompt_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_prompt_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Prompt`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Prompt`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Preview a prompt as a challenge, just like a flow would receive +pub async fn stages_prompt_prompts_preview_create( + configuration: &configuration::Configuration, + prompt_request: models::PromptRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_prompt_request = prompt_request; + + let uri_str = format!("{}/stages/prompt/prompts/preview/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_prompt_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PromptChallenge`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PromptChallenge`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Prompt Viewset +pub async fn stages_prompt_prompts_retrieve( + configuration: &configuration::Configuration, + prompt_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_prompt_uuid = prompt_uuid; + + let uri_str = format!( + "{}/stages/prompt/prompts/{prompt_uuid}/", + configuration.base_path, + prompt_uuid = crate::apis::urlencode(p_path_prompt_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Prompt`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Prompt`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Prompt Viewset +pub async fn stages_prompt_prompts_update( + configuration: &configuration::Configuration, + prompt_uuid: &str, + prompt_request: models::PromptRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_prompt_uuid = prompt_uuid; + let p_body_prompt_request = prompt_request; + + let uri_str = format!( + "{}/stages/prompt/prompts/{prompt_uuid}/", + configuration.base_path, + prompt_uuid = crate::apis::urlencode(p_path_prompt_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_prompt_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Prompt`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Prompt`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_prompt_prompts_used_by_list( + configuration: &configuration::Configuration, + prompt_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_prompt_uuid = prompt_uuid; + + let uri_str = format!( + "{}/stages/prompt/prompts/{prompt_uuid}/used_by/", + configuration.base_path, + prompt_uuid = crate::apis::urlencode(p_path_prompt_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PromptStage Viewset +pub async fn stages_prompt_stages_create( + configuration: &configuration::Configuration, + prompt_stage_request: models::PromptStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_prompt_stage_request = prompt_stage_request; + + let uri_str = format!("{}/stages/prompt/stages/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_prompt_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PromptStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PromptStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PromptStage Viewset +pub async fn stages_prompt_stages_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/prompt/stages/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PromptStage Viewset +pub async fn stages_prompt_stages_list( + configuration: &configuration::Configuration, + fields: Option>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + stage_uuid: Option<&str>, + validation_policies: Option>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_fields = fields; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_stage_uuid = stage_uuid; + let p_query_validation_policies = validation_policies; + + let uri_str = format!("{}/stages/prompt/stages/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_fields { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("fields".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "fields", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage_uuid { + req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_validation_policies { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("validation_policies".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "validation_policies", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedPromptStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedPromptStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PromptStage Viewset +pub async fn stages_prompt_stages_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_prompt_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_prompt_stage_request = patched_prompt_stage_request; + + let uri_str = format!( + "{}/stages/prompt/stages/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_prompt_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PromptStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PromptStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PromptStage Viewset +pub async fn stages_prompt_stages_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/prompt/stages/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PromptStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PromptStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// PromptStage Viewset +pub async fn stages_prompt_stages_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + prompt_stage_request: models::PromptStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_prompt_stage_request = prompt_stage_request; + + let uri_str = format!( + "{}/stages/prompt/stages/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_prompt_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PromptStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PromptStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_prompt_stages_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/prompt/stages/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RedirectStage Viewset +pub async fn stages_redirect_create( + configuration: &configuration::Configuration, + redirect_stage_request: models::RedirectStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_redirect_stage_request = redirect_stage_request; + + let uri_str = format!("{}/stages/redirect/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_redirect_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RedirectStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RedirectStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RedirectStage Viewset +pub async fn stages_redirect_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/redirect/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RedirectStage Viewset +pub async fn stages_redirect_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/stages/redirect/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedRedirectStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedRedirectStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RedirectStage Viewset +pub async fn stages_redirect_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_redirect_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_redirect_stage_request = patched_redirect_stage_request; + + let uri_str = format!( + "{}/stages/redirect/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_redirect_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RedirectStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RedirectStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RedirectStage Viewset +pub async fn stages_redirect_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/redirect/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RedirectStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RedirectStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// RedirectStage Viewset +pub async fn stages_redirect_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + redirect_stage_request: models::RedirectStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_redirect_stage_request = redirect_stage_request; + + let uri_str = format!( + "{}/stages/redirect/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_redirect_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::RedirectStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::RedirectStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_redirect_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/redirect/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SourceStage Viewset +pub async fn stages_source_create( + configuration: &configuration::Configuration, + source_stage_request: models::SourceStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_source_stage_request = source_stage_request; + + let uri_str = format!("{}/stages/source/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_source_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SourceStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SourceStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SourceStage Viewset +pub async fn stages_source_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/source/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SourceStage Viewset +pub async fn stages_source_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + resume_timeout: Option<&str>, + search: Option<&str>, + source: Option<&str>, + stage_uuid: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_resume_timeout = resume_timeout; + let p_query_search = search; + let p_query_source = source; + let p_query_stage_uuid = stage_uuid; + + let uri_str = format!("{}/stages/source/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_resume_timeout { + req_builder = req_builder.query(&[("resume_timeout", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_source { + req_builder = req_builder.query(&[("source", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage_uuid { + req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedSourceStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedSourceStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SourceStage Viewset +pub async fn stages_source_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_source_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_source_stage_request = patched_source_stage_request; + + let uri_str = format!( + "{}/stages/source/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_source_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SourceStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SourceStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SourceStage Viewset +pub async fn stages_source_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/source/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SourceStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SourceStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// SourceStage Viewset +pub async fn stages_source_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + source_stage_request: models::SourceStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_source_stage_request = source_stage_request; + + let uri_str = format!( + "{}/stages/source/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_source_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::SourceStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::SourceStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_source_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/source/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserDeleteStage Viewset +pub async fn stages_user_delete_create( + configuration: &configuration::Configuration, + user_delete_stage_request: models::UserDeleteStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_user_delete_stage_request = user_delete_stage_request; + + let uri_str = format!("{}/stages/user_delete/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_delete_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserDeleteStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserDeleteStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserDeleteStage Viewset +pub async fn stages_user_delete_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/user_delete/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserDeleteStage Viewset +pub async fn stages_user_delete_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + stage_uuid: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_stage_uuid = stage_uuid; + + let uri_str = format!("{}/stages/user_delete/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage_uuid { + req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedUserDeleteStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedUserDeleteStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserDeleteStage Viewset +pub async fn stages_user_delete_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_user_delete_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_user_delete_stage_request = patched_user_delete_stage_request; + + let uri_str = format!( + "{}/stages/user_delete/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_user_delete_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserDeleteStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserDeleteStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserDeleteStage Viewset +pub async fn stages_user_delete_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/user_delete/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserDeleteStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserDeleteStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserDeleteStage Viewset +pub async fn stages_user_delete_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + user_delete_stage_request: models::UserDeleteStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_user_delete_stage_request = user_delete_stage_request; + + let uri_str = format!( + "{}/stages/user_delete/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_delete_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserDeleteStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserDeleteStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_user_delete_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/user_delete/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserLoginStage Viewset +pub async fn stages_user_login_create( + configuration: &configuration::Configuration, + user_login_stage_request: models::UserLoginStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_user_login_stage_request = user_login_stage_request; + + let uri_str = format!("{}/stages/user_login/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_login_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserLoginStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserLoginStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserLoginStage Viewset +pub async fn stages_user_login_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/user_login/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserLoginStage Viewset +pub async fn stages_user_login_list( + configuration: &configuration::Configuration, + geoip_binding: Option<&str>, + name: Option<&str>, + network_binding: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + remember_device: Option<&str>, + remember_me_offset: Option<&str>, + search: Option<&str>, + session_duration: Option<&str>, + stage_uuid: Option<&str>, + terminate_other_sessions: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_geoip_binding = geoip_binding; + let p_query_name = name; + let p_query_network_binding = network_binding; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_remember_device = remember_device; + let p_query_remember_me_offset = remember_me_offset; + let p_query_search = search; + let p_query_session_duration = session_duration; + let p_query_stage_uuid = stage_uuid; + let p_query_terminate_other_sessions = terminate_other_sessions; + + let uri_str = format!("{}/stages/user_login/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_geoip_binding { + req_builder = req_builder.query(&[("geoip_binding", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_network_binding { + req_builder = req_builder.query(&[("network_binding", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_remember_device { + req_builder = req_builder.query(&[("remember_device", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_remember_me_offset { + req_builder = req_builder.query(&[("remember_me_offset", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_session_duration { + req_builder = req_builder.query(&[("session_duration", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage_uuid { + req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_terminate_other_sessions { + req_builder = req_builder.query(&[("terminate_other_sessions", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedUserLoginStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedUserLoginStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserLoginStage Viewset +pub async fn stages_user_login_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_user_login_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_user_login_stage_request = patched_user_login_stage_request; + + let uri_str = format!( + "{}/stages/user_login/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_user_login_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserLoginStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserLoginStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserLoginStage Viewset +pub async fn stages_user_login_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/user_login/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserLoginStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserLoginStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserLoginStage Viewset +pub async fn stages_user_login_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + user_login_stage_request: models::UserLoginStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_user_login_stage_request = user_login_stage_request; + + let uri_str = format!( + "{}/stages/user_login/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_login_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserLoginStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserLoginStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_user_login_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/user_login/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserLogoutStage Viewset +pub async fn stages_user_logout_create( + configuration: &configuration::Configuration, + user_logout_stage_request: models::UserLogoutStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_user_logout_stage_request = user_logout_stage_request; + + let uri_str = format!("{}/stages/user_logout/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_logout_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserLogoutStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserLogoutStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserLogoutStage Viewset +pub async fn stages_user_logout_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/user_logout/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserLogoutStage Viewset +pub async fn stages_user_logout_list( + configuration: &configuration::Configuration, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + stage_uuid: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_stage_uuid = stage_uuid; + + let uri_str = format!("{}/stages/user_logout/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage_uuid { + req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedUserLogoutStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedUserLogoutStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserLogoutStage Viewset +pub async fn stages_user_logout_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_user_logout_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_user_logout_stage_request = patched_user_logout_stage_request; + + let uri_str = format!( + "{}/stages/user_logout/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_user_logout_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserLogoutStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserLogoutStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserLogoutStage Viewset +pub async fn stages_user_logout_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/user_logout/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserLogoutStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserLogoutStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserLogoutStage Viewset +pub async fn stages_user_logout_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + user_logout_stage_request: models::UserLogoutStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_user_logout_stage_request = user_logout_stage_request; + + let uri_str = format!( + "{}/stages/user_logout/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_logout_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserLogoutStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserLogoutStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_user_logout_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/user_logout/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserWriteStage Viewset +pub async fn stages_user_write_create( + configuration: &configuration::Configuration, + user_write_stage_request: models::UserWriteStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_user_write_stage_request = user_write_stage_request; + + let uri_str = format!("{}/stages/user_write/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_write_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserWriteStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserWriteStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserWriteStage Viewset +pub async fn stages_user_write_destroy( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/user_write/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserWriteStage Viewset +pub async fn stages_user_write_list( + configuration: &configuration::Configuration, + create_users_as_inactive: Option, + create_users_group: Option<&str>, + name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, + stage_uuid: Option<&str>, + user_creation_mode: Option<&str>, + user_path_template: Option<&str>, + user_type: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_create_users_as_inactive = create_users_as_inactive; + let p_query_create_users_group = create_users_group; + let p_query_name = name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + let p_query_stage_uuid = stage_uuid; + let p_query_user_creation_mode = user_creation_mode; + let p_query_user_path_template = user_path_template; + let p_query_user_type = user_type; + + let uri_str = format!("{}/stages/user_write/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_create_users_as_inactive { + req_builder = req_builder.query(&[("create_users_as_inactive", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_create_users_group { + req_builder = req_builder.query(&[("create_users_group", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_name { + req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_stage_uuid { + req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user_creation_mode { + req_builder = req_builder.query(&[("user_creation_mode", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user_path_template { + req_builder = req_builder.query(&[("user_path_template", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_user_type { + req_builder = req_builder.query(&[("user_type", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedUserWriteStageList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedUserWriteStageList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserWriteStage Viewset +pub async fn stages_user_write_partial_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + patched_user_write_stage_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_patched_user_write_stage_request = patched_user_write_stage_request; + + let uri_str = format!( + "{}/stages/user_write/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_user_write_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserWriteStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserWriteStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserWriteStage Viewset +pub async fn stages_user_write_retrieve( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/user_write/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserWriteStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserWriteStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// UserWriteStage Viewset +pub async fn stages_user_write_update( + configuration: &configuration::Configuration, + stage_uuid: &str, + user_write_stage_request: models::UserWriteStageRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + let p_body_user_write_stage_request = user_write_stage_request; + + let uri_str = format!( + "{}/stages/user_write/{stage_uuid}/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_user_write_stage_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::UserWriteStage`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::UserWriteStage`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get a list of all objects that use this object +pub async fn stages_user_write_used_by_list( + configuration: &configuration::Configuration, + stage_uuid: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_stage_uuid = stage_uuid; + + let uri_str = format!( + "{}/stages/user_write/{stage_uuid}/used_by/", + configuration.base_path, + stage_uuid = crate::apis::urlencode(p_path_stage_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::UsedBy>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::UsedBy>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/tasks_api.rs b/packages/client-rust/src/apis/tasks_api.rs new file mode 100644 index 0000000000..9572691cb6 --- /dev/null +++ b/packages/client-rust/src/apis/tasks_api.rs @@ -0,0 +1,782 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`tasks_schedules_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TasksSchedulesListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tasks_schedules_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TasksSchedulesPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tasks_schedules_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TasksSchedulesRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tasks_schedules_send_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TasksSchedulesSendCreateError { + Status404(), + Status500(), + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tasks_schedules_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TasksSchedulesUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tasks_tasks_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TasksTasksListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tasks_tasks_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TasksTasksRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tasks_tasks_retry_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TasksTasksRetryCreateError { + Status400(), + Status404(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tasks_tasks_status_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TasksTasksStatusRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tasks_workers_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TasksWorkersListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +pub async fn tasks_schedules_list( + configuration: &configuration::Configuration, + actor_name: Option<&str>, + ordering: Option<&str>, + page: Option, + page_size: Option, + paused: Option, + rel_obj_content_type__app_label: Option<&str>, + rel_obj_content_type__model: Option<&str>, + rel_obj_id: Option<&str>, + rel_obj_id__isnull: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_actor_name = actor_name; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_paused = paused; + let p_query_rel_obj_content_type__app_label = rel_obj_content_type__app_label; + let p_query_rel_obj_content_type__model = rel_obj_content_type__model; + let p_query_rel_obj_id = rel_obj_id; + let p_query_rel_obj_id__isnull = rel_obj_id__isnull; + let p_query_search = search; + + let uri_str = format!("{}/tasks/schedules/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_actor_name { + req_builder = req_builder.query(&[("actor_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_paused { + req_builder = req_builder.query(&[("paused", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_rel_obj_content_type__app_label { + req_builder = + req_builder.query(&[("rel_obj_content_type__app_label", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_rel_obj_content_type__model { + req_builder = + req_builder.query(&[("rel_obj_content_type__model", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_rel_obj_id { + req_builder = req_builder.query(&[("rel_obj_id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_rel_obj_id__isnull { + req_builder = req_builder.query(&[("rel_obj_id__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedScheduleList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedScheduleList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn tasks_schedules_partial_update( + configuration: &configuration::Configuration, + id: &str, + patched_schedule_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_schedule_request = patched_schedule_request; + + let uri_str = format!( + "{}/tasks/schedules/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_patched_schedule_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Schedule`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Schedule`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn tasks_schedules_retrieve( + configuration: &configuration::Configuration, + id: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/tasks/schedules/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Schedule`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Schedule`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Trigger this schedule now +pub async fn tasks_schedules_send_create( + configuration: &configuration::Configuration, + id: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/tasks/schedules/{id}/send/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn tasks_schedules_update( + configuration: &configuration::Configuration, + id: &str, + schedule_request: models::ScheduleRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_schedule_request = schedule_request; + + let uri_str = format!( + "{}/tasks/schedules/{id}/", + configuration.base_path, + id = crate::apis::urlencode(p_path_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_body_schedule_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Schedule`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Schedule`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn tasks_tasks_list( + configuration: &configuration::Configuration, + actor_name: Option<&str>, + aggregated_status: Option>, + ordering: Option<&str>, + page: Option, + page_size: Option, + queue_name: Option<&str>, + rel_obj_content_type__app_label: Option<&str>, + rel_obj_content_type__model: Option<&str>, + rel_obj_id: Option<&str>, + rel_obj_id__isnull: Option, + search: Option<&str>, + state: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_actor_name = actor_name; + let p_query_aggregated_status = aggregated_status; + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_queue_name = queue_name; + let p_query_rel_obj_content_type__app_label = rel_obj_content_type__app_label; + let p_query_rel_obj_content_type__model = rel_obj_content_type__model; + let p_query_rel_obj_id = rel_obj_id; + let p_query_rel_obj_id__isnull = rel_obj_id__isnull; + let p_query_search = search; + let p_query_state = state; + + let uri_str = format!("{}/tasks/tasks/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_actor_name { + req_builder = req_builder.query(&[("actor_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_aggregated_status { + req_builder = match "multi" { + "multi" => req_builder.query( + ¶m_value + .into_iter() + .map(|p| ("aggregated_status".to_owned(), p.to_string())) + .collect::>(), + ), + _ => req_builder.query(&[( + "aggregated_status", + ¶m_value + .into_iter() + .map(|p| p.to_string()) + .collect::>() + .join(",") + .to_string(), + )]), + }; + } + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_queue_name { + req_builder = req_builder.query(&[("queue_name", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_rel_obj_content_type__app_label { + req_builder = + req_builder.query(&[("rel_obj_content_type__app_label", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_rel_obj_content_type__model { + req_builder = + req_builder.query(&[("rel_obj_content_type__model", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_rel_obj_id { + req_builder = req_builder.query(&[("rel_obj_id", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_rel_obj_id__isnull { + req_builder = req_builder.query(&[("rel_obj_id__isnull", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_state { + req_builder = req_builder.query(&[("state", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedTaskList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedTaskList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +pub async fn tasks_tasks_retrieve( + configuration: &configuration::Configuration, + message_id: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_message_id = message_id; + + let uri_str = format!( + "{}/tasks/tasks/{message_id}/", + configuration.base_path, + message_id = crate::apis::urlencode(p_path_message_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Task`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Task`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Retry task +pub async fn tasks_tasks_retry_create( + configuration: &configuration::Configuration, + message_id: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_message_id = message_id; + + let uri_str = format!( + "{}/tasks/tasks/{message_id}/retry/", + configuration.base_path, + message_id = crate::apis::urlencode(p_path_message_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Global status summary for all tasks +pub async fn tasks_tasks_status_retrieve( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!("{}/tasks/tasks/status/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::GlobalTaskStatus`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::GlobalTaskStatus`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get currently connected worker count. +pub async fn tasks_workers_list( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/tasks/workers/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `Vec<models::Worker>`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `Vec<models::Worker>`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/apis/tenants_api.rs b/packages/client-rust/src/apis/tenants_api.rs new file mode 100644 index 0000000000..5344c33ac7 --- /dev/null +++ b/packages/client-rust/src/apis/tenants_api.rs @@ -0,0 +1,948 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; + +use super::{ContentType, Error, configuration}; +use crate::{apis::ResponseContent, models}; + +/// struct for typed errors of method [`tenants_domains_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TenantsDomainsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tenants_domains_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TenantsDomainsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tenants_domains_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TenantsDomainsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tenants_domains_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TenantsDomainsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tenants_domains_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TenantsDomainsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tenants_domains_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TenantsDomainsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tenants_tenants_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TenantsTenantsCreateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tenants_tenants_create_admin_group_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TenantsTenantsCreateAdminGroupCreateError { + Status400(), + Status404(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tenants_tenants_create_recovery_key_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TenantsTenantsCreateRecoveryKeyCreateError { + Status400(), + Status404(), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tenants_tenants_destroy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TenantsTenantsDestroyError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tenants_tenants_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TenantsTenantsListError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tenants_tenants_partial_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TenantsTenantsPartialUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tenants_tenants_retrieve`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TenantsTenantsRetrieveError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`tenants_tenants_update`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TenantsTenantsUpdateError { + Status400(models::ValidationError), + Status403(models::GenericError), + UnknownValue(serde_json::Value), +} + +/// Domain ViewSet +pub async fn tenants_domains_create( + configuration: &configuration::Configuration, + domain_request: models::DomainRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_domain_request = domain_request; + + let uri_str = format!("{}/tenants/domains/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + req_builder = req_builder.json(&p_body_domain_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Domain`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Domain`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Domain ViewSet +pub async fn tenants_domains_destroy( + configuration: &configuration::Configuration, + id: i32, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/tenants/domains/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Domain ViewSet +pub async fn tenants_domains_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/tenants/domains/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedDomainList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedDomainList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Domain ViewSet +pub async fn tenants_domains_partial_update( + configuration: &configuration::Configuration, + id: i32, + patched_domain_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_patched_domain_request = patched_domain_request; + + let uri_str = format!( + "{}/tenants/domains/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + req_builder = req_builder.json(&p_body_patched_domain_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Domain`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Domain`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Domain ViewSet +pub async fn tenants_domains_retrieve( + configuration: &configuration::Configuration, + id: i32, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + + let uri_str = format!( + "{}/tenants/domains/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Domain`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Domain`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Domain ViewSet +pub async fn tenants_domains_update( + configuration: &configuration::Configuration, + id: i32, + domain_request: models::DomainRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_id = id; + let p_body_domain_request = domain_request; + + let uri_str = format!( + "{}/tenants/domains/{id}/", + configuration.base_path, + id = p_path_id + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + req_builder = req_builder.json(&p_body_domain_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Domain`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Domain`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Tenant Viewset +pub async fn tenants_tenants_create( + configuration: &configuration::Configuration, + tenant_request: models::TenantRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_body_tenant_request = tenant_request; + + let uri_str = format!("{}/tenants/tenants/", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + req_builder = req_builder.json(&p_body_tenant_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Tenant`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Tenant`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Create admin group and add user to it. +pub async fn tenants_tenants_create_admin_group_create( + configuration: &configuration::Configuration, + tenant_uuid: &str, + tenant_admin_group_request_request: models::TenantAdminGroupRequestRequest, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_tenant_uuid = tenant_uuid; + let p_body_tenant_admin_group_request_request = tenant_admin_group_request_request; + + let uri_str = format!( + "{}/tenants/tenants/{tenant_uuid}/create_admin_group/", + configuration.base_path, + tenant_uuid = crate::apis::urlencode(p_path_tenant_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + req_builder = req_builder.json(&p_body_tenant_admin_group_request_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Create recovery key for user. +pub async fn tenants_tenants_create_recovery_key_create( + configuration: &configuration::Configuration, + tenant_uuid: &str, + tenant_recovery_key_request_request: models::TenantRecoveryKeyRequestRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_tenant_uuid = tenant_uuid; + let p_body_tenant_recovery_key_request_request = tenant_recovery_key_request_request; + + let uri_str = format!( + "{}/tenants/tenants/{tenant_uuid}/create_recovery_key/", + configuration.base_path, + tenant_uuid = crate::apis::urlencode(p_path_tenant_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + req_builder = req_builder.json(&p_body_tenant_recovery_key_request_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::TenantRecoveryKeyResponse`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::TenantRecoveryKeyResponse`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = + serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Tenant Viewset +pub async fn tenants_tenants_destroy( + configuration: &configuration::Configuration, + tenant_uuid: &str, +) -> Result<(), Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_tenant_uuid = tenant_uuid; + + let uri_str = format!( + "{}/tenants/tenants/{tenant_uuid}/", + configuration.base_path, + tenant_uuid = crate::apis::urlencode(p_path_tenant_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + Ok(()) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Tenant Viewset +pub async fn tenants_tenants_list( + configuration: &configuration::Configuration, + ordering: Option<&str>, + page: Option, + page_size: Option, + search: Option<&str>, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query_ordering = ordering; + let p_query_page = page; + let p_query_page_size = page_size; + let p_query_search = search; + + let uri_str = format!("{}/tenants/tenants/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_query_ordering { + req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_page_size { + req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_query_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::PaginatedTenantList`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::PaginatedTenantList`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Tenant Viewset +pub async fn tenants_tenants_partial_update( + configuration: &configuration::Configuration, + tenant_uuid: &str, + patched_tenant_request: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_tenant_uuid = tenant_uuid; + let p_body_patched_tenant_request = patched_tenant_request; + + let uri_str = format!( + "{}/tenants/tenants/{tenant_uuid}/", + configuration.base_path, + tenant_uuid = crate::apis::urlencode(p_path_tenant_uuid) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + req_builder = req_builder.json(&p_body_patched_tenant_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Tenant`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Tenant`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Tenant Viewset +pub async fn tenants_tenants_retrieve( + configuration: &configuration::Configuration, + tenant_uuid: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_tenant_uuid = tenant_uuid; + + let uri_str = format!( + "{}/tenants/tenants/{tenant_uuid}/", + configuration.base_path, + tenant_uuid = crate::apis::urlencode(p_path_tenant_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Tenant`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Tenant`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Tenant Viewset +pub async fn tenants_tenants_update( + configuration: &configuration::Configuration, + tenant_uuid: &str, + tenant_request: models::TenantRequest, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_path_tenant_uuid = tenant_uuid; + let p_body_tenant_request = tenant_request; + + let uri_str = format!( + "{}/tenants/tenants/{tenant_uuid}/", + configuration.base_path, + tenant_uuid = crate::apis::urlencode(p_path_tenant_uuid) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + req_builder = req_builder.json(&p_body_tenant_request); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => { + return Err(Error::from(serde_json::Error::custom( + "Received `text/plain` content type response that cannot be converted to \ + `models::Tenant`", + ))); + } + ContentType::Unsupported(unknown_type) => { + return Err(Error::from(serde_json::Error::custom(format!( + "Received `{unknown_type}` content type response that cannot be converted to \ + `models::Tenant`" + )))); + } + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/packages/client-rust/src/lib.rs b/packages/client-rust/src/lib.rs new file mode 100644 index 0000000000..9556a0a134 --- /dev/null +++ b/packages/client-rust/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(unused_imports)] +#![allow(clippy::too_many_arguments)] + +extern crate reqwest; +extern crate serde; +extern crate serde_json; +extern crate serde_repr; +extern crate url; + +pub mod apis; +pub mod models; diff --git a/packages/client-rust/src/models/access_denied_challenge.rs b/packages/client-rust/src/models/access_denied_challenge.rs new file mode 100644 index 0000000000..9ccb1e742c --- /dev/null +++ b/packages/client-rust/src/models/access_denied_challenge.rs @@ -0,0 +1,42 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AccessDeniedChallenge : Challenge when a flow's active stage calls `stage_invalid()`. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AccessDeniedChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "pending_user")] + pub pending_user: String, + #[serde(rename = "pending_user_avatar")] + pub pending_user_avatar: String, + #[serde(rename = "error_message", skip_serializing_if = "Option::is_none")] + pub error_message: Option, +} + +impl AccessDeniedChallenge { + /// Challenge when a flow's active stage calls `stage_invalid()`. + pub fn new(pending_user: String, pending_user_avatar: String) -> AccessDeniedChallenge { + AccessDeniedChallenge { + flow_info: None, + component: None, + response_errors: None, + pending_user, + pending_user_avatar, + error_message: None, + } + } +} diff --git a/packages/client-rust/src/models/agent_authentication_response.rs b/packages/client-rust/src/models/agent_authentication_response.rs new file mode 100644 index 0000000000..5bc5577065 --- /dev/null +++ b/packages/client-rust/src/models/agent_authentication_response.rs @@ -0,0 +1,26 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AgentAuthenticationResponse : Base serializer class which doesn't implement create/update +/// methods +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AgentAuthenticationResponse { + #[serde(rename = "url")] + pub url: String, +} + +impl AgentAuthenticationResponse { + /// Base serializer class which doesn't implement create/update methods + pub fn new(url: String) -> AgentAuthenticationResponse { + AgentAuthenticationResponse { url } + } +} diff --git a/packages/client-rust/src/models/agent_config.rs b/packages/client-rust/src/models/agent_config.rs new file mode 100644 index 0000000000..7710d65414 --- /dev/null +++ b/packages/client-rust/src/models/agent_config.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AgentConfig : Base serializer class which doesn't implement create/update methods +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AgentConfig { + #[serde(rename = "device_id")] + pub device_id: String, + #[serde(rename = "refresh_interval")] + pub refresh_interval: i32, + #[serde( + rename = "authorization_flow", + deserialize_with = "Option::deserialize" + )] + pub authorization_flow: Option, + #[serde(rename = "jwks_auth")] + pub jwks_auth: std::collections::HashMap, + #[serde(rename = "jwks_challenge", deserialize_with = "Option::deserialize")] + pub jwks_challenge: Option>, + #[serde(rename = "nss_uid_offset")] + pub nss_uid_offset: i32, + #[serde(rename = "nss_gid_offset")] + pub nss_gid_offset: i32, + #[serde(rename = "auth_terminate_session_on_expiry")] + pub auth_terminate_session_on_expiry: bool, + #[serde(rename = "system_config")] + pub system_config: models::Config, + #[serde(rename = "license_status", deserialize_with = "Option::deserialize")] + pub license_status: Option, +} + +impl AgentConfig { + /// Base serializer class which doesn't implement create/update methods + pub fn new( + device_id: String, + refresh_interval: i32, + authorization_flow: Option, + jwks_auth: std::collections::HashMap, + jwks_challenge: Option>, + nss_uid_offset: i32, + nss_gid_offset: i32, + auth_terminate_session_on_expiry: bool, + system_config: models::Config, + license_status: Option, + ) -> AgentConfig { + AgentConfig { + device_id, + refresh_interval, + authorization_flow, + jwks_auth, + jwks_challenge, + nss_uid_offset, + nss_gid_offset, + auth_terminate_session_on_expiry, + system_config, + license_status, + } + } +} diff --git a/packages/client-rust/src/models/agent_connector.rs b/packages/client-rust/src/models/agent_connector.rs new file mode 100644 index 0000000000..c04b03ad63 --- /dev/null +++ b/packages/client-rust/src/models/agent_connector.rs @@ -0,0 +1,111 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AgentConnector { + #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] + pub connector_uuid: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "snapshot_expiry", skip_serializing_if = "Option::is_none")] + pub snapshot_expiry: Option, + #[serde( + rename = "auth_session_duration", + skip_serializing_if = "Option::is_none" + )] + pub auth_session_duration: Option, + #[serde( + rename = "auth_terminate_session_on_expiry", + skip_serializing_if = "Option::is_none" + )] + pub auth_terminate_session_on_expiry: Option, + #[serde(rename = "refresh_interval", skip_serializing_if = "Option::is_none")] + pub refresh_interval: Option, + #[serde( + rename = "authorization_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authorization_flow: Option>, + #[serde(rename = "nss_uid_offset", skip_serializing_if = "Option::is_none")] + pub nss_uid_offset: Option, + #[serde(rename = "nss_gid_offset", skip_serializing_if = "Option::is_none")] + pub nss_gid_offset: Option, + #[serde( + rename = "challenge_key", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub challenge_key: Option>, + #[serde( + rename = "challenge_idle_timeout", + skip_serializing_if = "Option::is_none" + )] + pub challenge_idle_timeout: Option, + #[serde( + rename = "challenge_trigger_check_in", + skip_serializing_if = "Option::is_none" + )] + pub challenge_trigger_check_in: Option, + #[serde( + rename = "jwt_federation_providers", + skip_serializing_if = "Option::is_none" + )] + pub jwt_federation_providers: Option>, +} + +impl AgentConnector { + pub fn new( + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> AgentConnector { + AgentConnector { + connector_uuid: None, + name, + enabled: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + snapshot_expiry: None, + auth_session_duration: None, + auth_terminate_session_on_expiry: None, + refresh_interval: None, + authorization_flow: None, + nss_uid_offset: None, + nss_gid_offset: None, + challenge_key: None, + challenge_idle_timeout: None, + challenge_trigger_check_in: None, + jwt_federation_providers: None, + } + } +} diff --git a/packages/client-rust/src/models/agent_connector_request.rs b/packages/client-rust/src/models/agent_connector_request.rs new file mode 100644 index 0000000000..07ba352da2 --- /dev/null +++ b/packages/client-rust/src/models/agent_connector_request.rs @@ -0,0 +1,89 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AgentConnectorRequest { + #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] + pub connector_uuid: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "snapshot_expiry", skip_serializing_if = "Option::is_none")] + pub snapshot_expiry: Option, + #[serde( + rename = "auth_session_duration", + skip_serializing_if = "Option::is_none" + )] + pub auth_session_duration: Option, + #[serde( + rename = "auth_terminate_session_on_expiry", + skip_serializing_if = "Option::is_none" + )] + pub auth_terminate_session_on_expiry: Option, + #[serde(rename = "refresh_interval", skip_serializing_if = "Option::is_none")] + pub refresh_interval: Option, + #[serde( + rename = "authorization_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authorization_flow: Option>, + #[serde(rename = "nss_uid_offset", skip_serializing_if = "Option::is_none")] + pub nss_uid_offset: Option, + #[serde(rename = "nss_gid_offset", skip_serializing_if = "Option::is_none")] + pub nss_gid_offset: Option, + #[serde( + rename = "challenge_key", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub challenge_key: Option>, + #[serde( + rename = "challenge_idle_timeout", + skip_serializing_if = "Option::is_none" + )] + pub challenge_idle_timeout: Option, + #[serde( + rename = "challenge_trigger_check_in", + skip_serializing_if = "Option::is_none" + )] + pub challenge_trigger_check_in: Option, + #[serde( + rename = "jwt_federation_providers", + skip_serializing_if = "Option::is_none" + )] + pub jwt_federation_providers: Option>, +} + +impl AgentConnectorRequest { + pub fn new(name: String) -> AgentConnectorRequest { + AgentConnectorRequest { + connector_uuid: None, + name, + enabled: None, + snapshot_expiry: None, + auth_session_duration: None, + auth_terminate_session_on_expiry: None, + refresh_interval: None, + authorization_flow: None, + nss_uid_offset: None, + nss_gid_offset: None, + challenge_key: None, + challenge_idle_timeout: None, + challenge_trigger_check_in: None, + jwt_federation_providers: None, + } + } +} diff --git a/packages/client-rust/src/models/agent_psso_device_registration_request.rs b/packages/client-rust/src/models/agent_psso_device_registration_request.rs new file mode 100644 index 0000000000..c502edc105 --- /dev/null +++ b/packages/client-rust/src/models/agent_psso_device_registration_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AgentPssoDeviceRegistrationRequest : Register Apple device via Platform SSO +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AgentPssoDeviceRegistrationRequest { + #[serde(rename = "device_signing_key")] + pub device_signing_key: String, + #[serde(rename = "device_encryption_key")] + pub device_encryption_key: String, + #[serde(rename = "sign_key_id")] + pub sign_key_id: String, + #[serde(rename = "enc_key_id")] + pub enc_key_id: String, +} + +impl AgentPssoDeviceRegistrationRequest { + /// Register Apple device via Platform SSO + pub fn new( + device_signing_key: String, + device_encryption_key: String, + sign_key_id: String, + enc_key_id: String, + ) -> AgentPssoDeviceRegistrationRequest { + AgentPssoDeviceRegistrationRequest { + device_signing_key, + device_encryption_key, + sign_key_id, + enc_key_id, + } + } +} diff --git a/packages/client-rust/src/models/agent_psso_device_registration_response.rs b/packages/client-rust/src/models/agent_psso_device_registration_response.rs new file mode 100644 index 0000000000..35a52ed2e6 --- /dev/null +++ b/packages/client-rust/src/models/agent_psso_device_registration_response.rs @@ -0,0 +1,49 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AgentPssoDeviceRegistrationResponse : authentik settings for Platform SSO tokens +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AgentPssoDeviceRegistrationResponse { + #[serde(rename = "client_id")] + pub client_id: String, + #[serde(rename = "issuer")] + pub issuer: String, + #[serde(rename = "token_endpoint")] + pub token_endpoint: String, + #[serde(rename = "jwks_endpoint")] + pub jwks_endpoint: String, + #[serde(rename = "audience")] + pub audience: String, + #[serde(rename = "nonce_endpoint")] + pub nonce_endpoint: String, +} + +impl AgentPssoDeviceRegistrationResponse { + /// authentik settings for Platform SSO tokens + pub fn new( + client_id: String, + issuer: String, + token_endpoint: String, + jwks_endpoint: String, + audience: String, + nonce_endpoint: String, + ) -> AgentPssoDeviceRegistrationResponse { + AgentPssoDeviceRegistrationResponse { + client_id, + issuer, + token_endpoint, + jwks_endpoint, + audience, + nonce_endpoint, + } + } +} diff --git a/packages/client-rust/src/models/agent_psso_user_registration_request.rs b/packages/client-rust/src/models/agent_psso_user_registration_request.rs new file mode 100644 index 0000000000..ea5ddfd340 --- /dev/null +++ b/packages/client-rust/src/models/agent_psso_user_registration_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AgentPssoUserRegistrationRequest : Register Apple device user via Platform SSO +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AgentPssoUserRegistrationRequest { + #[serde(rename = "user_auth")] + pub user_auth: String, + #[serde(rename = "user_secure_enclave_key")] + pub user_secure_enclave_key: String, + #[serde(rename = "enclave_key_id")] + pub enclave_key_id: String, +} + +impl AgentPssoUserRegistrationRequest { + /// Register Apple device user via Platform SSO + pub fn new( + user_auth: String, + user_secure_enclave_key: String, + enclave_key_id: String, + ) -> AgentPssoUserRegistrationRequest { + AgentPssoUserRegistrationRequest { + user_auth, + user_secure_enclave_key, + enclave_key_id, + } + } +} diff --git a/packages/client-rust/src/models/agent_token_response.rs b/packages/client-rust/src/models/agent_token_response.rs new file mode 100644 index 0000000000..b48efc6093 --- /dev/null +++ b/packages/client-rust/src/models/agent_token_response.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AgentTokenResponse : Base serializer class which doesn't implement create/update methods +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AgentTokenResponse { + #[serde(rename = "token")] + pub token: String, + #[serde(rename = "expires_in", skip_serializing_if = "Option::is_none")] + pub expires_in: Option, +} + +impl AgentTokenResponse { + /// Base serializer class which doesn't implement create/update methods + pub fn new(token: String) -> AgentTokenResponse { + AgentTokenResponse { + token, + expires_in: None, + } + } +} diff --git a/packages/client-rust/src/models/alg_enum.rs b/packages/client-rust/src/models/alg_enum.rs new file mode 100644 index 0000000000..97a9d00e86 --- /dev/null +++ b/packages/client-rust/src/models/alg_enum.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AlgEnum { + #[serde(rename = "rsa")] + Rsa, + #[serde(rename = "ecdsa")] + Ecdsa, + #[serde(rename = "ed25519")] + Ed25519, + #[serde(rename = "ed448")] + Ed448, +} + +impl std::fmt::Display for AlgEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Rsa => write!(f, "rsa"), + Self::Ecdsa => write!(f, "ecdsa"), + Self::Ed25519 => write!(f, "ed25519"), + Self::Ed448 => write!(f, "ed448"), + } + } +} + +impl Default for AlgEnum { + fn default() -> AlgEnum { + Self::Rsa + } +} diff --git a/packages/client-rust/src/models/app.rs b/packages/client-rust/src/models/app.rs new file mode 100644 index 0000000000..f55e532846 --- /dev/null +++ b/packages/client-rust/src/models/app.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// App : Serialize Application info +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct App { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "label")] + pub label: String, +} + +impl App { + /// Serialize Application info + pub fn new(name: String, label: String) -> App { + App { name, label } + } +} diff --git a/packages/client-rust/src/models/app_enum.rs b/packages/client-rust/src/models/app_enum.rs new file mode 100644 index 0000000000..66fcaf32ea --- /dev/null +++ b/packages/client-rust/src/models/app_enum.rs @@ -0,0 +1,309 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AppEnum { + #[serde(rename = "authentik.commands")] + AuthentikCommands, + #[serde(rename = "authentik.tenants")] + AuthentikTenants, + #[serde(rename = "authentik.tasks")] + AuthentikTasks, + #[serde(rename = "authentik.admin")] + AuthentikAdmin, + #[serde(rename = "authentik.api")] + AuthentikApi, + #[serde(rename = "authentik.core")] + AuthentikCore, + #[serde(rename = "authentik.crypto")] + AuthentikCrypto, + #[serde(rename = "authentik.endpoints")] + AuthentikEndpoints, + #[serde(rename = "authentik.endpoints.connectors.agent")] + AuthentikEndpointsConnectorsAgent, + #[serde(rename = "authentik.enterprise")] + AuthentikEnterprise, + #[serde(rename = "authentik.events")] + AuthentikEvents, + #[serde(rename = "authentik.admin.files")] + AuthentikAdminFiles, + #[serde(rename = "authentik.flows")] + AuthentikFlows, + #[serde(rename = "authentik.outposts")] + AuthentikOutposts, + #[serde(rename = "authentik.policies.dummy")] + AuthentikPoliciesDummy, + #[serde(rename = "authentik.policies.event_matcher")] + AuthentikPoliciesEventMatcher, + #[serde(rename = "authentik.policies.expiry")] + AuthentikPoliciesExpiry, + #[serde(rename = "authentik.policies.expression")] + AuthentikPoliciesExpression, + #[serde(rename = "authentik.policies.geoip")] + AuthentikPoliciesGeoip, + #[serde(rename = "authentik.policies.password")] + AuthentikPoliciesPassword, + #[serde(rename = "authentik.policies.reputation")] + AuthentikPoliciesReputation, + #[serde(rename = "authentik.policies")] + AuthentikPolicies, + #[serde(rename = "authentik.providers.ldap")] + AuthentikProvidersLdap, + #[serde(rename = "authentik.providers.oauth2")] + AuthentikProvidersOauth2, + #[serde(rename = "authentik.providers.proxy")] + AuthentikProvidersProxy, + #[serde(rename = "authentik.providers.rac")] + AuthentikProvidersRac, + #[serde(rename = "authentik.providers.radius")] + AuthentikProvidersRadius, + #[serde(rename = "authentik.providers.saml")] + AuthentikProvidersSaml, + #[serde(rename = "authentik.providers.scim")] + AuthentikProvidersScim, + #[serde(rename = "authentik.rbac")] + AuthentikRbac, + #[serde(rename = "authentik.recovery")] + AuthentikRecovery, + #[serde(rename = "authentik.sources.kerberos")] + AuthentikSourcesKerberos, + #[serde(rename = "authentik.sources.ldap")] + AuthentikSourcesLdap, + #[serde(rename = "authentik.sources.oauth")] + AuthentikSourcesOauth, + #[serde(rename = "authentik.sources.plex")] + AuthentikSourcesPlex, + #[serde(rename = "authentik.sources.saml")] + AuthentikSourcesSaml, + #[serde(rename = "authentik.sources.scim")] + AuthentikSourcesScim, + #[serde(rename = "authentik.sources.telegram")] + AuthentikSourcesTelegram, + #[serde(rename = "authentik.stages.authenticator")] + AuthentikStagesAuthenticator, + #[serde(rename = "authentik.stages.authenticator_duo")] + AuthentikStagesAuthenticatorDuo, + #[serde(rename = "authentik.stages.authenticator_email")] + AuthentikStagesAuthenticatorEmail, + #[serde(rename = "authentik.stages.authenticator_sms")] + AuthentikStagesAuthenticatorSms, + #[serde(rename = "authentik.stages.authenticator_static")] + AuthentikStagesAuthenticatorStatic, + #[serde(rename = "authentik.stages.authenticator_totp")] + AuthentikStagesAuthenticatorTotp, + #[serde(rename = "authentik.stages.authenticator_validate")] + AuthentikStagesAuthenticatorValidate, + #[serde(rename = "authentik.stages.authenticator_webauthn")] + AuthentikStagesAuthenticatorWebauthn, + #[serde(rename = "authentik.stages.captcha")] + AuthentikStagesCaptcha, + #[serde(rename = "authentik.stages.consent")] + AuthentikStagesConsent, + #[serde(rename = "authentik.stages.deny")] + AuthentikStagesDeny, + #[serde(rename = "authentik.stages.dummy")] + AuthentikStagesDummy, + #[serde(rename = "authentik.stages.email")] + AuthentikStagesEmail, + #[serde(rename = "authentik.stages.identification")] + AuthentikStagesIdentification, + #[serde(rename = "authentik.stages.invitation")] + AuthentikStagesInvitation, + #[serde(rename = "authentik.stages.password")] + AuthentikStagesPassword, + #[serde(rename = "authentik.stages.prompt")] + AuthentikStagesPrompt, + #[serde(rename = "authentik.stages.redirect")] + AuthentikStagesRedirect, + #[serde(rename = "authentik.stages.user_delete")] + AuthentikStagesUserDelete, + #[serde(rename = "authentik.stages.user_login")] + AuthentikStagesUserLogin, + #[serde(rename = "authentik.stages.user_logout")] + AuthentikStagesUserLogout, + #[serde(rename = "authentik.stages.user_write")] + AuthentikStagesUserWrite, + #[serde(rename = "authentik.tasks.schedules")] + AuthentikTasksSchedules, + #[serde(rename = "authentik.brands")] + AuthentikBrands, + #[serde(rename = "authentik.blueprints")] + AuthentikBlueprints, + #[serde(rename = "authentik.enterprise.audit")] + AuthentikEnterpriseAudit, + #[serde(rename = "authentik.enterprise.endpoints.connectors.agent")] + AuthentikEnterpriseEndpointsConnectorsAgent, + #[serde(rename = "authentik.enterprise.endpoints.connectors.fleet")] + AuthentikEnterpriseEndpointsConnectorsFleet, + #[serde(rename = "authentik.enterprise.endpoints.connectors.google_chrome")] + AuthentikEnterpriseEndpointsConnectorsGoogleChrome, + #[serde(rename = "authentik.enterprise.lifecycle")] + AuthentikEnterpriseLifecycle, + #[serde(rename = "authentik.enterprise.policies.unique_password")] + AuthentikEnterprisePoliciesUniquePassword, + #[serde(rename = "authentik.enterprise.providers.google_workspace")] + AuthentikEnterpriseProvidersGoogleWorkspace, + #[serde(rename = "authentik.enterprise.providers.microsoft_entra")] + AuthentikEnterpriseProvidersMicrosoftEntra, + #[serde(rename = "authentik.enterprise.providers.radius")] + AuthentikEnterpriseProvidersRadius, + #[serde(rename = "authentik.enterprise.providers.scim")] + AuthentikEnterpriseProvidersScim, + #[serde(rename = "authentik.enterprise.providers.ssf")] + AuthentikEnterpriseProvidersSsf, + #[serde(rename = "authentik.enterprise.providers.ws_federation")] + AuthentikEnterpriseProvidersWsFederation, + #[serde(rename = "authentik.enterprise.reports")] + AuthentikEnterpriseReports, + #[serde(rename = "authentik.enterprise.search")] + AuthentikEnterpriseSearch, + #[serde(rename = "authentik.enterprise.stages.authenticator_endpoint_gdtc")] + AuthentikEnterpriseStagesAuthenticatorEndpointGdtc, + #[serde(rename = "authentik.enterprise.stages.mtls")] + AuthentikEnterpriseStagesMtls, + #[serde(rename = "authentik.enterprise.stages.source")] + AuthentikEnterpriseStagesSource, +} + +impl std::fmt::Display for AppEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::AuthentikCommands => write!(f, "authentik.commands"), + Self::AuthentikTenants => write!(f, "authentik.tenants"), + Self::AuthentikTasks => write!(f, "authentik.tasks"), + Self::AuthentikAdmin => write!(f, "authentik.admin"), + Self::AuthentikApi => write!(f, "authentik.api"), + Self::AuthentikCore => write!(f, "authentik.core"), + Self::AuthentikCrypto => write!(f, "authentik.crypto"), + Self::AuthentikEndpoints => write!(f, "authentik.endpoints"), + Self::AuthentikEndpointsConnectorsAgent => { + write!(f, "authentik.endpoints.connectors.agent") + } + Self::AuthentikEnterprise => write!(f, "authentik.enterprise"), + Self::AuthentikEvents => write!(f, "authentik.events"), + Self::AuthentikAdminFiles => write!(f, "authentik.admin.files"), + Self::AuthentikFlows => write!(f, "authentik.flows"), + Self::AuthentikOutposts => write!(f, "authentik.outposts"), + Self::AuthentikPoliciesDummy => write!(f, "authentik.policies.dummy"), + Self::AuthentikPoliciesEventMatcher => write!(f, "authentik.policies.event_matcher"), + Self::AuthentikPoliciesExpiry => write!(f, "authentik.policies.expiry"), + Self::AuthentikPoliciesExpression => write!(f, "authentik.policies.expression"), + Self::AuthentikPoliciesGeoip => write!(f, "authentik.policies.geoip"), + Self::AuthentikPoliciesPassword => write!(f, "authentik.policies.password"), + Self::AuthentikPoliciesReputation => write!(f, "authentik.policies.reputation"), + Self::AuthentikPolicies => write!(f, "authentik.policies"), + Self::AuthentikProvidersLdap => write!(f, "authentik.providers.ldap"), + Self::AuthentikProvidersOauth2 => write!(f, "authentik.providers.oauth2"), + Self::AuthentikProvidersProxy => write!(f, "authentik.providers.proxy"), + Self::AuthentikProvidersRac => write!(f, "authentik.providers.rac"), + Self::AuthentikProvidersRadius => write!(f, "authentik.providers.radius"), + Self::AuthentikProvidersSaml => write!(f, "authentik.providers.saml"), + Self::AuthentikProvidersScim => write!(f, "authentik.providers.scim"), + Self::AuthentikRbac => write!(f, "authentik.rbac"), + Self::AuthentikRecovery => write!(f, "authentik.recovery"), + Self::AuthentikSourcesKerberos => write!(f, "authentik.sources.kerberos"), + Self::AuthentikSourcesLdap => write!(f, "authentik.sources.ldap"), + Self::AuthentikSourcesOauth => write!(f, "authentik.sources.oauth"), + Self::AuthentikSourcesPlex => write!(f, "authentik.sources.plex"), + Self::AuthentikSourcesSaml => write!(f, "authentik.sources.saml"), + Self::AuthentikSourcesScim => write!(f, "authentik.sources.scim"), + Self::AuthentikSourcesTelegram => write!(f, "authentik.sources.telegram"), + Self::AuthentikStagesAuthenticator => write!(f, "authentik.stages.authenticator"), + Self::AuthentikStagesAuthenticatorDuo => { + write!(f, "authentik.stages.authenticator_duo") + } + Self::AuthentikStagesAuthenticatorEmail => { + write!(f, "authentik.stages.authenticator_email") + } + Self::AuthentikStagesAuthenticatorSms => { + write!(f, "authentik.stages.authenticator_sms") + } + Self::AuthentikStagesAuthenticatorStatic => { + write!(f, "authentik.stages.authenticator_static") + } + Self::AuthentikStagesAuthenticatorTotp => { + write!(f, "authentik.stages.authenticator_totp") + } + Self::AuthentikStagesAuthenticatorValidate => { + write!(f, "authentik.stages.authenticator_validate") + } + Self::AuthentikStagesAuthenticatorWebauthn => { + write!(f, "authentik.stages.authenticator_webauthn") + } + Self::AuthentikStagesCaptcha => write!(f, "authentik.stages.captcha"), + Self::AuthentikStagesConsent => write!(f, "authentik.stages.consent"), + Self::AuthentikStagesDeny => write!(f, "authentik.stages.deny"), + Self::AuthentikStagesDummy => write!(f, "authentik.stages.dummy"), + Self::AuthentikStagesEmail => write!(f, "authentik.stages.email"), + Self::AuthentikStagesIdentification => write!(f, "authentik.stages.identification"), + Self::AuthentikStagesInvitation => write!(f, "authentik.stages.invitation"), + Self::AuthentikStagesPassword => write!(f, "authentik.stages.password"), + Self::AuthentikStagesPrompt => write!(f, "authentik.stages.prompt"), + Self::AuthentikStagesRedirect => write!(f, "authentik.stages.redirect"), + Self::AuthentikStagesUserDelete => write!(f, "authentik.stages.user_delete"), + Self::AuthentikStagesUserLogin => write!(f, "authentik.stages.user_login"), + Self::AuthentikStagesUserLogout => write!(f, "authentik.stages.user_logout"), + Self::AuthentikStagesUserWrite => write!(f, "authentik.stages.user_write"), + Self::AuthentikTasksSchedules => write!(f, "authentik.tasks.schedules"), + Self::AuthentikBrands => write!(f, "authentik.brands"), + Self::AuthentikBlueprints => write!(f, "authentik.blueprints"), + Self::AuthentikEnterpriseAudit => write!(f, "authentik.enterprise.audit"), + Self::AuthentikEnterpriseEndpointsConnectorsAgent => { + write!(f, "authentik.enterprise.endpoints.connectors.agent") + } + Self::AuthentikEnterpriseEndpointsConnectorsFleet => { + write!(f, "authentik.enterprise.endpoints.connectors.fleet") + } + Self::AuthentikEnterpriseEndpointsConnectorsGoogleChrome => { + write!(f, "authentik.enterprise.endpoints.connectors.google_chrome") + } + Self::AuthentikEnterpriseLifecycle => write!(f, "authentik.enterprise.lifecycle"), + Self::AuthentikEnterprisePoliciesUniquePassword => { + write!(f, "authentik.enterprise.policies.unique_password") + } + Self::AuthentikEnterpriseProvidersGoogleWorkspace => { + write!(f, "authentik.enterprise.providers.google_workspace") + } + Self::AuthentikEnterpriseProvidersMicrosoftEntra => { + write!(f, "authentik.enterprise.providers.microsoft_entra") + } + Self::AuthentikEnterpriseProvidersRadius => { + write!(f, "authentik.enterprise.providers.radius") + } + Self::AuthentikEnterpriseProvidersScim => { + write!(f, "authentik.enterprise.providers.scim") + } + Self::AuthentikEnterpriseProvidersSsf => { + write!(f, "authentik.enterprise.providers.ssf") + } + Self::AuthentikEnterpriseProvidersWsFederation => { + write!(f, "authentik.enterprise.providers.ws_federation") + } + Self::AuthentikEnterpriseReports => write!(f, "authentik.enterprise.reports"), + Self::AuthentikEnterpriseSearch => write!(f, "authentik.enterprise.search"), + Self::AuthentikEnterpriseStagesAuthenticatorEndpointGdtc => { + write!(f, "authentik.enterprise.stages.authenticator_endpoint_gdtc") + } + Self::AuthentikEnterpriseStagesMtls => write!(f, "authentik.enterprise.stages.mtls"), + Self::AuthentikEnterpriseStagesSource => { + write!(f, "authentik.enterprise.stages.source") + } + } + } +} + +impl Default for AppEnum { + fn default() -> AppEnum { + Self::AuthentikCommands + } +} diff --git a/packages/client-rust/src/models/apple_challenge_response_request.rs b/packages/client-rust/src/models/apple_challenge_response_request.rs new file mode 100644 index 0000000000..3e60474acb --- /dev/null +++ b/packages/client-rust/src/models/apple_challenge_response_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AppleChallengeResponseRequest : Pseudo class for apple response +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppleChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, +} + +impl AppleChallengeResponseRequest { + /// Pseudo class for apple response + pub fn new() -> AppleChallengeResponseRequest { + AppleChallengeResponseRequest { component: None } + } +} diff --git a/packages/client-rust/src/models/apple_login_challenge.rs b/packages/client-rust/src/models/apple_login_challenge.rs new file mode 100644 index 0000000000..d57afbc22b --- /dev/null +++ b/packages/client-rust/src/models/apple_login_challenge.rs @@ -0,0 +1,51 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AppleLoginChallenge : Special challenge for apple-native authentication flow, which happens on +/// the client. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppleLoginChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "client_id")] + pub client_id: String, + #[serde(rename = "scope")] + pub scope: String, + #[serde(rename = "redirect_uri")] + pub redirect_uri: String, + #[serde(rename = "state")] + pub state: String, +} + +impl AppleLoginChallenge { + /// Special challenge for apple-native authentication flow, which happens on the client. + pub fn new( + client_id: String, + scope: String, + redirect_uri: String, + state: String, + ) -> AppleLoginChallenge { + AppleLoginChallenge { + flow_info: None, + component: None, + response_errors: None, + client_id, + scope, + redirect_uri, + state, + } + } +} diff --git a/packages/client-rust/src/models/application.rs b/packages/client-rust/src/models/application.rs new file mode 100644 index 0000000000..3be708ba94 --- /dev/null +++ b/packages/client-rust/src/models/application.rs @@ -0,0 +1,100 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Application : Application Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Application { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Application's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal application name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde( + rename = "provider", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub provider: Option>, + #[serde(rename = "provider_obj")] + pub provider_obj: models::Provider, + #[serde( + rename = "backchannel_providers", + skip_serializing_if = "Option::is_none" + )] + pub backchannel_providers: Option>, + #[serde(rename = "backchannel_providers_obj")] + pub backchannel_providers_obj: Vec, + /// Allow formatting of launch URL + #[serde(rename = "launch_url", deserialize_with = "Option::deserialize")] + pub launch_url: Option, + /// Open launch URL in a new browser tab or window. + #[serde(rename = "open_in_new_tab", skip_serializing_if = "Option::is_none")] + pub open_in_new_tab: Option, + #[serde(rename = "meta_launch_url", skip_serializing_if = "Option::is_none")] + pub meta_launch_url: Option, + #[serde(rename = "meta_icon", skip_serializing_if = "Option::is_none")] + pub meta_icon: Option, + /// Get the URL to the App Icon image + #[serde(rename = "meta_icon_url", deserialize_with = "Option::deserialize")] + pub meta_icon_url: Option, + #[serde( + rename = "meta_icon_themed_urls", + deserialize_with = "Option::deserialize" + )] + pub meta_icon_themed_urls: Option, + #[serde(rename = "meta_description", skip_serializing_if = "Option::is_none")] + pub meta_description: Option, + #[serde(rename = "meta_publisher", skip_serializing_if = "Option::is_none")] + pub meta_publisher: Option, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + #[serde(rename = "group", skip_serializing_if = "Option::is_none")] + pub group: Option, +} + +impl Application { + /// Application Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + slug: String, + provider_obj: models::Provider, + backchannel_providers_obj: Vec, + launch_url: Option, + meta_icon_url: Option, + meta_icon_themed_urls: Option, + ) -> Application { + Application { + pk, + name, + slug, + provider: None, + provider_obj, + backchannel_providers: None, + backchannel_providers_obj, + launch_url, + open_in_new_tab: None, + meta_launch_url: None, + meta_icon: None, + meta_icon_url, + meta_icon_themed_urls, + meta_description: None, + meta_publisher: None, + policy_engine_mode: None, + group: None, + } + } +} diff --git a/packages/client-rust/src/models/application_entitlement.rs b/packages/client-rust/src/models/application_entitlement.rs new file mode 100644 index 0000000000..492164c2a2 --- /dev/null +++ b/packages/client-rust/src/models/application_entitlement.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ApplicationEntitlement : ApplicationEntitlement Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ApplicationEntitlement { + #[serde(rename = "pbm_uuid")] + pub pbm_uuid: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "app")] + pub app: uuid::Uuid, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl ApplicationEntitlement { + /// ApplicationEntitlement Serializer + pub fn new(pbm_uuid: uuid::Uuid, name: String, app: uuid::Uuid) -> ApplicationEntitlement { + ApplicationEntitlement { + pbm_uuid, + name, + app, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/application_entitlement_request.rs b/packages/client-rust/src/models/application_entitlement_request.rs new file mode 100644 index 0000000000..b950af4525 --- /dev/null +++ b/packages/client-rust/src/models/application_entitlement_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ApplicationEntitlementRequest : ApplicationEntitlement Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ApplicationEntitlementRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "app")] + pub app: uuid::Uuid, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl ApplicationEntitlementRequest { + /// ApplicationEntitlement Serializer + pub fn new(name: String, app: uuid::Uuid) -> ApplicationEntitlementRequest { + ApplicationEntitlementRequest { + name, + app, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/application_request.rs b/packages/client-rust/src/models/application_request.rs new file mode 100644 index 0000000000..236cb9f1ca --- /dev/null +++ b/packages/client-rust/src/models/application_request.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ApplicationRequest : Application Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ApplicationRequest { + /// Application's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal application name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde( + rename = "provider", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub provider: Option>, + #[serde( + rename = "backchannel_providers", + skip_serializing_if = "Option::is_none" + )] + pub backchannel_providers: Option>, + /// Open launch URL in a new browser tab or window. + #[serde(rename = "open_in_new_tab", skip_serializing_if = "Option::is_none")] + pub open_in_new_tab: Option, + #[serde(rename = "meta_launch_url", skip_serializing_if = "Option::is_none")] + pub meta_launch_url: Option, + #[serde(rename = "meta_icon", skip_serializing_if = "Option::is_none")] + pub meta_icon: Option, + #[serde(rename = "meta_description", skip_serializing_if = "Option::is_none")] + pub meta_description: Option, + #[serde(rename = "meta_publisher", skip_serializing_if = "Option::is_none")] + pub meta_publisher: Option, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + #[serde(rename = "group", skip_serializing_if = "Option::is_none")] + pub group: Option, +} + +impl ApplicationRequest { + /// Application Serializer + pub fn new(name: String, slug: String) -> ApplicationRequest { + ApplicationRequest { + name, + slug, + provider: None, + backchannel_providers: None, + open_in_new_tab: None, + meta_launch_url: None, + meta_icon: None, + meta_description: None, + meta_publisher: None, + policy_engine_mode: None, + group: None, + } + } +} diff --git a/packages/client-rust/src/models/auth_type_enum.rs b/packages/client-rust/src/models/auth_type_enum.rs new file mode 100644 index 0000000000..06f4589548 --- /dev/null +++ b/packages/client-rust/src/models/auth_type_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AuthTypeEnum { + #[serde(rename = "basic")] + Basic, + #[serde(rename = "bearer")] + Bearer, +} + +impl std::fmt::Display for AuthTypeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Basic => write!(f, "basic"), + Self::Bearer => write!(f, "bearer"), + } + } +} + +impl Default for AuthTypeEnum { + fn default() -> AuthTypeEnum { + Self::Basic + } +} diff --git a/packages/client-rust/src/models/authenticated_session.rs b/packages/client-rust/src/models/authenticated_session.rs new file mode 100644 index 0000000000..75eab0eba6 --- /dev/null +++ b/packages/client-rust/src/models/authenticated_session.rs @@ -0,0 +1,65 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatedSession : AuthenticatedSession Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatedSession { + #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")] + pub uuid: Option, + /// Check if session is currently active session + #[serde(rename = "current")] + pub current: bool, + #[serde(rename = "user_agent")] + pub user_agent: models::AuthenticatedSessionUserAgent, + #[serde(rename = "geo_ip", deserialize_with = "Option::deserialize")] + pub geo_ip: Option, + #[serde(rename = "asn", deserialize_with = "Option::deserialize")] + pub asn: Option, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "last_ip")] + pub last_ip: String, + #[serde(rename = "last_user_agent")] + pub last_user_agent: String, + #[serde(rename = "last_used")] + pub last_used: String, + #[serde(rename = "expires")] + pub expires: String, +} + +impl AuthenticatedSession { + /// AuthenticatedSession Serializer + pub fn new( + current: bool, + user_agent: models::AuthenticatedSessionUserAgent, + geo_ip: Option, + asn: Option, + user: i32, + last_ip: String, + last_user_agent: String, + last_used: String, + expires: String, + ) -> AuthenticatedSession { + AuthenticatedSession { + uuid: None, + current, + user_agent, + geo_ip, + asn, + user, + last_ip, + last_user_agent, + last_used, + expires, + } + } +} diff --git a/packages/client-rust/src/models/authenticated_session_asn.rs b/packages/client-rust/src/models/authenticated_session_asn.rs new file mode 100644 index 0000000000..fe0909d77e --- /dev/null +++ b/packages/client-rust/src/models/authenticated_session_asn.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatedSessionAsn : Get ASN Data +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatedSessionAsn { + #[serde(rename = "asn", deserialize_with = "Option::deserialize")] + pub asn: Option, + #[serde(rename = "as_org", deserialize_with = "Option::deserialize")] + pub as_org: Option, + #[serde(rename = "network", deserialize_with = "Option::deserialize")] + pub network: Option, +} + +impl AuthenticatedSessionAsn { + /// Get ASN Data + pub fn new( + asn: Option, + as_org: Option, + network: Option, + ) -> AuthenticatedSessionAsn { + AuthenticatedSessionAsn { + asn, + as_org, + network, + } + } +} diff --git a/packages/client-rust/src/models/authenticated_session_geo_ip.rs b/packages/client-rust/src/models/authenticated_session_geo_ip.rs new file mode 100644 index 0000000000..53a9442092 --- /dev/null +++ b/packages/client-rust/src/models/authenticated_session_geo_ip.rs @@ -0,0 +1,45 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatedSessionGeoIp : Get GeoIP Data +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatedSessionGeoIp { + #[serde(rename = "continent", deserialize_with = "Option::deserialize")] + pub continent: Option, + #[serde(rename = "country", deserialize_with = "Option::deserialize")] + pub country: Option, + #[serde(rename = "lat", deserialize_with = "Option::deserialize")] + pub lat: Option, + #[serde(rename = "long", deserialize_with = "Option::deserialize")] + pub long: Option, + #[serde(rename = "city")] + pub city: String, +} + +impl AuthenticatedSessionGeoIp { + /// Get GeoIP Data + pub fn new( + continent: Option, + country: Option, + lat: Option, + long: Option, + city: String, + ) -> AuthenticatedSessionGeoIp { + AuthenticatedSessionGeoIp { + continent, + country, + lat, + long, + city, + } + } +} diff --git a/packages/client-rust/src/models/authenticated_session_user_agent.rs b/packages/client-rust/src/models/authenticated_session_user_agent.rs new file mode 100644 index 0000000000..ed84a574ce --- /dev/null +++ b/packages/client-rust/src/models/authenticated_session_user_agent.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatedSessionUserAgent : Get parsed user agent +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatedSessionUserAgent { + #[serde(rename = "device")] + pub device: models::AuthenticatedSessionUserAgentDevice, + #[serde(rename = "os")] + pub os: models::AuthenticatedSessionUserAgentOs, + #[serde(rename = "user_agent")] + pub user_agent: models::AuthenticatedSessionUserAgentUserAgent, + #[serde(rename = "string")] + pub string: String, +} + +impl AuthenticatedSessionUserAgent { + /// Get parsed user agent + pub fn new( + device: models::AuthenticatedSessionUserAgentDevice, + os: models::AuthenticatedSessionUserAgentOs, + user_agent: models::AuthenticatedSessionUserAgentUserAgent, + string: String, + ) -> AuthenticatedSessionUserAgent { + AuthenticatedSessionUserAgent { + device, + os, + user_agent, + string, + } + } +} diff --git a/packages/client-rust/src/models/authenticated_session_user_agent_device.rs b/packages/client-rust/src/models/authenticated_session_user_agent_device.rs new file mode 100644 index 0000000000..f34c4da96c --- /dev/null +++ b/packages/client-rust/src/models/authenticated_session_user_agent_device.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatedSessionUserAgentDevice : User agent device +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatedSessionUserAgentDevice { + #[serde(rename = "brand")] + pub brand: String, + #[serde(rename = "family")] + pub family: String, + #[serde(rename = "model")] + pub model: String, +} + +impl AuthenticatedSessionUserAgentDevice { + /// User agent device + pub fn new( + brand: String, + family: String, + model: String, + ) -> AuthenticatedSessionUserAgentDevice { + AuthenticatedSessionUserAgentDevice { + brand, + family, + model, + } + } +} diff --git a/packages/client-rust/src/models/authenticated_session_user_agent_os.rs b/packages/client-rust/src/models/authenticated_session_user_agent_os.rs new file mode 100644 index 0000000000..e84c6746d0 --- /dev/null +++ b/packages/client-rust/src/models/authenticated_session_user_agent_os.rs @@ -0,0 +1,45 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatedSessionUserAgentOs : User agent os +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatedSessionUserAgentOs { + #[serde(rename = "family")] + pub family: String, + #[serde(rename = "major")] + pub major: String, + #[serde(rename = "minor")] + pub minor: String, + #[serde(rename = "patch")] + pub patch: String, + #[serde(rename = "patch_minor")] + pub patch_minor: String, +} + +impl AuthenticatedSessionUserAgentOs { + /// User agent os + pub fn new( + family: String, + major: String, + minor: String, + patch: String, + patch_minor: String, + ) -> AuthenticatedSessionUserAgentOs { + AuthenticatedSessionUserAgentOs { + family, + major, + minor, + patch, + patch_minor, + } + } +} diff --git a/packages/client-rust/src/models/authenticated_session_user_agent_user_agent.rs b/packages/client-rust/src/models/authenticated_session_user_agent_user_agent.rs new file mode 100644 index 0000000000..2301be4faa --- /dev/null +++ b/packages/client-rust/src/models/authenticated_session_user_agent_user_agent.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatedSessionUserAgentUserAgent : User agent browser +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatedSessionUserAgentUserAgent { + #[serde(rename = "family")] + pub family: String, + #[serde(rename = "major")] + pub major: String, + #[serde(rename = "minor")] + pub minor: String, + #[serde(rename = "patch")] + pub patch: String, +} + +impl AuthenticatedSessionUserAgentUserAgent { + /// User agent browser + pub fn new( + family: String, + major: String, + minor: String, + patch: String, + ) -> AuthenticatedSessionUserAgentUserAgent { + AuthenticatedSessionUserAgentUserAgent { + family, + major, + minor, + patch, + } + } +} diff --git a/packages/client-rust/src/models/authentication_enum.rs b/packages/client-rust/src/models/authentication_enum.rs new file mode 100644 index 0000000000..9ff4afcf0a --- /dev/null +++ b/packages/client-rust/src/models/authentication_enum.rs @@ -0,0 +1,47 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AuthenticationEnum { + #[serde(rename = "none")] + None, + #[serde(rename = "require_authenticated")] + RequireAuthenticated, + #[serde(rename = "require_unauthenticated")] + RequireUnauthenticated, + #[serde(rename = "require_superuser")] + RequireSuperuser, + #[serde(rename = "require_redirect")] + RequireRedirect, + #[serde(rename = "require_outpost")] + RequireOutpost, +} + +impl std::fmt::Display for AuthenticationEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::None => write!(f, "none"), + Self::RequireAuthenticated => write!(f, "require_authenticated"), + Self::RequireUnauthenticated => write!(f, "require_unauthenticated"), + Self::RequireSuperuser => write!(f, "require_superuser"), + Self::RequireRedirect => write!(f, "require_redirect"), + Self::RequireOutpost => write!(f, "require_outpost"), + } + } +} + +impl Default for AuthenticationEnum { + fn default() -> AuthenticationEnum { + Self::None + } +} diff --git a/packages/client-rust/src/models/authenticator_attachment_enum.rs b/packages/client-rust/src/models/authenticator_attachment_enum.rs new file mode 100644 index 0000000000..5505c66154 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_attachment_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AuthenticatorAttachmentEnum { + #[serde(rename = "platform")] + Platform, + #[serde(rename = "cross-platform")] + CrossPlatform, +} + +impl std::fmt::Display for AuthenticatorAttachmentEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Platform => write!(f, "platform"), + Self::CrossPlatform => write!(f, "cross-platform"), + } + } +} + +impl Default for AuthenticatorAttachmentEnum { + fn default() -> AuthenticatorAttachmentEnum { + Self::Platform + } +} diff --git a/packages/client-rust/src/models/authenticator_duo_challenge.rs b/packages/client-rust/src/models/authenticator_duo_challenge.rs new file mode 100644 index 0000000000..2cde9c9d95 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_duo_challenge.rs @@ -0,0 +1,54 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorDuoChallenge : Duo Challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorDuoChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "pending_user")] + pub pending_user: String, + #[serde(rename = "pending_user_avatar")] + pub pending_user_avatar: String, + #[serde(rename = "activation_barcode")] + pub activation_barcode: String, + #[serde(rename = "activation_code")] + pub activation_code: String, + #[serde(rename = "stage_uuid")] + pub stage_uuid: String, +} + +impl AuthenticatorDuoChallenge { + /// Duo Challenge + pub fn new( + pending_user: String, + pending_user_avatar: String, + activation_barcode: String, + activation_code: String, + stage_uuid: String, + ) -> AuthenticatorDuoChallenge { + AuthenticatorDuoChallenge { + flow_info: None, + component: None, + response_errors: None, + pending_user, + pending_user_avatar, + activation_barcode, + activation_code, + stage_uuid, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_duo_challenge_response_request.rs b/packages/client-rust/src/models/authenticator_duo_challenge_response_request.rs new file mode 100644 index 0000000000..be7be315b7 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_duo_challenge_response_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorDuoChallengeResponseRequest : Pseudo class for duo response +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorDuoChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, +} + +impl AuthenticatorDuoChallengeResponseRequest { + /// Pseudo class for duo response + pub fn new() -> AuthenticatorDuoChallengeResponseRequest { + AuthenticatorDuoChallengeResponseRequest { component: None } + } +} diff --git a/packages/client-rust/src/models/authenticator_duo_stage.rs b/packages/client-rust/src/models/authenticator_duo_stage.rs new file mode 100644 index 0000000000..e592fdb667 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_duo_stage.rs @@ -0,0 +1,84 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorDuoStage : AuthenticatorDuoStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorDuoStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "client_id")] + pub client_id: String, + #[serde(rename = "api_hostname")] + pub api_hostname: String, + #[serde( + rename = "admin_integration_key", + skip_serializing_if = "Option::is_none" + )] + pub admin_integration_key: Option, +} + +impl AuthenticatorDuoStage { + /// AuthenticatorDuoStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + client_id: String, + api_hostname: String, + ) -> AuthenticatorDuoStage { + AuthenticatorDuoStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + configure_flow: None, + friendly_name: None, + client_id, + api_hostname, + admin_integration_key: None, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_duo_stage_device_import_response.rs b/packages/client-rust/src/models/authenticator_duo_stage_device_import_response.rs new file mode 100644 index 0000000000..320d0bda43 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_duo_stage_device_import_response.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorDuoStageDeviceImportResponse { + #[serde(rename = "count")] + pub count: i32, + #[serde(rename = "error")] + pub error: String, +} + +impl AuthenticatorDuoStageDeviceImportResponse { + pub fn new(count: i32, error: String) -> AuthenticatorDuoStageDeviceImportResponse { + AuthenticatorDuoStageDeviceImportResponse { count, error } + } +} diff --git a/packages/client-rust/src/models/authenticator_duo_stage_manual_device_import_request.rs b/packages/client-rust/src/models/authenticator_duo_stage_manual_device_import_request.rs new file mode 100644 index 0000000000..370e0f3fd4 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_duo_stage_manual_device_import_request.rs @@ -0,0 +1,31 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorDuoStageManualDeviceImportRequest { + #[serde(rename = "duo_user_id")] + pub duo_user_id: String, + #[serde(rename = "username")] + pub username: String, +} + +impl AuthenticatorDuoStageManualDeviceImportRequest { + pub fn new( + duo_user_id: String, + username: String, + ) -> AuthenticatorDuoStageManualDeviceImportRequest { + AuthenticatorDuoStageManualDeviceImportRequest { + duo_user_id, + username, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_duo_stage_request.rs b/packages/client-rust/src/models/authenticator_duo_stage_request.rs new file mode 100644 index 0000000000..4171cb25b9 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_duo_stage_request.rs @@ -0,0 +1,63 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorDuoStageRequest : AuthenticatorDuoStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorDuoStageRequest { + #[serde(rename = "name")] + pub name: String, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "client_id")] + pub client_id: String, + #[serde(rename = "client_secret")] + pub client_secret: String, + #[serde(rename = "api_hostname")] + pub api_hostname: String, + #[serde( + rename = "admin_integration_key", + skip_serializing_if = "Option::is_none" + )] + pub admin_integration_key: Option, + #[serde(rename = "admin_secret_key", skip_serializing_if = "Option::is_none")] + pub admin_secret_key: Option, +} + +impl AuthenticatorDuoStageRequest { + /// AuthenticatorDuoStage Serializer + pub fn new( + name: String, + client_id: String, + client_secret: String, + api_hostname: String, + ) -> AuthenticatorDuoStageRequest { + AuthenticatorDuoStageRequest { + name, + configure_flow: None, + friendly_name: None, + client_id, + client_secret, + api_hostname, + admin_integration_key: None, + admin_secret_key: None, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_email_challenge.rs b/packages/client-rust/src/models/authenticator_email_challenge.rs new file mode 100644 index 0000000000..09c10e6636 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_email_challenge.rs @@ -0,0 +1,50 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorEmailChallenge : Authenticator Email Setup challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorEmailChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "pending_user")] + pub pending_user: String, + #[serde(rename = "pending_user_avatar")] + pub pending_user_avatar: String, + #[serde( + rename = "email", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub email: Option>, + #[serde(rename = "email_required", skip_serializing_if = "Option::is_none")] + pub email_required: Option, +} + +impl AuthenticatorEmailChallenge { + /// Authenticator Email Setup challenge + pub fn new(pending_user: String, pending_user_avatar: String) -> AuthenticatorEmailChallenge { + AuthenticatorEmailChallenge { + flow_info: None, + component: None, + response_errors: None, + pending_user, + pending_user_avatar, + email: None, + email_required: None, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_email_challenge_response_request.rs b/packages/client-rust/src/models/authenticator_email_challenge_response_request.rs new file mode 100644 index 0000000000..fb964607d0 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_email_challenge_response_request.rs @@ -0,0 +1,34 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorEmailChallengeResponseRequest : Authenticator Email Challenge response, device is +/// set by get_response_instance +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorEmailChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "code", skip_serializing_if = "Option::is_none")] + pub code: Option, + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, +} + +impl AuthenticatorEmailChallengeResponseRequest { + /// Authenticator Email Challenge response, device is set by get_response_instance + pub fn new() -> AuthenticatorEmailChallengeResponseRequest { + AuthenticatorEmailChallengeResponseRequest { + component: None, + code: None, + email: None, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_email_stage.rs b/packages/client-rust/src/models/authenticator_email_stage.rs new file mode 100644 index 0000000000..7b4251f9fc --- /dev/null +++ b/packages/client-rust/src/models/authenticator_email_stage.rs @@ -0,0 +1,112 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorEmailStage : AuthenticatorEmailStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorEmailStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + /// When enabled, global Email connection settings will be used and connection settings below + /// will be ignored. + #[serde( + rename = "use_global_settings", + skip_serializing_if = "Option::is_none" + )] + pub use_global_settings: Option, + #[serde(rename = "host", skip_serializing_if = "Option::is_none")] + pub host: Option, + #[serde(rename = "port", skip_serializing_if = "Option::is_none")] + pub port: Option, + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde(rename = "password", skip_serializing_if = "Option::is_none")] + pub password: Option, + #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")] + pub use_tls: Option, + #[serde(rename = "use_ssl", skip_serializing_if = "Option::is_none")] + pub use_ssl: Option, + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + #[serde(rename = "from_address", skip_serializing_if = "Option::is_none")] + pub from_address: Option, + #[serde(rename = "subject", skip_serializing_if = "Option::is_none")] + pub subject: Option, + /// Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). + #[serde(rename = "token_expiry", skip_serializing_if = "Option::is_none")] + pub token_expiry: Option, + #[serde(rename = "template", skip_serializing_if = "Option::is_none")] + pub template: Option, +} + +impl AuthenticatorEmailStage { + /// AuthenticatorEmailStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + ) -> AuthenticatorEmailStage { + AuthenticatorEmailStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + configure_flow: None, + friendly_name: None, + use_global_settings: None, + host: None, + port: None, + username: None, + password: None, + use_tls: None, + use_ssl: None, + timeout: None, + from_address: None, + subject: None, + token_expiry: None, + template: None, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_email_stage_request.rs b/packages/client-rust/src/models/authenticator_email_stage_request.rs new file mode 100644 index 0000000000..e287eb32e4 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_email_stage_request.rs @@ -0,0 +1,82 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorEmailStageRequest : AuthenticatorEmailStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorEmailStageRequest { + #[serde(rename = "name")] + pub name: String, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + /// When enabled, global Email connection settings will be used and connection settings below + /// will be ignored. + #[serde( + rename = "use_global_settings", + skip_serializing_if = "Option::is_none" + )] + pub use_global_settings: Option, + #[serde(rename = "host", skip_serializing_if = "Option::is_none")] + pub host: Option, + #[serde(rename = "port", skip_serializing_if = "Option::is_none")] + pub port: Option, + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde(rename = "password", skip_serializing_if = "Option::is_none")] + pub password: Option, + #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")] + pub use_tls: Option, + #[serde(rename = "use_ssl", skip_serializing_if = "Option::is_none")] + pub use_ssl: Option, + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + #[serde(rename = "from_address", skip_serializing_if = "Option::is_none")] + pub from_address: Option, + #[serde(rename = "subject", skip_serializing_if = "Option::is_none")] + pub subject: Option, + /// Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). + #[serde(rename = "token_expiry", skip_serializing_if = "Option::is_none")] + pub token_expiry: Option, + #[serde(rename = "template", skip_serializing_if = "Option::is_none")] + pub template: Option, +} + +impl AuthenticatorEmailStageRequest { + /// AuthenticatorEmailStage Serializer + pub fn new(name: String) -> AuthenticatorEmailStageRequest { + AuthenticatorEmailStageRequest { + name, + configure_flow: None, + friendly_name: None, + use_global_settings: None, + host: None, + port: None, + username: None, + password: None, + use_tls: None, + use_ssl: None, + timeout: None, + from_address: None, + subject: None, + token_expiry: None, + template: None, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_endpoint_gdtc_stage.rs b/packages/client-rust/src/models/authenticator_endpoint_gdtc_stage.rs new file mode 100644 index 0000000000..6dc1061c2b --- /dev/null +++ b/packages/client-rust/src/models/authenticator_endpoint_gdtc_stage.rs @@ -0,0 +1,74 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorEndpointGdtcStage : AuthenticatorEndpointGDTCStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorEndpointGdtcStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "credentials")] + pub credentials: std::collections::HashMap, +} + +impl AuthenticatorEndpointGdtcStage { + /// AuthenticatorEndpointGDTCStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + credentials: std::collections::HashMap, + ) -> AuthenticatorEndpointGdtcStage { + AuthenticatorEndpointGdtcStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + configure_flow: None, + friendly_name: None, + credentials, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_endpoint_gdtc_stage_request.rs b/packages/client-rust/src/models/authenticator_endpoint_gdtc_stage_request.rs new file mode 100644 index 0000000000..f45cfdc0a8 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_endpoint_gdtc_stage_request.rs @@ -0,0 +1,46 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorEndpointGdtcStageRequest : AuthenticatorEndpointGDTCStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorEndpointGdtcStageRequest { + #[serde(rename = "name")] + pub name: String, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "credentials")] + pub credentials: std::collections::HashMap, +} + +impl AuthenticatorEndpointGdtcStageRequest { + /// AuthenticatorEndpointGDTCStage Serializer + pub fn new( + name: String, + credentials: std::collections::HashMap, + ) -> AuthenticatorEndpointGdtcStageRequest { + AuthenticatorEndpointGdtcStageRequest { + name, + configure_flow: None, + friendly_name: None, + credentials, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_sms_challenge.rs b/packages/client-rust/src/models/authenticator_sms_challenge.rs new file mode 100644 index 0000000000..cd4c3d2cd9 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_sms_challenge.rs @@ -0,0 +1,45 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorSmsChallenge : SMS Setup challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorSmsChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "pending_user")] + pub pending_user: String, + #[serde(rename = "pending_user_avatar")] + pub pending_user_avatar: String, + #[serde( + rename = "phone_number_required", + skip_serializing_if = "Option::is_none" + )] + pub phone_number_required: Option, +} + +impl AuthenticatorSmsChallenge { + /// SMS Setup challenge + pub fn new(pending_user: String, pending_user_avatar: String) -> AuthenticatorSmsChallenge { + AuthenticatorSmsChallenge { + flow_info: None, + component: None, + response_errors: None, + pending_user, + pending_user_avatar, + phone_number_required: None, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_sms_challenge_response_request.rs b/packages/client-rust/src/models/authenticator_sms_challenge_response_request.rs new file mode 100644 index 0000000000..b1d8260456 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_sms_challenge_response_request.rs @@ -0,0 +1,34 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorSmsChallengeResponseRequest : SMS Challenge response, device is set by +/// get_response_instance +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorSmsChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "code", skip_serializing_if = "Option::is_none")] + pub code: Option, + #[serde(rename = "phone_number", skip_serializing_if = "Option::is_none")] + pub phone_number: Option, +} + +impl AuthenticatorSmsChallengeResponseRequest { + /// SMS Challenge response, device is set by get_response_instance + pub fn new() -> AuthenticatorSmsChallengeResponseRequest { + AuthenticatorSmsChallengeResponseRequest { + component: None, + code: None, + phone_number: None, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_sms_stage.rs b/packages/client-rust/src/models/authenticator_sms_stage.rs new file mode 100644 index 0000000000..6767e9a83f --- /dev/null +++ b/packages/client-rust/src/models/authenticator_sms_stage.rs @@ -0,0 +1,107 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorSmsStage : AuthenticatorSMSStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorSmsStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "provider")] + pub provider: models::ProviderEnum, + #[serde(rename = "from_number")] + pub from_number: String, + #[serde(rename = "account_sid")] + pub account_sid: String, + #[serde(rename = "auth")] + pub auth: String, + #[serde(rename = "auth_password", skip_serializing_if = "Option::is_none")] + pub auth_password: Option, + #[serde(rename = "auth_type", skip_serializing_if = "Option::is_none")] + pub auth_type: Option, + /// When enabled, the Phone number is only used during enrollment to verify the users + /// authenticity. Only a hash of the phone number is saved to ensure it is not reused in the + /// future. + #[serde(rename = "verify_only", skip_serializing_if = "Option::is_none")] + pub verify_only: Option, + /// Optionally modify the payload being sent to custom providers. + #[serde( + rename = "mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub mapping: Option>, +} + +impl AuthenticatorSmsStage { + /// AuthenticatorSMSStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + provider: models::ProviderEnum, + from_number: String, + account_sid: String, + auth: String, + ) -> AuthenticatorSmsStage { + AuthenticatorSmsStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + configure_flow: None, + friendly_name: None, + provider, + from_number, + account_sid, + auth, + auth_password: None, + auth_type: None, + verify_only: None, + mapping: None, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_sms_stage_request.rs b/packages/client-rust/src/models/authenticator_sms_stage_request.rs new file mode 100644 index 0000000000..892ec7f1dd --- /dev/null +++ b/packages/client-rust/src/models/authenticator_sms_stage_request.rs @@ -0,0 +1,79 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorSmsStageRequest : AuthenticatorSMSStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorSmsStageRequest { + #[serde(rename = "name")] + pub name: String, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "provider")] + pub provider: models::ProviderEnum, + #[serde(rename = "from_number")] + pub from_number: String, + #[serde(rename = "account_sid")] + pub account_sid: String, + #[serde(rename = "auth")] + pub auth: String, + #[serde(rename = "auth_password", skip_serializing_if = "Option::is_none")] + pub auth_password: Option, + #[serde(rename = "auth_type", skip_serializing_if = "Option::is_none")] + pub auth_type: Option, + /// When enabled, the Phone number is only used during enrollment to verify the users + /// authenticity. Only a hash of the phone number is saved to ensure it is not reused in the + /// future. + #[serde(rename = "verify_only", skip_serializing_if = "Option::is_none")] + pub verify_only: Option, + /// Optionally modify the payload being sent to custom providers. + #[serde( + rename = "mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub mapping: Option>, +} + +impl AuthenticatorSmsStageRequest { + /// AuthenticatorSMSStage Serializer + pub fn new( + name: String, + provider: models::ProviderEnum, + from_number: String, + account_sid: String, + auth: String, + ) -> AuthenticatorSmsStageRequest { + AuthenticatorSmsStageRequest { + name, + configure_flow: None, + friendly_name: None, + provider, + from_number, + account_sid, + auth, + auth_password: None, + auth_type: None, + verify_only: None, + mapping: None, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_static_challenge.rs b/packages/client-rust/src/models/authenticator_static_challenge.rs new file mode 100644 index 0000000000..829bbecfa5 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_static_challenge.rs @@ -0,0 +1,46 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorStaticChallenge : Static authenticator challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorStaticChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "pending_user")] + pub pending_user: String, + #[serde(rename = "pending_user_avatar")] + pub pending_user_avatar: String, + #[serde(rename = "codes")] + pub codes: Vec, +} + +impl AuthenticatorStaticChallenge { + /// Static authenticator challenge + pub fn new( + pending_user: String, + pending_user_avatar: String, + codes: Vec, + ) -> AuthenticatorStaticChallenge { + AuthenticatorStaticChallenge { + flow_info: None, + component: None, + response_errors: None, + pending_user, + pending_user_avatar, + codes, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_static_challenge_response_request.rs b/packages/client-rust/src/models/authenticator_static_challenge_response_request.rs new file mode 100644 index 0000000000..8c210a757b --- /dev/null +++ b/packages/client-rust/src/models/authenticator_static_challenge_response_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorStaticChallengeResponseRequest : Pseudo class for static response +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorStaticChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, +} + +impl AuthenticatorStaticChallengeResponseRequest { + /// Pseudo class for static response + pub fn new() -> AuthenticatorStaticChallengeResponseRequest { + AuthenticatorStaticChallengeResponseRequest { component: None } + } +} diff --git a/packages/client-rust/src/models/authenticator_static_stage.rs b/packages/client-rust/src/models/authenticator_static_stage.rs new file mode 100644 index 0000000000..e42cf29805 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_static_stage.rs @@ -0,0 +1,76 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorStaticStage : AuthenticatorStaticStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorStaticStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "token_count", skip_serializing_if = "Option::is_none")] + pub token_count: Option, + #[serde(rename = "token_length", skip_serializing_if = "Option::is_none")] + pub token_length: Option, +} + +impl AuthenticatorStaticStage { + /// AuthenticatorStaticStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + ) -> AuthenticatorStaticStage { + AuthenticatorStaticStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + configure_flow: None, + friendly_name: None, + token_count: None, + token_length: None, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_static_stage_request.rs b/packages/client-rust/src/models/authenticator_static_stage_request.rs new file mode 100644 index 0000000000..2fe68ba96c --- /dev/null +++ b/packages/client-rust/src/models/authenticator_static_stage_request.rs @@ -0,0 +1,46 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorStaticStageRequest : AuthenticatorStaticStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorStaticStageRequest { + #[serde(rename = "name")] + pub name: String, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "token_count", skip_serializing_if = "Option::is_none")] + pub token_count: Option, + #[serde(rename = "token_length", skip_serializing_if = "Option::is_none")] + pub token_length: Option, +} + +impl AuthenticatorStaticStageRequest { + /// AuthenticatorStaticStage Serializer + pub fn new(name: String) -> AuthenticatorStaticStageRequest { + AuthenticatorStaticStageRequest { + name, + configure_flow: None, + friendly_name: None, + token_count: None, + token_length: None, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_totp_challenge.rs b/packages/client-rust/src/models/authenticator_totp_challenge.rs new file mode 100644 index 0000000000..6373d124a7 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_totp_challenge.rs @@ -0,0 +1,46 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorTotpChallenge : TOTP Setup challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorTotpChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "pending_user")] + pub pending_user: String, + #[serde(rename = "pending_user_avatar")] + pub pending_user_avatar: String, + #[serde(rename = "config_url")] + pub config_url: String, +} + +impl AuthenticatorTotpChallenge { + /// TOTP Setup challenge + pub fn new( + pending_user: String, + pending_user_avatar: String, + config_url: String, + ) -> AuthenticatorTotpChallenge { + AuthenticatorTotpChallenge { + flow_info: None, + component: None, + response_errors: None, + pending_user, + pending_user_avatar, + config_url, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_totp_challenge_response_request.rs b/packages/client-rust/src/models/authenticator_totp_challenge_response_request.rs new file mode 100644 index 0000000000..adc3f9a2b9 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_totp_challenge_response_request.rs @@ -0,0 +1,31 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorTotpChallengeResponseRequest : TOTP Challenge response, device is set by +/// get_response_instance +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorTotpChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "code")] + pub code: String, +} + +impl AuthenticatorTotpChallengeResponseRequest { + /// TOTP Challenge response, device is set by get_response_instance + pub fn new(code: String) -> AuthenticatorTotpChallengeResponseRequest { + AuthenticatorTotpChallengeResponseRequest { + component: None, + code, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_totp_stage.rs b/packages/client-rust/src/models/authenticator_totp_stage.rs new file mode 100644 index 0000000000..52798ec367 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_totp_stage.rs @@ -0,0 +1,74 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorTotpStage : AuthenticatorTOTPStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorTotpStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "digits")] + pub digits: models::DigitsEnum, +} + +impl AuthenticatorTotpStage { + /// AuthenticatorTOTPStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + digits: models::DigitsEnum, + ) -> AuthenticatorTotpStage { + AuthenticatorTotpStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + configure_flow: None, + friendly_name: None, + digits, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_totp_stage_request.rs b/packages/client-rust/src/models/authenticator_totp_stage_request.rs new file mode 100644 index 0000000000..58ef6b2bff --- /dev/null +++ b/packages/client-rust/src/models/authenticator_totp_stage_request.rs @@ -0,0 +1,43 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorTotpStageRequest : AuthenticatorTOTPStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorTotpStageRequest { + #[serde(rename = "name")] + pub name: String, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "digits")] + pub digits: models::DigitsEnum, +} + +impl AuthenticatorTotpStageRequest { + /// AuthenticatorTOTPStage Serializer + pub fn new(name: String, digits: models::DigitsEnum) -> AuthenticatorTotpStageRequest { + AuthenticatorTotpStageRequest { + name, + configure_flow: None, + friendly_name: None, + digits, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_validate_stage.rs b/packages/client-rust/src/models/authenticator_validate_stage.rs new file mode 100644 index 0000000000..9e5a39db64 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_validate_stage.rs @@ -0,0 +1,102 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorValidateStage : AuthenticatorValidateStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorValidateStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + #[serde( + rename = "not_configured_action", + skip_serializing_if = "Option::is_none" + )] + pub not_configured_action: Option, + /// Device classes which can be used to authenticate + #[serde(rename = "device_classes", skip_serializing_if = "Option::is_none")] + pub device_classes: Option>, + /// Stages used to configure Authenticator when user doesn't have any compatible devices. After + /// this configuration Stage passes, the user is not prompted again. + #[serde( + rename = "configuration_stages", + skip_serializing_if = "Option::is_none" + )] + pub configuration_stages: Option>, + /// If any of the user's device has been used within this threshold, this stage will be skipped + #[serde( + rename = "last_auth_threshold", + skip_serializing_if = "Option::is_none" + )] + pub last_auth_threshold: Option, + /// Enforce user verification for WebAuthn devices. + #[serde( + rename = "webauthn_user_verification", + skip_serializing_if = "Option::is_none" + )] + pub webauthn_user_verification: Option, + #[serde(rename = "webauthn_hints", skip_serializing_if = "Option::is_none")] + pub webauthn_hints: Option>, + #[serde( + rename = "webauthn_allowed_device_types", + skip_serializing_if = "Option::is_none" + )] + pub webauthn_allowed_device_types: Option>, + #[serde(rename = "webauthn_allowed_device_types_obj")] + pub webauthn_allowed_device_types_obj: Vec, +} + +impl AuthenticatorValidateStage { + /// AuthenticatorValidateStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + webauthn_allowed_device_types_obj: Vec, + ) -> AuthenticatorValidateStage { + AuthenticatorValidateStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + not_configured_action: None, + device_classes: None, + configuration_stages: None, + last_auth_threshold: None, + webauthn_user_verification: None, + webauthn_hints: None, + webauthn_allowed_device_types: None, + webauthn_allowed_device_types_obj, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_validate_stage_request.rs b/packages/client-rust/src/models/authenticator_validate_stage_request.rs new file mode 100644 index 0000000000..7ad4877379 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_validate_stage_request.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorValidateStageRequest : AuthenticatorValidateStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorValidateStageRequest { + #[serde(rename = "name")] + pub name: String, + #[serde( + rename = "not_configured_action", + skip_serializing_if = "Option::is_none" + )] + pub not_configured_action: Option, + /// Device classes which can be used to authenticate + #[serde(rename = "device_classes", skip_serializing_if = "Option::is_none")] + pub device_classes: Option>, + /// Stages used to configure Authenticator when user doesn't have any compatible devices. After + /// this configuration Stage passes, the user is not prompted again. + #[serde( + rename = "configuration_stages", + skip_serializing_if = "Option::is_none" + )] + pub configuration_stages: Option>, + /// If any of the user's device has been used within this threshold, this stage will be skipped + #[serde( + rename = "last_auth_threshold", + skip_serializing_if = "Option::is_none" + )] + pub last_auth_threshold: Option, + /// Enforce user verification for WebAuthn devices. + #[serde( + rename = "webauthn_user_verification", + skip_serializing_if = "Option::is_none" + )] + pub webauthn_user_verification: Option, + #[serde(rename = "webauthn_hints", skip_serializing_if = "Option::is_none")] + pub webauthn_hints: Option>, + #[serde( + rename = "webauthn_allowed_device_types", + skip_serializing_if = "Option::is_none" + )] + pub webauthn_allowed_device_types: Option>, +} + +impl AuthenticatorValidateStageRequest { + /// AuthenticatorValidateStage Serializer + pub fn new(name: String) -> AuthenticatorValidateStageRequest { + AuthenticatorValidateStageRequest { + name, + not_configured_action: None, + device_classes: None, + configuration_stages: None, + last_auth_threshold: None, + webauthn_user_verification: None, + webauthn_hints: None, + webauthn_allowed_device_types: None, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_validation_challenge.rs b/packages/client-rust/src/models/authenticator_validation_challenge.rs new file mode 100644 index 0000000000..18c232426c --- /dev/null +++ b/packages/client-rust/src/models/authenticator_validation_challenge.rs @@ -0,0 +1,50 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorValidationChallenge : Authenticator challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorValidationChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "pending_user")] + pub pending_user: String, + #[serde(rename = "pending_user_avatar")] + pub pending_user_avatar: String, + #[serde(rename = "device_challenges")] + pub device_challenges: Vec, + #[serde(rename = "configuration_stages")] + pub configuration_stages: Vec, +} + +impl AuthenticatorValidationChallenge { + /// Authenticator challenge + pub fn new( + pending_user: String, + pending_user_avatar: String, + device_challenges: Vec, + configuration_stages: Vec, + ) -> AuthenticatorValidationChallenge { + AuthenticatorValidationChallenge { + flow_info: None, + component: None, + response_errors: None, + pending_user, + pending_user_avatar, + device_challenges, + configuration_stages, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_validation_challenge_response_request.rs b/packages/client-rust/src/models/authenticator_validation_challenge_response_request.rs new file mode 100644 index 0000000000..c2ed53ba0c --- /dev/null +++ b/packages/client-rust/src/models/authenticator_validation_challenge_response_request.rs @@ -0,0 +1,43 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorValidationChallengeResponseRequest : Challenge used for Code-based and WebAuthn +/// authenticators +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorValidationChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "selected_challenge", skip_serializing_if = "Option::is_none")] + pub selected_challenge: Option, + #[serde(rename = "selected_stage", skip_serializing_if = "Option::is_none")] + pub selected_stage: Option, + #[serde(rename = "code", skip_serializing_if = "Option::is_none")] + pub code: Option, + #[serde(rename = "webauthn", skip_serializing_if = "Option::is_none")] + pub webauthn: Option>, + #[serde(rename = "duo", skip_serializing_if = "Option::is_none")] + pub duo: Option, +} + +impl AuthenticatorValidationChallengeResponseRequest { + /// Challenge used for Code-based and WebAuthn authenticators + pub fn new() -> AuthenticatorValidationChallengeResponseRequest { + AuthenticatorValidationChallengeResponseRequest { + component: None, + selected_challenge: None, + selected_stage: None, + code: None, + webauthn: None, + duo: None, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_web_authn_challenge.rs b/packages/client-rust/src/models/authenticator_web_authn_challenge.rs new file mode 100644 index 0000000000..fff48bec1c --- /dev/null +++ b/packages/client-rust/src/models/authenticator_web_authn_challenge.rs @@ -0,0 +1,46 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorWebAuthnChallenge : WebAuthn Challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorWebAuthnChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "pending_user")] + pub pending_user: String, + #[serde(rename = "pending_user_avatar")] + pub pending_user_avatar: String, + #[serde(rename = "registration")] + pub registration: std::collections::HashMap, +} + +impl AuthenticatorWebAuthnChallenge { + /// WebAuthn Challenge + pub fn new( + pending_user: String, + pending_user_avatar: String, + registration: std::collections::HashMap, + ) -> AuthenticatorWebAuthnChallenge { + AuthenticatorWebAuthnChallenge { + flow_info: None, + component: None, + response_errors: None, + pending_user, + pending_user_avatar, + registration, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_web_authn_challenge_response_request.rs b/packages/client-rust/src/models/authenticator_web_authn_challenge_response_request.rs new file mode 100644 index 0000000000..09432d341d --- /dev/null +++ b/packages/client-rust/src/models/authenticator_web_authn_challenge_response_request.rs @@ -0,0 +1,32 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorWebAuthnChallengeResponseRequest : WebAuthn Challenge response +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorWebAuthnChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response")] + pub response: std::collections::HashMap, +} + +impl AuthenticatorWebAuthnChallengeResponseRequest { + /// WebAuthn Challenge response + pub fn new( + response: std::collections::HashMap, + ) -> AuthenticatorWebAuthnChallengeResponseRequest { + AuthenticatorWebAuthnChallengeResponseRequest { + component: None, + response, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_web_authn_stage.rs b/packages/client-rust/src/models/authenticator_web_authn_stage.rs new file mode 100644 index 0000000000..cfb2a6dea9 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_web_authn_stage.rs @@ -0,0 +1,103 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorWebAuthnStage : AuthenticatorWebAuthnStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorWebAuthnStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "user_verification", skip_serializing_if = "Option::is_none")] + pub user_verification: Option, + #[serde( + rename = "authenticator_attachment", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authenticator_attachment: Option>, + #[serde( + rename = "resident_key_requirement", + skip_serializing_if = "Option::is_none" + )] + pub resident_key_requirement: Option, + #[serde(rename = "hints", skip_serializing_if = "Option::is_none")] + pub hints: Option>, + #[serde( + rename = "device_type_restrictions", + skip_serializing_if = "Option::is_none" + )] + pub device_type_restrictions: Option>, + #[serde(rename = "device_type_restrictions_obj")] + pub device_type_restrictions_obj: Vec, + #[serde(rename = "max_attempts", skip_serializing_if = "Option::is_none")] + pub max_attempts: Option, +} + +impl AuthenticatorWebAuthnStage { + /// AuthenticatorWebAuthnStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + device_type_restrictions_obj: Vec, + ) -> AuthenticatorWebAuthnStage { + AuthenticatorWebAuthnStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + configure_flow: None, + friendly_name: None, + user_verification: None, + authenticator_attachment: None, + resident_key_requirement: None, + hints: None, + device_type_restrictions: None, + device_type_restrictions_obj, + max_attempts: None, + } + } +} diff --git a/packages/client-rust/src/models/authenticator_web_authn_stage_request.rs b/packages/client-rust/src/models/authenticator_web_authn_stage_request.rs new file mode 100644 index 0000000000..342c4e2a47 --- /dev/null +++ b/packages/client-rust/src/models/authenticator_web_authn_stage_request.rs @@ -0,0 +1,69 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AuthenticatorWebAuthnStageRequest : AuthenticatorWebAuthnStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorWebAuthnStageRequest { + #[serde(rename = "name")] + pub name: String, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "user_verification", skip_serializing_if = "Option::is_none")] + pub user_verification: Option, + #[serde( + rename = "authenticator_attachment", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authenticator_attachment: Option>, + #[serde( + rename = "resident_key_requirement", + skip_serializing_if = "Option::is_none" + )] + pub resident_key_requirement: Option, + #[serde(rename = "hints", skip_serializing_if = "Option::is_none")] + pub hints: Option>, + #[serde( + rename = "device_type_restrictions", + skip_serializing_if = "Option::is_none" + )] + pub device_type_restrictions: Option>, + #[serde(rename = "max_attempts", skip_serializing_if = "Option::is_none")] + pub max_attempts: Option, +} + +impl AuthenticatorWebAuthnStageRequest { + /// AuthenticatorWebAuthnStage Serializer + pub fn new(name: String) -> AuthenticatorWebAuthnStageRequest { + AuthenticatorWebAuthnStageRequest { + name, + configure_flow: None, + friendly_name: None, + user_verification: None, + authenticator_attachment: None, + resident_key_requirement: None, + hints: None, + device_type_restrictions: None, + max_attempts: None, + } + } +} diff --git a/packages/client-rust/src/models/authorization_code_auth_method_enum.rs b/packages/client-rust/src/models/authorization_code_auth_method_enum.rs new file mode 100644 index 0000000000..0dd251f099 --- /dev/null +++ b/packages/client-rust/src/models/authorization_code_auth_method_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AuthorizationCodeAuthMethodEnum { + #[serde(rename = "basic_auth")] + BasicAuth, + #[serde(rename = "post_body")] + PostBody, +} + +impl std::fmt::Display for AuthorizationCodeAuthMethodEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::BasicAuth => write!(f, "basic_auth"), + Self::PostBody => write!(f, "post_body"), + } + } +} + +impl Default for AuthorizationCodeAuthMethodEnum { + fn default() -> AuthorizationCodeAuthMethodEnum { + Self::BasicAuth + } +} diff --git a/packages/client-rust/src/models/auto_submit_challenge_response_request.rs b/packages/client-rust/src/models/auto_submit_challenge_response_request.rs new file mode 100644 index 0000000000..928443b376 --- /dev/null +++ b/packages/client-rust/src/models/auto_submit_challenge_response_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AutoSubmitChallengeResponseRequest : Pseudo class for autosubmit response +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutoSubmitChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, +} + +impl AutoSubmitChallengeResponseRequest { + /// Pseudo class for autosubmit response + pub fn new() -> AutoSubmitChallengeResponseRequest { + AutoSubmitChallengeResponseRequest { component: None } + } +} diff --git a/packages/client-rust/src/models/autosubmit_challenge.rs b/packages/client-rust/src/models/autosubmit_challenge.rs new file mode 100644 index 0000000000..565f619ebd --- /dev/null +++ b/packages/client-rust/src/models/autosubmit_challenge.rs @@ -0,0 +1,45 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// AutosubmitChallenge : Autosubmit challenge used to send and navigate a POST request +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutosubmitChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "url")] + pub url: String, + #[serde(rename = "attrs")] + pub attrs: std::collections::HashMap, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, +} + +impl AutosubmitChallenge { + /// Autosubmit challenge used to send and navigate a POST request + pub fn new( + url: String, + attrs: std::collections::HashMap, + ) -> AutosubmitChallenge { + AutosubmitChallenge { + flow_info: None, + component: None, + response_errors: None, + url, + attrs, + title: None, + } + } +} diff --git a/packages/client-rust/src/models/backends_enum.rs b/packages/client-rust/src/models/backends_enum.rs new file mode 100644 index 0000000000..855708c560 --- /dev/null +++ b/packages/client-rust/src/models/backends_enum.rs @@ -0,0 +1,47 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum BackendsEnum { + #[serde(rename = "authentik.core.auth.InbuiltBackend")] + AuthentikCoreAuthInbuiltBackend, + #[serde(rename = "authentik.core.auth.TokenBackend")] + AuthentikCoreAuthTokenBackend, + #[serde(rename = "authentik.sources.ldap.auth.LDAPBackend")] + AuthentikSourcesLdapAuthLdapBackend, + #[serde(rename = "authentik.sources.kerberos.auth.KerberosBackend")] + AuthentikSourcesKerberosAuthKerberosBackend, +} + +impl std::fmt::Display for BackendsEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::AuthentikCoreAuthInbuiltBackend => { + write!(f, "authentik.core.auth.InbuiltBackend") + } + Self::AuthentikCoreAuthTokenBackend => write!(f, "authentik.core.auth.TokenBackend"), + Self::AuthentikSourcesLdapAuthLdapBackend => { + write!(f, "authentik.sources.ldap.auth.LDAPBackend") + } + Self::AuthentikSourcesKerberosAuthKerberosBackend => { + write!(f, "authentik.sources.kerberos.auth.KerberosBackend") + } + } + } +} + +impl Default for BackendsEnum { + fn default() -> BackendsEnum { + Self::AuthentikCoreAuthInbuiltBackend + } +} diff --git a/packages/client-rust/src/models/binding_type_enum.rs b/packages/client-rust/src/models/binding_type_enum.rs new file mode 100644 index 0000000000..a5c696e400 --- /dev/null +++ b/packages/client-rust/src/models/binding_type_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum BindingTypeEnum { + #[serde(rename = "REDIRECT")] + Redirect, + #[serde(rename = "POST")] + Post, + #[serde(rename = "POST_AUTO")] + PostAuto, +} + +impl std::fmt::Display for BindingTypeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Redirect => write!(f, "REDIRECT"), + Self::Post => write!(f, "POST"), + Self::PostAuto => write!(f, "POST_AUTO"), + } + } +} + +impl Default for BindingTypeEnum { + fn default() -> BindingTypeEnum { + Self::Redirect + } +} diff --git a/packages/client-rust/src/models/blueprint_file.rs b/packages/client-rust/src/models/blueprint_file.rs new file mode 100644 index 0000000000..849d505582 --- /dev/null +++ b/packages/client-rust/src/models/blueprint_file.rs @@ -0,0 +1,39 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BlueprintFile { + #[serde(rename = "path")] + pub path: String, + #[serde(rename = "last_m")] + pub last_m: String, + #[serde(rename = "hash")] + pub hash: String, + #[serde(rename = "meta")] + pub meta: models::Metadata, +} + +impl BlueprintFile { + pub fn new( + path: String, + last_m: String, + hash: String, + meta: models::Metadata, + ) -> BlueprintFile { + BlueprintFile { + path, + last_m, + hash, + meta, + } + } +} diff --git a/packages/client-rust/src/models/blueprint_instance.rs b/packages/client-rust/src/models/blueprint_instance.rs new file mode 100644 index 0000000000..23eae1f696 --- /dev/null +++ b/packages/client-rust/src/models/blueprint_instance.rs @@ -0,0 +1,65 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// BlueprintInstance : Info about a single blueprint instance file +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BlueprintInstance { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "path", skip_serializing_if = "Option::is_none")] + pub path: Option, + #[serde(rename = "context", skip_serializing_if = "Option::is_none")] + pub context: Option>, + #[serde(rename = "last_applied")] + pub last_applied: String, + #[serde(rename = "last_applied_hash")] + pub last_applied_hash: String, + #[serde(rename = "status")] + pub status: models::BlueprintInstanceStatusEnum, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "managed_models")] + pub managed_models: Vec, + #[serde(rename = "metadata")] + pub metadata: std::collections::HashMap, + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, +} + +impl BlueprintInstance { + /// Info about a single blueprint instance file + pub fn new( + pk: uuid::Uuid, + name: String, + last_applied: String, + last_applied_hash: String, + status: models::BlueprintInstanceStatusEnum, + managed_models: Vec, + metadata: std::collections::HashMap, + ) -> BlueprintInstance { + BlueprintInstance { + pk, + name, + path: None, + context: None, + last_applied, + last_applied_hash, + status, + enabled: None, + managed_models, + metadata, + content: None, + } + } +} diff --git a/packages/client-rust/src/models/blueprint_instance_request.rs b/packages/client-rust/src/models/blueprint_instance_request.rs new file mode 100644 index 0000000000..6cf0057487 --- /dev/null +++ b/packages/client-rust/src/models/blueprint_instance_request.rs @@ -0,0 +1,39 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// BlueprintInstanceRequest : Info about a single blueprint instance file +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BlueprintInstanceRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "path", skip_serializing_if = "Option::is_none")] + pub path: Option, + #[serde(rename = "context", skip_serializing_if = "Option::is_none")] + pub context: Option>, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, +} + +impl BlueprintInstanceRequest { + /// Info about a single blueprint instance file + pub fn new(name: String) -> BlueprintInstanceRequest { + BlueprintInstanceRequest { + name, + path: None, + context: None, + enabled: None, + content: None, + } + } +} diff --git a/packages/client-rust/src/models/blueprint_instance_status_enum.rs b/packages/client-rust/src/models/blueprint_instance_status_enum.rs new file mode 100644 index 0000000000..be04e7583b --- /dev/null +++ b/packages/client-rust/src/models/blueprint_instance_status_enum.rs @@ -0,0 +1,44 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum BlueprintInstanceStatusEnum { + #[serde(rename = "successful")] + Successful, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, + #[serde(rename = "orphaned")] + Orphaned, + #[serde(rename = "unknown")] + Unknown, +} + +impl std::fmt::Display for BlueprintInstanceStatusEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Successful => write!(f, "successful"), + Self::Warning => write!(f, "warning"), + Self::Error => write!(f, "error"), + Self::Orphaned => write!(f, "orphaned"), + Self::Unknown => write!(f, "unknown"), + } + } +} + +impl Default for BlueprintInstanceStatusEnum { + fn default() -> BlueprintInstanceStatusEnum { + Self::Successful + } +} diff --git a/packages/client-rust/src/models/brand.rs b/packages/client-rust/src/models/brand.rs new file mode 100644 index 0000000000..95097c8d5a --- /dev/null +++ b/packages/client-rust/src/models/brand.rs @@ -0,0 +1,131 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Brand : Brand Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Brand { + #[serde(rename = "brand_uuid")] + pub brand_uuid: uuid::Uuid, + /// Domain that activates this brand. Can be a superset, i.e. `a.b` for `aa.b` and `ba.b` + #[serde(rename = "domain")] + pub domain: String, + #[serde(rename = "default", skip_serializing_if = "Option::is_none")] + pub default: Option, + #[serde(rename = "branding_title", skip_serializing_if = "Option::is_none")] + pub branding_title: Option, + #[serde(rename = "branding_logo", skip_serializing_if = "Option::is_none")] + pub branding_logo: Option, + #[serde(rename = "branding_favicon", skip_serializing_if = "Option::is_none")] + pub branding_favicon: Option, + #[serde( + rename = "branding_custom_css", + skip_serializing_if = "Option::is_none" + )] + pub branding_custom_css: Option, + #[serde( + rename = "branding_default_flow_background", + skip_serializing_if = "Option::is_none" + )] + pub branding_default_flow_background: Option, + #[serde( + rename = "flow_authentication", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_authentication: Option>, + #[serde( + rename = "flow_invalidation", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_invalidation: Option>, + #[serde( + rename = "flow_recovery", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_recovery: Option>, + #[serde( + rename = "flow_unenrollment", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_unenrollment: Option>, + #[serde( + rename = "flow_user_settings", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_user_settings: Option>, + #[serde( + rename = "flow_device_code", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_device_code: Option>, + /// When set, external users will be redirected to this application after authenticating. + #[serde( + rename = "default_application", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub default_application: Option>, + /// Web Certificate used by the authentik Core webserver. + #[serde( + rename = "web_certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub web_certificate: Option>, + /// Certificates used for client authentication. + #[serde( + rename = "client_certificates", + skip_serializing_if = "Option::is_none" + )] + pub client_certificates: Option>, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl Brand { + /// Brand Serializer + pub fn new(brand_uuid: uuid::Uuid, domain: String) -> Brand { + Brand { + brand_uuid, + domain, + default: None, + branding_title: None, + branding_logo: None, + branding_favicon: None, + branding_custom_css: None, + branding_default_flow_background: None, + flow_authentication: None, + flow_invalidation: None, + flow_recovery: None, + flow_unenrollment: None, + flow_user_settings: None, + flow_device_code: None, + default_application: None, + web_certificate: None, + client_certificates: None, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/brand_request.rs b/packages/client-rust/src/models/brand_request.rs new file mode 100644 index 0000000000..aa749fb83d --- /dev/null +++ b/packages/client-rust/src/models/brand_request.rs @@ -0,0 +1,128 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// BrandRequest : Brand Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BrandRequest { + /// Domain that activates this brand. Can be a superset, i.e. `a.b` for `aa.b` and `ba.b` + #[serde(rename = "domain")] + pub domain: String, + #[serde(rename = "default", skip_serializing_if = "Option::is_none")] + pub default: Option, + #[serde(rename = "branding_title", skip_serializing_if = "Option::is_none")] + pub branding_title: Option, + #[serde(rename = "branding_logo", skip_serializing_if = "Option::is_none")] + pub branding_logo: Option, + #[serde(rename = "branding_favicon", skip_serializing_if = "Option::is_none")] + pub branding_favicon: Option, + #[serde( + rename = "branding_custom_css", + skip_serializing_if = "Option::is_none" + )] + pub branding_custom_css: Option, + #[serde( + rename = "branding_default_flow_background", + skip_serializing_if = "Option::is_none" + )] + pub branding_default_flow_background: Option, + #[serde( + rename = "flow_authentication", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_authentication: Option>, + #[serde( + rename = "flow_invalidation", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_invalidation: Option>, + #[serde( + rename = "flow_recovery", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_recovery: Option>, + #[serde( + rename = "flow_unenrollment", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_unenrollment: Option>, + #[serde( + rename = "flow_user_settings", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_user_settings: Option>, + #[serde( + rename = "flow_device_code", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_device_code: Option>, + /// When set, external users will be redirected to this application after authenticating. + #[serde( + rename = "default_application", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub default_application: Option>, + /// Web Certificate used by the authentik Core webserver. + #[serde( + rename = "web_certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub web_certificate: Option>, + /// Certificates used for client authentication. + #[serde( + rename = "client_certificates", + skip_serializing_if = "Option::is_none" + )] + pub client_certificates: Option>, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl BrandRequest { + /// Brand Serializer + pub fn new(domain: String) -> BrandRequest { + BrandRequest { + domain, + default: None, + branding_title: None, + branding_logo: None, + branding_favicon: None, + branding_custom_css: None, + branding_default_flow_background: None, + flow_authentication: None, + flow_invalidation: None, + flow_recovery: None, + flow_unenrollment: None, + flow_user_settings: None, + flow_device_code: None, + default_application: None, + web_certificate: None, + client_certificates: None, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/bulk_delete_session_response.rs b/packages/client-rust/src/models/bulk_delete_session_response.rs new file mode 100644 index 0000000000..d28142b6a0 --- /dev/null +++ b/packages/client-rust/src/models/bulk_delete_session_response.rs @@ -0,0 +1,23 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct BulkDeleteSessionResponse { + #[serde(rename = "deleted")] + pub deleted: i32, +} + +impl BulkDeleteSessionResponse { + pub fn new(deleted: i32) -> BulkDeleteSessionResponse { + BulkDeleteSessionResponse { deleted } + } +} diff --git a/packages/client-rust/src/models/cache.rs b/packages/client-rust/src/models/cache.rs new file mode 100644 index 0000000000..f40e5c9eb6 --- /dev/null +++ b/packages/client-rust/src/models/cache.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Cache : Generic cache stats for an object +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Cache { + #[serde(rename = "count")] + pub count: i32, +} + +impl Cache { + /// Generic cache stats for an object + pub fn new(count: i32) -> Cache { + Cache { count } + } +} diff --git a/packages/client-rust/src/models/capabilities_enum.rs b/packages/client-rust/src/models/capabilities_enum.rs new file mode 100644 index 0000000000..fc80704b9a --- /dev/null +++ b/packages/client-rust/src/models/capabilities_enum.rs @@ -0,0 +1,50 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum CapabilitiesEnum { + #[serde(rename = "can_save_media")] + CanSaveMedia, + #[serde(rename = "can_save_reports")] + CanSaveReports, + #[serde(rename = "can_geo_ip")] + CanGeoIp, + #[serde(rename = "can_asn")] + CanAsn, + #[serde(rename = "can_impersonate")] + CanImpersonate, + #[serde(rename = "can_debug")] + CanDebug, + #[serde(rename = "is_enterprise")] + IsEnterprise, +} + +impl std::fmt::Display for CapabilitiesEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::CanSaveMedia => write!(f, "can_save_media"), + Self::CanSaveReports => write!(f, "can_save_reports"), + Self::CanGeoIp => write!(f, "can_geo_ip"), + Self::CanAsn => write!(f, "can_asn"), + Self::CanImpersonate => write!(f, "can_impersonate"), + Self::CanDebug => write!(f, "can_debug"), + Self::IsEnterprise => write!(f, "is_enterprise"), + } + } +} + +impl Default for CapabilitiesEnum { + fn default() -> CapabilitiesEnum { + Self::CanSaveMedia + } +} diff --git a/packages/client-rust/src/models/captcha_challenge.rs b/packages/client-rust/src/models/captcha_challenge.rs new file mode 100644 index 0000000000..22f0daa680 --- /dev/null +++ b/packages/client-rust/src/models/captcha_challenge.rs @@ -0,0 +1,54 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// CaptchaChallenge : Site public key +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CaptchaChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "pending_user")] + pub pending_user: String, + #[serde(rename = "pending_user_avatar")] + pub pending_user_avatar: String, + #[serde(rename = "site_key")] + pub site_key: String, + #[serde(rename = "js_url")] + pub js_url: String, + #[serde(rename = "interactive")] + pub interactive: bool, +} + +impl CaptchaChallenge { + /// Site public key + pub fn new( + pending_user: String, + pending_user_avatar: String, + site_key: String, + js_url: String, + interactive: bool, + ) -> CaptchaChallenge { + CaptchaChallenge { + flow_info: None, + component: None, + response_errors: None, + pending_user, + pending_user_avatar, + site_key, + js_url, + interactive, + } + } +} diff --git a/packages/client-rust/src/models/captcha_challenge_response_request.rs b/packages/client-rust/src/models/captcha_challenge_response_request.rs new file mode 100644 index 0000000000..93658d9402 --- /dev/null +++ b/packages/client-rust/src/models/captcha_challenge_response_request.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// CaptchaChallengeResponseRequest : Validate captcha token +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CaptchaChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "token")] + pub token: String, +} + +impl CaptchaChallengeResponseRequest { + /// Validate captcha token + pub fn new(token: String) -> CaptchaChallengeResponseRequest { + CaptchaChallengeResponseRequest { + component: None, + token, + } + } +} diff --git a/packages/client-rust/src/models/captcha_stage.rs b/packages/client-rust/src/models/captcha_stage.rs new file mode 100644 index 0000000000..0d3f6c400a --- /dev/null +++ b/packages/client-rust/src/models/captcha_stage.rs @@ -0,0 +1,92 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// CaptchaStage : CaptchaStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CaptchaStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + /// Public key, acquired your captcha Provider. + #[serde(rename = "public_key")] + pub public_key: String, + #[serde(rename = "js_url", skip_serializing_if = "Option::is_none")] + pub js_url: Option, + #[serde(rename = "api_url", skip_serializing_if = "Option::is_none")] + pub api_url: Option, + #[serde(rename = "interactive", skip_serializing_if = "Option::is_none")] + pub interactive: Option, + #[serde( + rename = "score_min_threshold", + skip_serializing_if = "Option::is_none" + )] + pub score_min_threshold: Option, + #[serde( + rename = "score_max_threshold", + skip_serializing_if = "Option::is_none" + )] + pub score_max_threshold: Option, + /// When enabled and the received captcha score is outside of the given threshold, the stage + /// will show an error message. When not enabled, the flow will continue, but the data from the + /// captcha will be available in the context for policy decisions + #[serde( + rename = "error_on_invalid_score", + skip_serializing_if = "Option::is_none" + )] + pub error_on_invalid_score: Option, +} + +impl CaptchaStage { + /// CaptchaStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + public_key: String, + ) -> CaptchaStage { + CaptchaStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + public_key, + js_url: None, + api_url: None, + interactive: None, + score_min_threshold: None, + score_max_threshold: None, + error_on_invalid_score: None, + } + } +} diff --git a/packages/client-rust/src/models/captcha_stage_request.rs b/packages/client-rust/src/models/captcha_stage_request.rs new file mode 100644 index 0000000000..e486fc31b1 --- /dev/null +++ b/packages/client-rust/src/models/captcha_stage_request.rs @@ -0,0 +1,65 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// CaptchaStageRequest : CaptchaStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CaptchaStageRequest { + #[serde(rename = "name")] + pub name: String, + /// Public key, acquired your captcha Provider. + #[serde(rename = "public_key")] + pub public_key: String, + /// Private key, acquired your captcha Provider. + #[serde(rename = "private_key")] + pub private_key: String, + #[serde(rename = "js_url", skip_serializing_if = "Option::is_none")] + pub js_url: Option, + #[serde(rename = "api_url", skip_serializing_if = "Option::is_none")] + pub api_url: Option, + #[serde(rename = "interactive", skip_serializing_if = "Option::is_none")] + pub interactive: Option, + #[serde( + rename = "score_min_threshold", + skip_serializing_if = "Option::is_none" + )] + pub score_min_threshold: Option, + #[serde( + rename = "score_max_threshold", + skip_serializing_if = "Option::is_none" + )] + pub score_max_threshold: Option, + /// When enabled and the received captcha score is outside of the given threshold, the stage + /// will show an error message. When not enabled, the flow will continue, but the data from the + /// captcha will be available in the context for policy decisions + #[serde( + rename = "error_on_invalid_score", + skip_serializing_if = "Option::is_none" + )] + pub error_on_invalid_score: Option, +} + +impl CaptchaStageRequest { + /// CaptchaStage Serializer + pub fn new(name: String, public_key: String, private_key: String) -> CaptchaStageRequest { + CaptchaStageRequest { + name, + public_key, + private_key, + js_url: None, + api_url: None, + interactive: None, + score_min_threshold: None, + score_max_threshold: None, + error_on_invalid_score: None, + } + } +} diff --git a/packages/client-rust/src/models/cert_attribute_enum.rs b/packages/client-rust/src/models/cert_attribute_enum.rs new file mode 100644 index 0000000000..a513d9e187 --- /dev/null +++ b/packages/client-rust/src/models/cert_attribute_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum CertAttributeEnum { + #[serde(rename = "subject")] + Subject, + #[serde(rename = "common_name")] + CommonName, + #[serde(rename = "email")] + Email, +} + +impl std::fmt::Display for CertAttributeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Subject => write!(f, "subject"), + Self::CommonName => write!(f, "common_name"), + Self::Email => write!(f, "email"), + } + } +} + +impl Default for CertAttributeEnum { + fn default() -> CertAttributeEnum { + Self::Subject + } +} diff --git a/packages/client-rust/src/models/certificate_data.rs b/packages/client-rust/src/models/certificate_data.rs new file mode 100644 index 0000000000..73081759f9 --- /dev/null +++ b/packages/client-rust/src/models/certificate_data.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// CertificateData : Get CertificateKeyPair's data +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CertificateData { + #[serde(rename = "data")] + pub data: String, +} + +impl CertificateData { + /// Get CertificateKeyPair's data + pub fn new(data: String) -> CertificateData { + CertificateData { data } + } +} diff --git a/packages/client-rust/src/models/certificate_generation_request.rs b/packages/client-rust/src/models/certificate_generation_request.rs new file mode 100644 index 0000000000..97f2fb5d43 --- /dev/null +++ b/packages/client-rust/src/models/certificate_generation_request.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// CertificateGenerationRequest : Certificate generation parameters +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CertificateGenerationRequest { + #[serde(rename = "common_name")] + pub common_name: String, + #[serde(rename = "subject_alt_name", skip_serializing_if = "Option::is_none")] + pub subject_alt_name: Option, + #[serde(rename = "validity_days")] + pub validity_days: i32, + #[serde(rename = "alg", skip_serializing_if = "Option::is_none")] + pub alg: Option, +} + +impl CertificateGenerationRequest { + /// Certificate generation parameters + pub fn new(common_name: String, validity_days: i32) -> CertificateGenerationRequest { + CertificateGenerationRequest { + common_name, + subject_alt_name: None, + validity_days, + alg: None, + } + } +} diff --git a/packages/client-rust/src/models/certificate_key_pair.rs b/packages/client-rust/src/models/certificate_key_pair.rs new file mode 100644 index 0000000000..ba7097f5b1 --- /dev/null +++ b/packages/client-rust/src/models/certificate_key_pair.rs @@ -0,0 +1,83 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// CertificateKeyPair : CertificateKeyPair Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CertificateKeyPair { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// SHA256 fingerprint of the certificate + #[serde( + rename = "fingerprint_sha256", + deserialize_with = "Option::deserialize" + )] + pub fingerprint_sha256: Option, + /// SHA1 fingerprint of the certificate + #[serde(rename = "fingerprint_sha1", deserialize_with = "Option::deserialize")] + pub fingerprint_sha1: Option, + /// Certificate expiry date + #[serde(rename = "cert_expiry", deserialize_with = "Option::deserialize")] + pub cert_expiry: Option, + /// Certificate subject as RFC4514 string + #[serde(rename = "cert_subject", deserialize_with = "Option::deserialize")] + pub cert_subject: Option, + /// Show if this keypair has a private key configured or not + #[serde(rename = "private_key_available")] + pub private_key_available: bool, + /// Key algorithm type detected from the certificate's public key + #[serde(rename = "key_type", deserialize_with = "Option::deserialize")] + pub key_type: Option, + /// Get URL to download certificate + #[serde(rename = "certificate_download_url")] + pub certificate_download_url: String, + /// Get URL to download private key + #[serde(rename = "private_key_download_url")] + pub private_key_download_url: String, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde(rename = "managed", deserialize_with = "Option::deserialize")] + pub managed: Option, +} + +impl CertificateKeyPair { + /// CertificateKeyPair Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + fingerprint_sha256: Option, + fingerprint_sha1: Option, + cert_expiry: Option, + cert_subject: Option, + private_key_available: bool, + key_type: Option, + certificate_download_url: String, + private_key_download_url: String, + managed: Option, + ) -> CertificateKeyPair { + CertificateKeyPair { + pk, + name, + fingerprint_sha256, + fingerprint_sha1, + cert_expiry, + cert_subject, + private_key_available, + key_type, + certificate_download_url, + private_key_download_url, + managed, + } + } +} diff --git a/packages/client-rust/src/models/certificate_key_pair_request.rs b/packages/client-rust/src/models/certificate_key_pair_request.rs new file mode 100644 index 0000000000..1b0823576e --- /dev/null +++ b/packages/client-rust/src/models/certificate_key_pair_request.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// CertificateKeyPairRequest : CertificateKeyPair Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CertificateKeyPairRequest { + #[serde(rename = "name")] + pub name: String, + /// PEM-encoded Certificate data + #[serde(rename = "certificate_data")] + pub certificate_data: String, + /// Optional Private Key. If this is set, you can use this keypair for encryption. + #[serde(rename = "key_data", skip_serializing_if = "Option::is_none")] + pub key_data: Option, +} + +impl CertificateKeyPairRequest { + /// CertificateKeyPair Serializer + pub fn new(name: String, certificate_data: String) -> CertificateKeyPairRequest { + CertificateKeyPairRequest { + name, + certificate_data, + key_data: None, + } + } +} diff --git a/packages/client-rust/src/models/challenge_types.rs b/packages/client-rust/src/models/challenge_types.rs new file mode 100644 index 0000000000..dd8193b8d1 --- /dev/null +++ b/packages/client-rust/src/models/challenge_types.rs @@ -0,0 +1,82 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(tag = "component")] +pub enum ChallengeTypes { + #[serde(rename = "ak-stage-access-denied")] + AkStageAccessDenied(models::AccessDeniedChallenge), + #[serde(rename = "ak-source-oauth-apple")] + AkSourceOauthApple(models::AppleLoginChallenge), + #[serde(rename = "ak-stage-authenticator-duo")] + AkStageAuthenticatorDuo(models::AuthenticatorDuoChallenge), + #[serde(rename = "ak-stage-authenticator-email")] + AkStageAuthenticatorEmail(models::AuthenticatorEmailChallenge), + #[serde(rename = "ak-stage-authenticator-sms")] + AkStageAuthenticatorSms(models::AuthenticatorSmsChallenge), + #[serde(rename = "ak-stage-authenticator-static")] + AkStageAuthenticatorStatic(models::AuthenticatorStaticChallenge), + #[serde(rename = "ak-stage-authenticator-totp")] + AkStageAuthenticatorTotp(models::AuthenticatorTotpChallenge), + #[serde(rename = "ak-stage-authenticator-validate")] + AkStageAuthenticatorValidate(models::AuthenticatorValidationChallenge), + #[serde(rename = "ak-stage-authenticator-webauthn")] + AkStageAuthenticatorWebauthn(models::AuthenticatorWebAuthnChallenge), + #[serde(rename = "ak-stage-autosubmit")] + AkStageAutosubmit(models::AutosubmitChallenge), + #[serde(rename = "ak-stage-captcha")] + AkStageCaptcha(models::CaptchaChallenge), + #[serde(rename = "ak-stage-consent")] + AkStageConsent(models::ConsentChallenge), + #[serde(rename = "ak-stage-dummy")] + AkStageDummy(models::DummyChallenge), + #[serde(rename = "ak-stage-email")] + AkStageEmail(models::EmailChallenge), + #[serde(rename = "ak-stage-endpoint-agent")] + AkStageEndpointAgent(models::EndpointAgentChallenge), + #[serde(rename = "ak-stage-flow-error")] + AkStageFlowError(models::FlowErrorChallenge), + #[serde(rename = "xak-flow-frame")] + XakFlowFrame(models::FrameChallenge), + #[serde(rename = "ak-stage-identification")] + AkStageIdentification(models::IdentificationChallenge), + #[serde(rename = "ak-provider-iframe-logout")] + AkProviderIframeLogout(models::IframeLogoutChallenge), + #[serde(rename = "ak-provider-saml-native-logout")] + AkProviderSamlNativeLogout(models::NativeLogoutChallenge), + #[serde(rename = "ak-provider-oauth2-device-code")] + AkProviderOauth2DeviceCode(models::OAuthDeviceCodeChallenge), + #[serde(rename = "ak-provider-oauth2-device-code-finish")] + AkProviderOauth2DeviceCodeFinish(models::OAuthDeviceCodeFinishChallenge), + #[serde(rename = "ak-stage-password")] + AkStagePassword(models::PasswordChallenge), + #[serde(rename = "ak-source-plex")] + AkSourcePlex(models::PlexAuthenticationChallenge), + #[serde(rename = "ak-stage-prompt")] + AkStagePrompt(models::PromptChallenge), + #[serde(rename = "xak-flow-redirect")] + XakFlowRedirect(models::RedirectChallenge), + #[serde(rename = "ak-stage-session-end")] + AkStageSessionEnd(models::SessionEndChallenge), + #[serde(rename = "xak-flow-shell")] + XakFlowShell(models::ShellChallenge), + #[serde(rename = "ak-source-telegram")] + AkSourceTelegram(models::TelegramLoginChallenge), + #[serde(rename = "ak-stage-user-login")] + AkStageUserLogin(models::UserLoginChallenge), +} + +impl Default for ChallengeTypes { + fn default() -> Self { + Self::AkStageAccessDenied(Default::default()) + } +} diff --git a/packages/client-rust/src/models/client_type_enum.rs b/packages/client-rust/src/models/client_type_enum.rs new file mode 100644 index 0000000000..8e2a0eb665 --- /dev/null +++ b/packages/client-rust/src/models/client_type_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ClientTypeEnum { + #[serde(rename = "confidential")] + Confidential, + #[serde(rename = "public")] + Public, +} + +impl std::fmt::Display for ClientTypeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Confidential => write!(f, "confidential"), + Self::Public => write!(f, "public"), + } + } +} + +impl Default for ClientTypeEnum { + fn default() -> ClientTypeEnum { + Self::Confidential + } +} diff --git a/packages/client-rust/src/models/compatibility_mode_enum.rs b/packages/client-rust/src/models/compatibility_mode_enum.rs new file mode 100644 index 0000000000..d3e55b008a --- /dev/null +++ b/packages/client-rust/src/models/compatibility_mode_enum.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum CompatibilityModeEnum { + #[serde(rename = "default")] + Default, + #[serde(rename = "aws")] + Aws, + #[serde(rename = "slack")] + Slack, + #[serde(rename = "sfdc")] + Sfdc, +} + +impl std::fmt::Display for CompatibilityModeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Default => write!(f, "default"), + Self::Aws => write!(f, "aws"), + Self::Slack => write!(f, "slack"), + Self::Sfdc => write!(f, "sfdc"), + } + } +} + +impl Default for CompatibilityModeEnum { + fn default() -> CompatibilityModeEnum { + Self::Default + } +} diff --git a/packages/client-rust/src/models/config.rs b/packages/client-rust/src/models/config.rs new file mode 100644 index 0000000000..386da14533 --- /dev/null +++ b/packages/client-rust/src/models/config.rs @@ -0,0 +1,45 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Config : Serialize authentik Config into DRF Object +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Config { + #[serde(rename = "error_reporting")] + pub error_reporting: models::ErrorReportingConfig, + #[serde(rename = "capabilities")] + pub capabilities: Vec, + #[serde(rename = "cache_timeout")] + pub cache_timeout: i32, + #[serde(rename = "cache_timeout_flows")] + pub cache_timeout_flows: i32, + #[serde(rename = "cache_timeout_policies")] + pub cache_timeout_policies: i32, +} + +impl Config { + /// Serialize authentik Config into DRF Object + pub fn new( + error_reporting: models::ErrorReportingConfig, + capabilities: Vec, + cache_timeout: i32, + cache_timeout_flows: i32, + cache_timeout_policies: i32, + ) -> Config { + Config { + error_reporting, + capabilities, + cache_timeout, + cache_timeout_flows, + cache_timeout_policies, + } + } +} diff --git a/packages/client-rust/src/models/connection_token.rs b/packages/client-rust/src/models/connection_token.rs new file mode 100644 index 0000000000..df4c34ce66 --- /dev/null +++ b/packages/client-rust/src/models/connection_token.rs @@ -0,0 +1,48 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ConnectionToken : ConnectionToken Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionToken { + #[serde(rename = "pk", skip_serializing_if = "Option::is_none")] + pub pk: Option, + #[serde(rename = "provider")] + pub provider: i32, + #[serde(rename = "provider_obj")] + pub provider_obj: models::RacProvider, + #[serde(rename = "endpoint")] + pub endpoint: uuid::Uuid, + #[serde(rename = "endpoint_obj")] + pub endpoint_obj: models::Endpoint, + #[serde(rename = "user")] + pub user: models::PartialUser, +} + +impl ConnectionToken { + /// ConnectionToken Serializer + pub fn new( + provider: i32, + provider_obj: models::RacProvider, + endpoint: uuid::Uuid, + endpoint_obj: models::Endpoint, + user: models::PartialUser, + ) -> ConnectionToken { + ConnectionToken { + pk: None, + provider, + provider_obj, + endpoint, + endpoint_obj, + user, + } + } +} diff --git a/packages/client-rust/src/models/connection_token_request.rs b/packages/client-rust/src/models/connection_token_request.rs new file mode 100644 index 0000000000..5577a4e578 --- /dev/null +++ b/packages/client-rust/src/models/connection_token_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ConnectionTokenRequest : ConnectionToken Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionTokenRequest { + #[serde(rename = "pk", skip_serializing_if = "Option::is_none")] + pub pk: Option, + #[serde(rename = "provider")] + pub provider: i32, + #[serde(rename = "endpoint")] + pub endpoint: uuid::Uuid, +} + +impl ConnectionTokenRequest { + /// ConnectionToken Serializer + pub fn new(provider: i32, endpoint: uuid::Uuid) -> ConnectionTokenRequest { + ConnectionTokenRequest { + pk: None, + provider, + endpoint, + } + } +} diff --git a/packages/client-rust/src/models/connector.rs b/packages/client-rust/src/models/connector.rs new file mode 100644 index 0000000000..b053407e08 --- /dev/null +++ b/packages/client-rust/src/models/connector.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Connector { + #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] + pub connector_uuid: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl Connector { + pub fn new( + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> Connector { + Connector { + connector_uuid: None, + name, + enabled: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/consent_challenge.rs b/packages/client-rust/src/models/consent_challenge.rs new file mode 100644 index 0000000000..64ee17408b --- /dev/null +++ b/packages/client-rust/src/models/consent_challenge.rs @@ -0,0 +1,57 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ConsentChallenge : Challenge info for consent screens +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConsentChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "pending_user")] + pub pending_user: String, + #[serde(rename = "pending_user_avatar")] + pub pending_user_avatar: String, + #[serde(rename = "header_text", skip_serializing_if = "Option::is_none")] + pub header_text: Option, + #[serde(rename = "permissions")] + pub permissions: Vec, + #[serde(rename = "additional_permissions")] + pub additional_permissions: Vec, + #[serde(rename = "token")] + pub token: String, +} + +impl ConsentChallenge { + /// Challenge info for consent screens + pub fn new( + pending_user: String, + pending_user_avatar: String, + permissions: Vec, + additional_permissions: Vec, + token: String, + ) -> ConsentChallenge { + ConsentChallenge { + flow_info: None, + component: None, + response_errors: None, + pending_user, + pending_user_avatar, + header_text: None, + permissions, + additional_permissions, + token, + } + } +} diff --git a/packages/client-rust/src/models/consent_challenge_response_request.rs b/packages/client-rust/src/models/consent_challenge_response_request.rs new file mode 100644 index 0000000000..b75c327684 --- /dev/null +++ b/packages/client-rust/src/models/consent_challenge_response_request.rs @@ -0,0 +1,31 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ConsentChallengeResponseRequest : Consent challenge response, any valid response request is +/// valid +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConsentChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "token")] + pub token: String, +} + +impl ConsentChallengeResponseRequest { + /// Consent challenge response, any valid response request is valid + pub fn new(token: String) -> ConsentChallengeResponseRequest { + ConsentChallengeResponseRequest { + component: None, + token, + } + } +} diff --git a/packages/client-rust/src/models/consent_permission.rs b/packages/client-rust/src/models/consent_permission.rs new file mode 100644 index 0000000000..d374ee0bf0 --- /dev/null +++ b/packages/client-rust/src/models/consent_permission.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ConsentPermission : Permission used for consent +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConsentPermission { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "id")] + pub id: String, +} + +impl ConsentPermission { + /// Permission used for consent + pub fn new(name: String, id: String) -> ConsentPermission { + ConsentPermission { name, id } + } +} diff --git a/packages/client-rust/src/models/consent_stage.rs b/packages/client-rust/src/models/consent_stage.rs new file mode 100644 index 0000000000..016c68650e --- /dev/null +++ b/packages/client-rust/src/models/consent_stage.rs @@ -0,0 +1,64 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ConsentStage : ConsentStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConsentStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3). + #[serde(rename = "consent_expire_in", skip_serializing_if = "Option::is_none")] + pub consent_expire_in: Option, +} + +impl ConsentStage { + /// ConsentStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + ) -> ConsentStage { + ConsentStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + mode: None, + consent_expire_in: None, + } + } +} diff --git a/packages/client-rust/src/models/consent_stage_mode_enum.rs b/packages/client-rust/src/models/consent_stage_mode_enum.rs new file mode 100644 index 0000000000..8843383a19 --- /dev/null +++ b/packages/client-rust/src/models/consent_stage_mode_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ConsentStageModeEnum { + #[serde(rename = "always_require")] + AlwaysRequire, + #[serde(rename = "permanent")] + Permanent, + #[serde(rename = "expiring")] + Expiring, +} + +impl std::fmt::Display for ConsentStageModeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::AlwaysRequire => write!(f, "always_require"), + Self::Permanent => write!(f, "permanent"), + Self::Expiring => write!(f, "expiring"), + } + } +} + +impl Default for ConsentStageModeEnum { + fn default() -> ConsentStageModeEnum { + Self::AlwaysRequire + } +} diff --git a/packages/client-rust/src/models/consent_stage_request.rs b/packages/client-rust/src/models/consent_stage_request.rs new file mode 100644 index 0000000000..abc05e75a7 --- /dev/null +++ b/packages/client-rust/src/models/consent_stage_request.rs @@ -0,0 +1,34 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ConsentStageRequest : ConsentStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConsentStageRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3). + #[serde(rename = "consent_expire_in", skip_serializing_if = "Option::is_none")] + pub consent_expire_in: Option, +} + +impl ConsentStageRequest { + /// ConsentStage Serializer + pub fn new(name: String) -> ConsentStageRequest { + ConsentStageRequest { + name, + mode: None, + consent_expire_in: None, + } + } +} diff --git a/packages/client-rust/src/models/content_type.rs b/packages/client-rust/src/models/content_type.rs new file mode 100644 index 0000000000..55f4a0d4dc --- /dev/null +++ b/packages/client-rust/src/models/content_type.rs @@ -0,0 +1,39 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ContentType { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "app_label")] + pub app_label: String, + #[serde(rename = "model")] + pub model: String, + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, +} + +impl ContentType { + pub fn new( + id: i32, + app_label: String, + model: String, + verbose_name_plural: String, + ) -> ContentType { + ContentType { + id, + app_label, + model, + verbose_name_plural, + } + } +} diff --git a/packages/client-rust/src/models/content_type_enum.rs b/packages/client-rust/src/models/content_type_enum.rs new file mode 100644 index 0000000000..ee6249b1fc --- /dev/null +++ b/packages/client-rust/src/models/content_type_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ContentTypeEnum { + #[serde(rename = "authentik_core.application")] + AuthentikCoreApplication, + #[serde(rename = "authentik_core.group")] + AuthentikCoreGroup, + #[serde(rename = "authentik_rbac.role")] + AuthentikRbacRole, +} + +impl std::fmt::Display for ContentTypeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::AuthentikCoreApplication => write!(f, "authentik_core.application"), + Self::AuthentikCoreGroup => write!(f, "authentik_core.group"), + Self::AuthentikRbacRole => write!(f, "authentik_rbac.role"), + } + } +} + +impl Default for ContentTypeEnum { + fn default() -> ContentTypeEnum { + Self::AuthentikCoreApplication + } +} diff --git a/packages/client-rust/src/models/contextual_flow_info.rs b/packages/client-rust/src/models/contextual_flow_info.rs new file mode 100644 index 0000000000..817fc4542c --- /dev/null +++ b/packages/client-rust/src/models/contextual_flow_info.rs @@ -0,0 +1,47 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ContextualFlowInfo : Contextual flow information for a challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ContextualFlowInfo { + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(rename = "background", skip_serializing_if = "Option::is_none")] + pub background: Option, + #[serde( + rename = "background_themed_urls", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub background_themed_urls: Option>, + #[serde(rename = "cancel_url")] + pub cancel_url: String, + #[serde(rename = "layout")] + pub layout: models::ContextualFlowInfoLayoutEnum, +} + +impl ContextualFlowInfo { + /// Contextual flow information for a challenge + pub fn new( + cancel_url: String, + layout: models::ContextualFlowInfoLayoutEnum, + ) -> ContextualFlowInfo { + ContextualFlowInfo { + title: None, + background: None, + background_themed_urls: None, + cancel_url, + layout, + } + } +} diff --git a/packages/client-rust/src/models/contextual_flow_info_layout_enum.rs b/packages/client-rust/src/models/contextual_flow_info_layout_enum.rs new file mode 100644 index 0000000000..13652dc756 --- /dev/null +++ b/packages/client-rust/src/models/contextual_flow_info_layout_enum.rs @@ -0,0 +1,50 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ContextualFlowInfoLayoutEnum { + #[serde(rename = "stacked")] + Stacked, + #[serde(rename = "content_left")] + ContentLeft, + #[serde(rename = "content_right")] + ContentRight, + #[serde(rename = "sidebar_left")] + SidebarLeft, + #[serde(rename = "sidebar_right")] + SidebarRight, + #[serde(rename = "sidebar_left_frame_background")] + SidebarLeftFrameBackground, + #[serde(rename = "sidebar_right_frame_background")] + SidebarRightFrameBackground, +} + +impl std::fmt::Display for ContextualFlowInfoLayoutEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Stacked => write!(f, "stacked"), + Self::ContentLeft => write!(f, "content_left"), + Self::ContentRight => write!(f, "content_right"), + Self::SidebarLeft => write!(f, "sidebar_left"), + Self::SidebarRight => write!(f, "sidebar_right"), + Self::SidebarLeftFrameBackground => write!(f, "sidebar_left_frame_background"), + Self::SidebarRightFrameBackground => write!(f, "sidebar_right_frame_background"), + } + } +} + +impl Default for ContextualFlowInfoLayoutEnum { + fn default() -> ContextualFlowInfoLayoutEnum { + Self::Stacked + } +} diff --git a/packages/client-rust/src/models/country_code_enum.rs b/packages/client-rust/src/models/country_code_enum.rs new file mode 100644 index 0000000000..0f2a2dad6e --- /dev/null +++ b/packages/client-rust/src/models/country_code_enum.rs @@ -0,0 +1,776 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum CountryCodeEnum { + #[serde(rename = "AF")] + Af, + #[serde(rename = "AX")] + Ax, + #[serde(rename = "AL")] + Al, + #[serde(rename = "DZ")] + Dz, + #[serde(rename = "AS")] + As, + #[serde(rename = "AD")] + Ad, + #[serde(rename = "AO")] + Ao, + #[serde(rename = "AI")] + Ai, + #[serde(rename = "AQ")] + Aq, + #[serde(rename = "AG")] + Ag, + #[serde(rename = "AR")] + Ar, + #[serde(rename = "AM")] + Am, + #[serde(rename = "AW")] + Aw, + #[serde(rename = "AU")] + Au, + #[serde(rename = "AT")] + At, + #[serde(rename = "AZ")] + Az, + #[serde(rename = "BS")] + Bs, + #[serde(rename = "BH")] + Bh, + #[serde(rename = "BD")] + Bd, + #[serde(rename = "BB")] + Bb, + #[serde(rename = "BY")] + By, + #[serde(rename = "BE")] + Be, + #[serde(rename = "BZ")] + Bz, + #[serde(rename = "BJ")] + Bj, + #[serde(rename = "BM")] + Bm, + #[serde(rename = "BT")] + Bt, + #[serde(rename = "BO")] + Bo, + #[serde(rename = "BQ")] + Bq, + #[serde(rename = "BA")] + Ba, + #[serde(rename = "BW")] + Bw, + #[serde(rename = "BV")] + Bv, + #[serde(rename = "BR")] + Br, + #[serde(rename = "IO")] + Io, + #[serde(rename = "BN")] + Bn, + #[serde(rename = "BG")] + Bg, + #[serde(rename = "BF")] + Bf, + #[serde(rename = "BI")] + Bi, + #[serde(rename = "CV")] + Cv, + #[serde(rename = "KH")] + Kh, + #[serde(rename = "CM")] + Cm, + #[serde(rename = "CA")] + Ca, + #[serde(rename = "KY")] + Ky, + #[serde(rename = "CF")] + Cf, + #[serde(rename = "TD")] + Td, + #[serde(rename = "CL")] + Cl, + #[serde(rename = "CN")] + Cn, + #[serde(rename = "CX")] + Cx, + #[serde(rename = "CC")] + Cc, + #[serde(rename = "CO")] + Co, + #[serde(rename = "KM")] + Km, + #[serde(rename = "CG")] + Cg, + #[serde(rename = "CK")] + Ck, + #[serde(rename = "CR")] + Cr, + #[serde(rename = "CI")] + Ci, + #[serde(rename = "HR")] + Hr, + #[serde(rename = "CU")] + Cu, + #[serde(rename = "CW")] + Cw, + #[serde(rename = "CY")] + Cy, + #[serde(rename = "CZ")] + Cz, + #[serde(rename = "CD")] + Cd, + #[serde(rename = "DK")] + Dk, + #[serde(rename = "DJ")] + Dj, + #[serde(rename = "DM")] + Dm, + #[serde(rename = "DO")] + Do, + #[serde(rename = "EC")] + Ec, + #[serde(rename = "EG")] + Eg, + #[serde(rename = "SV")] + Sv, + #[serde(rename = "GQ")] + Gq, + #[serde(rename = "ER")] + Er, + #[serde(rename = "EE")] + Ee, + #[serde(rename = "SZ")] + Sz, + #[serde(rename = "ET")] + Et, + #[serde(rename = "FK")] + Fk, + #[serde(rename = "FO")] + Fo, + #[serde(rename = "FJ")] + Fj, + #[serde(rename = "FI")] + Fi, + #[serde(rename = "FR")] + Fr, + #[serde(rename = "GF")] + Gf, + #[serde(rename = "PF")] + Pf, + #[serde(rename = "TF")] + Tf, + #[serde(rename = "GA")] + Ga, + #[serde(rename = "GM")] + Gm, + #[serde(rename = "GE")] + Ge, + #[serde(rename = "DE")] + De, + #[serde(rename = "GH")] + Gh, + #[serde(rename = "GI")] + Gi, + #[serde(rename = "GR")] + Gr, + #[serde(rename = "GL")] + Gl, + #[serde(rename = "GD")] + Gd, + #[serde(rename = "GP")] + Gp, + #[serde(rename = "GU")] + Gu, + #[serde(rename = "GT")] + Gt, + #[serde(rename = "GG")] + Gg, + #[serde(rename = "GN")] + Gn, + #[serde(rename = "GW")] + Gw, + #[serde(rename = "GY")] + Gy, + #[serde(rename = "HT")] + Ht, + #[serde(rename = "HM")] + Hm, + #[serde(rename = "HN")] + Hn, + #[serde(rename = "HK")] + Hk, + #[serde(rename = "HU")] + Hu, + #[serde(rename = "IS")] + Is, + #[serde(rename = "IN")] + In, + #[serde(rename = "ID")] + Id, + #[serde(rename = "IR")] + Ir, + #[serde(rename = "IQ")] + Iq, + #[serde(rename = "IE")] + Ie, + #[serde(rename = "IM")] + Im, + #[serde(rename = "IL")] + Il, + #[serde(rename = "IT")] + It, + #[serde(rename = "JM")] + Jm, + #[serde(rename = "JP")] + Jp, + #[serde(rename = "JE")] + Je, + #[serde(rename = "JO")] + Jo, + #[serde(rename = "KZ")] + Kz, + #[serde(rename = "KE")] + Ke, + #[serde(rename = "KI")] + Ki, + #[serde(rename = "KW")] + Kw, + #[serde(rename = "KG")] + Kg, + #[serde(rename = "LA")] + La, + #[serde(rename = "LV")] + Lv, + #[serde(rename = "LB")] + Lb, + #[serde(rename = "LS")] + Ls, + #[serde(rename = "LR")] + Lr, + #[serde(rename = "LY")] + Ly, + #[serde(rename = "LI")] + Li, + #[serde(rename = "LT")] + Lt, + #[serde(rename = "LU")] + Lu, + #[serde(rename = "MO")] + Mo, + #[serde(rename = "MG")] + Mg, + #[serde(rename = "MW")] + Mw, + #[serde(rename = "MY")] + My, + #[serde(rename = "MV")] + Mv, + #[serde(rename = "ML")] + Ml, + #[serde(rename = "MT")] + Mt, + #[serde(rename = "MH")] + Mh, + #[serde(rename = "MQ")] + Mq, + #[serde(rename = "MR")] + Mr, + #[serde(rename = "MU")] + Mu, + #[serde(rename = "YT")] + Yt, + #[serde(rename = "MX")] + Mx, + #[serde(rename = "FM")] + Fm, + #[serde(rename = "MD")] + Md, + #[serde(rename = "MC")] + Mc, + #[serde(rename = "MN")] + Mn, + #[serde(rename = "ME")] + Me, + #[serde(rename = "MS")] + Ms, + #[serde(rename = "MA")] + Ma, + #[serde(rename = "MZ")] + Mz, + #[serde(rename = "MM")] + Mm, + #[serde(rename = "NA")] + Na, + #[serde(rename = "NR")] + Nr, + #[serde(rename = "NP")] + Np, + #[serde(rename = "NL")] + Nl, + #[serde(rename = "NC")] + Nc, + #[serde(rename = "NZ")] + Nz, + #[serde(rename = "NI")] + Ni, + #[serde(rename = "NE")] + Ne, + #[serde(rename = "NG")] + Ng, + #[serde(rename = "NU")] + Nu, + #[serde(rename = "NF")] + Nf, + #[serde(rename = "KP")] + Kp, + #[serde(rename = "MK")] + Mk, + #[serde(rename = "MP")] + Mp, + #[serde(rename = "NO")] + No, + #[serde(rename = "OM")] + Om, + #[serde(rename = "PK")] + Pk, + #[serde(rename = "PW")] + Pw, + #[serde(rename = "PS")] + Ps, + #[serde(rename = "PA")] + Pa, + #[serde(rename = "PG")] + Pg, + #[serde(rename = "PY")] + Py, + #[serde(rename = "PE")] + Pe, + #[serde(rename = "PH")] + Ph, + #[serde(rename = "PN")] + Pn, + #[serde(rename = "PL")] + Pl, + #[serde(rename = "PT")] + Pt, + #[serde(rename = "PR")] + Pr, + #[serde(rename = "QA")] + Qa, + #[serde(rename = "RE")] + Re, + #[serde(rename = "RO")] + Ro, + #[serde(rename = "RU")] + Ru, + #[serde(rename = "RW")] + Rw, + #[serde(rename = "BL")] + Bl, + #[serde(rename = "SH")] + Sh, + #[serde(rename = "KN")] + Kn, + #[serde(rename = "LC")] + Lc, + #[serde(rename = "MF")] + Mf, + #[serde(rename = "PM")] + Pm, + #[serde(rename = "VC")] + Vc, + #[serde(rename = "WS")] + Ws, + #[serde(rename = "SM")] + Sm, + #[serde(rename = "ST")] + St, + #[serde(rename = "SA")] + Sa, + #[serde(rename = "SN")] + Sn, + #[serde(rename = "RS")] + Rs, + #[serde(rename = "SC")] + Sc, + #[serde(rename = "SL")] + Sl, + #[serde(rename = "SG")] + Sg, + #[serde(rename = "SX")] + Sx, + #[serde(rename = "SK")] + Sk, + #[serde(rename = "SI")] + Si, + #[serde(rename = "SB")] + Sb, + #[serde(rename = "SO")] + So, + #[serde(rename = "ZA")] + Za, + #[serde(rename = "GS")] + Gs, + #[serde(rename = "KR")] + Kr, + #[serde(rename = "SS")] + Ss, + #[serde(rename = "ES")] + Es, + #[serde(rename = "LK")] + Lk, + #[serde(rename = "SD")] + Sd, + #[serde(rename = "SR")] + Sr, + #[serde(rename = "SJ")] + Sj, + #[serde(rename = "SE")] + Se, + #[serde(rename = "CH")] + Ch, + #[serde(rename = "SY")] + Sy, + #[serde(rename = "TW")] + Tw, + #[serde(rename = "TJ")] + Tj, + #[serde(rename = "TZ")] + Tz, + #[serde(rename = "TH")] + Th, + #[serde(rename = "TL")] + Tl, + #[serde(rename = "TG")] + Tg, + #[serde(rename = "TK")] + Tk, + #[serde(rename = "TO")] + To, + #[serde(rename = "TT")] + Tt, + #[serde(rename = "TN")] + Tn, + #[serde(rename = "TR")] + Tr, + #[serde(rename = "TM")] + Tm, + #[serde(rename = "TC")] + Tc, + #[serde(rename = "TV")] + Tv, + #[serde(rename = "UG")] + Ug, + #[serde(rename = "UA")] + Ua, + #[serde(rename = "AE")] + Ae, + #[serde(rename = "GB")] + Gb, + #[serde(rename = "UM")] + Um, + #[serde(rename = "US")] + Us, + #[serde(rename = "UY")] + Uy, + #[serde(rename = "UZ")] + Uz, + #[serde(rename = "VU")] + Vu, + #[serde(rename = "VA")] + Va, + #[serde(rename = "VE")] + Ve, + #[serde(rename = "VN")] + Vn, + #[serde(rename = "VG")] + Vg, + #[serde(rename = "VI")] + Vi, + #[serde(rename = "WF")] + Wf, + #[serde(rename = "EH")] + Eh, + #[serde(rename = "YE")] + Ye, + #[serde(rename = "ZM")] + Zm, + #[serde(rename = "ZW")] + Zw, +} + +impl std::fmt::Display for CountryCodeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Af => write!(f, "AF"), + Self::Ax => write!(f, "AX"), + Self::Al => write!(f, "AL"), + Self::Dz => write!(f, "DZ"), + Self::As => write!(f, "AS"), + Self::Ad => write!(f, "AD"), + Self::Ao => write!(f, "AO"), + Self::Ai => write!(f, "AI"), + Self::Aq => write!(f, "AQ"), + Self::Ag => write!(f, "AG"), + Self::Ar => write!(f, "AR"), + Self::Am => write!(f, "AM"), + Self::Aw => write!(f, "AW"), + Self::Au => write!(f, "AU"), + Self::At => write!(f, "AT"), + Self::Az => write!(f, "AZ"), + Self::Bs => write!(f, "BS"), + Self::Bh => write!(f, "BH"), + Self::Bd => write!(f, "BD"), + Self::Bb => write!(f, "BB"), + Self::By => write!(f, "BY"), + Self::Be => write!(f, "BE"), + Self::Bz => write!(f, "BZ"), + Self::Bj => write!(f, "BJ"), + Self::Bm => write!(f, "BM"), + Self::Bt => write!(f, "BT"), + Self::Bo => write!(f, "BO"), + Self::Bq => write!(f, "BQ"), + Self::Ba => write!(f, "BA"), + Self::Bw => write!(f, "BW"), + Self::Bv => write!(f, "BV"), + Self::Br => write!(f, "BR"), + Self::Io => write!(f, "IO"), + Self::Bn => write!(f, "BN"), + Self::Bg => write!(f, "BG"), + Self::Bf => write!(f, "BF"), + Self::Bi => write!(f, "BI"), + Self::Cv => write!(f, "CV"), + Self::Kh => write!(f, "KH"), + Self::Cm => write!(f, "CM"), + Self::Ca => write!(f, "CA"), + Self::Ky => write!(f, "KY"), + Self::Cf => write!(f, "CF"), + Self::Td => write!(f, "TD"), + Self::Cl => write!(f, "CL"), + Self::Cn => write!(f, "CN"), + Self::Cx => write!(f, "CX"), + Self::Cc => write!(f, "CC"), + Self::Co => write!(f, "CO"), + Self::Km => write!(f, "KM"), + Self::Cg => write!(f, "CG"), + Self::Ck => write!(f, "CK"), + Self::Cr => write!(f, "CR"), + Self::Ci => write!(f, "CI"), + Self::Hr => write!(f, "HR"), + Self::Cu => write!(f, "CU"), + Self::Cw => write!(f, "CW"), + Self::Cy => write!(f, "CY"), + Self::Cz => write!(f, "CZ"), + Self::Cd => write!(f, "CD"), + Self::Dk => write!(f, "DK"), + Self::Dj => write!(f, "DJ"), + Self::Dm => write!(f, "DM"), + Self::Do => write!(f, "DO"), + Self::Ec => write!(f, "EC"), + Self::Eg => write!(f, "EG"), + Self::Sv => write!(f, "SV"), + Self::Gq => write!(f, "GQ"), + Self::Er => write!(f, "ER"), + Self::Ee => write!(f, "EE"), + Self::Sz => write!(f, "SZ"), + Self::Et => write!(f, "ET"), + Self::Fk => write!(f, "FK"), + Self::Fo => write!(f, "FO"), + Self::Fj => write!(f, "FJ"), + Self::Fi => write!(f, "FI"), + Self::Fr => write!(f, "FR"), + Self::Gf => write!(f, "GF"), + Self::Pf => write!(f, "PF"), + Self::Tf => write!(f, "TF"), + Self::Ga => write!(f, "GA"), + Self::Gm => write!(f, "GM"), + Self::Ge => write!(f, "GE"), + Self::De => write!(f, "DE"), + Self::Gh => write!(f, "GH"), + Self::Gi => write!(f, "GI"), + Self::Gr => write!(f, "GR"), + Self::Gl => write!(f, "GL"), + Self::Gd => write!(f, "GD"), + Self::Gp => write!(f, "GP"), + Self::Gu => write!(f, "GU"), + Self::Gt => write!(f, "GT"), + Self::Gg => write!(f, "GG"), + Self::Gn => write!(f, "GN"), + Self::Gw => write!(f, "GW"), + Self::Gy => write!(f, "GY"), + Self::Ht => write!(f, "HT"), + Self::Hm => write!(f, "HM"), + Self::Hn => write!(f, "HN"), + Self::Hk => write!(f, "HK"), + Self::Hu => write!(f, "HU"), + Self::Is => write!(f, "IS"), + Self::In => write!(f, "IN"), + Self::Id => write!(f, "ID"), + Self::Ir => write!(f, "IR"), + Self::Iq => write!(f, "IQ"), + Self::Ie => write!(f, "IE"), + Self::Im => write!(f, "IM"), + Self::Il => write!(f, "IL"), + Self::It => write!(f, "IT"), + Self::Jm => write!(f, "JM"), + Self::Jp => write!(f, "JP"), + Self::Je => write!(f, "JE"), + Self::Jo => write!(f, "JO"), + Self::Kz => write!(f, "KZ"), + Self::Ke => write!(f, "KE"), + Self::Ki => write!(f, "KI"), + Self::Kw => write!(f, "KW"), + Self::Kg => write!(f, "KG"), + Self::La => write!(f, "LA"), + Self::Lv => write!(f, "LV"), + Self::Lb => write!(f, "LB"), + Self::Ls => write!(f, "LS"), + Self::Lr => write!(f, "LR"), + Self::Ly => write!(f, "LY"), + Self::Li => write!(f, "LI"), + Self::Lt => write!(f, "LT"), + Self::Lu => write!(f, "LU"), + Self::Mo => write!(f, "MO"), + Self::Mg => write!(f, "MG"), + Self::Mw => write!(f, "MW"), + Self::My => write!(f, "MY"), + Self::Mv => write!(f, "MV"), + Self::Ml => write!(f, "ML"), + Self::Mt => write!(f, "MT"), + Self::Mh => write!(f, "MH"), + Self::Mq => write!(f, "MQ"), + Self::Mr => write!(f, "MR"), + Self::Mu => write!(f, "MU"), + Self::Yt => write!(f, "YT"), + Self::Mx => write!(f, "MX"), + Self::Fm => write!(f, "FM"), + Self::Md => write!(f, "MD"), + Self::Mc => write!(f, "MC"), + Self::Mn => write!(f, "MN"), + Self::Me => write!(f, "ME"), + Self::Ms => write!(f, "MS"), + Self::Ma => write!(f, "MA"), + Self::Mz => write!(f, "MZ"), + Self::Mm => write!(f, "MM"), + Self::Na => write!(f, "NA"), + Self::Nr => write!(f, "NR"), + Self::Np => write!(f, "NP"), + Self::Nl => write!(f, "NL"), + Self::Nc => write!(f, "NC"), + Self::Nz => write!(f, "NZ"), + Self::Ni => write!(f, "NI"), + Self::Ne => write!(f, "NE"), + Self::Ng => write!(f, "NG"), + Self::Nu => write!(f, "NU"), + Self::Nf => write!(f, "NF"), + Self::Kp => write!(f, "KP"), + Self::Mk => write!(f, "MK"), + Self::Mp => write!(f, "MP"), + Self::No => write!(f, "NO"), + Self::Om => write!(f, "OM"), + Self::Pk => write!(f, "PK"), + Self::Pw => write!(f, "PW"), + Self::Ps => write!(f, "PS"), + Self::Pa => write!(f, "PA"), + Self::Pg => write!(f, "PG"), + Self::Py => write!(f, "PY"), + Self::Pe => write!(f, "PE"), + Self::Ph => write!(f, "PH"), + Self::Pn => write!(f, "PN"), + Self::Pl => write!(f, "PL"), + Self::Pt => write!(f, "PT"), + Self::Pr => write!(f, "PR"), + Self::Qa => write!(f, "QA"), + Self::Re => write!(f, "RE"), + Self::Ro => write!(f, "RO"), + Self::Ru => write!(f, "RU"), + Self::Rw => write!(f, "RW"), + Self::Bl => write!(f, "BL"), + Self::Sh => write!(f, "SH"), + Self::Kn => write!(f, "KN"), + Self::Lc => write!(f, "LC"), + Self::Mf => write!(f, "MF"), + Self::Pm => write!(f, "PM"), + Self::Vc => write!(f, "VC"), + Self::Ws => write!(f, "WS"), + Self::Sm => write!(f, "SM"), + Self::St => write!(f, "ST"), + Self::Sa => write!(f, "SA"), + Self::Sn => write!(f, "SN"), + Self::Rs => write!(f, "RS"), + Self::Sc => write!(f, "SC"), + Self::Sl => write!(f, "SL"), + Self::Sg => write!(f, "SG"), + Self::Sx => write!(f, "SX"), + Self::Sk => write!(f, "SK"), + Self::Si => write!(f, "SI"), + Self::Sb => write!(f, "SB"), + Self::So => write!(f, "SO"), + Self::Za => write!(f, "ZA"), + Self::Gs => write!(f, "GS"), + Self::Kr => write!(f, "KR"), + Self::Ss => write!(f, "SS"), + Self::Es => write!(f, "ES"), + Self::Lk => write!(f, "LK"), + Self::Sd => write!(f, "SD"), + Self::Sr => write!(f, "SR"), + Self::Sj => write!(f, "SJ"), + Self::Se => write!(f, "SE"), + Self::Ch => write!(f, "CH"), + Self::Sy => write!(f, "SY"), + Self::Tw => write!(f, "TW"), + Self::Tj => write!(f, "TJ"), + Self::Tz => write!(f, "TZ"), + Self::Th => write!(f, "TH"), + Self::Tl => write!(f, "TL"), + Self::Tg => write!(f, "TG"), + Self::Tk => write!(f, "TK"), + Self::To => write!(f, "TO"), + Self::Tt => write!(f, "TT"), + Self::Tn => write!(f, "TN"), + Self::Tr => write!(f, "TR"), + Self::Tm => write!(f, "TM"), + Self::Tc => write!(f, "TC"), + Self::Tv => write!(f, "TV"), + Self::Ug => write!(f, "UG"), + Self::Ua => write!(f, "UA"), + Self::Ae => write!(f, "AE"), + Self::Gb => write!(f, "GB"), + Self::Um => write!(f, "UM"), + Self::Us => write!(f, "US"), + Self::Uy => write!(f, "UY"), + Self::Uz => write!(f, "UZ"), + Self::Vu => write!(f, "VU"), + Self::Va => write!(f, "VA"), + Self::Ve => write!(f, "VE"), + Self::Vn => write!(f, "VN"), + Self::Vg => write!(f, "VG"), + Self::Vi => write!(f, "VI"), + Self::Wf => write!(f, "WF"), + Self::Eh => write!(f, "EH"), + Self::Ye => write!(f, "YE"), + Self::Zm => write!(f, "ZM"), + Self::Zw => write!(f, "ZW"), + } + } +} + +impl Default for CountryCodeEnum { + fn default() -> CountryCodeEnum { + Self::Af + } +} diff --git a/packages/client-rust/src/models/current_brand.rs b/packages/client-rust/src/models/current_brand.rs new file mode 100644 index 0000000000..9abf33b549 --- /dev/null +++ b/packages/client-rust/src/models/current_brand.rs @@ -0,0 +1,96 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// CurrentBrand : Partial brand information for styling +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CurrentBrand { + #[serde(rename = "matched_domain")] + pub matched_domain: String, + #[serde(rename = "branding_title")] + pub branding_title: String, + #[serde(rename = "branding_logo")] + pub branding_logo: String, + #[serde( + rename = "branding_logo_themed_urls", + deserialize_with = "Option::deserialize" + )] + pub branding_logo_themed_urls: Option, + #[serde(rename = "branding_favicon")] + pub branding_favicon: String, + #[serde( + rename = "branding_favicon_themed_urls", + deserialize_with = "Option::deserialize" + )] + pub branding_favicon_themed_urls: Option, + #[serde(rename = "branding_custom_css")] + pub branding_custom_css: String, + #[serde(rename = "ui_footer_links")] + pub ui_footer_links: Vec, + #[serde(rename = "ui_theme")] + pub ui_theme: models::UiThemeEnum, + #[serde( + rename = "flow_authentication", + skip_serializing_if = "Option::is_none" + )] + pub flow_authentication: Option, + #[serde(rename = "flow_invalidation", skip_serializing_if = "Option::is_none")] + pub flow_invalidation: Option, + #[serde(rename = "flow_recovery", skip_serializing_if = "Option::is_none")] + pub flow_recovery: Option, + #[serde(rename = "flow_unenrollment", skip_serializing_if = "Option::is_none")] + pub flow_unenrollment: Option, + #[serde(rename = "flow_user_settings", skip_serializing_if = "Option::is_none")] + pub flow_user_settings: Option, + #[serde(rename = "flow_device_code", skip_serializing_if = "Option::is_none")] + pub flow_device_code: Option, + #[serde(rename = "default_locale")] + pub default_locale: String, + #[serde(rename = "flags")] + pub flags: models::CurrentBrandFlags, +} + +impl CurrentBrand { + /// Partial brand information for styling + pub fn new( + matched_domain: String, + branding_title: String, + branding_logo: String, + branding_logo_themed_urls: Option, + branding_favicon: String, + branding_favicon_themed_urls: Option, + branding_custom_css: String, + ui_footer_links: Vec, + ui_theme: models::UiThemeEnum, + default_locale: String, + flags: models::CurrentBrandFlags, + ) -> CurrentBrand { + CurrentBrand { + matched_domain, + branding_title, + branding_logo, + branding_logo_themed_urls, + branding_favicon, + branding_favicon_themed_urls, + branding_custom_css, + ui_footer_links, + ui_theme, + flow_authentication: None, + flow_invalidation: None, + flow_recovery: None, + flow_unenrollment: None, + flow_user_settings: None, + flow_device_code: None, + default_locale, + flags, + } + } +} diff --git a/packages/client-rust/src/models/current_brand_flags.rs b/packages/client-rust/src/models/current_brand_flags.rs new file mode 100644 index 0000000000..e7fee8f094 --- /dev/null +++ b/packages/client-rust/src/models/current_brand_flags.rs @@ -0,0 +1,44 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CurrentBrandFlags { + /// Configure if applications without any policy/group/user bindings should be accessible to + /// any user. + #[serde(rename = "core_default_app_access")] + pub core_default_app_access: bool, + /// Include additional information in audit logs, may incur a performance penalty. + #[serde(rename = "enterprise_audit_include_expanded_diff")] + pub enterprise_audit_include_expanded_diff: bool, + /// Upon successful authentication, re-start authentication in other open tabs. + #[serde(rename = "flows_continuous_login")] + pub flows_continuous_login: bool, + /// Refresh other tabs after successful authentication. + #[serde(rename = "flows_refresh_others")] + pub flows_refresh_others: bool, +} + +impl CurrentBrandFlags { + pub fn new( + core_default_app_access: bool, + enterprise_audit_include_expanded_diff: bool, + flows_continuous_login: bool, + flows_refresh_others: bool, + ) -> CurrentBrandFlags { + CurrentBrandFlags { + core_default_app_access, + enterprise_audit_include_expanded_diff, + flows_continuous_login, + flows_refresh_others, + } + } +} diff --git a/packages/client-rust/src/models/data_export.rs b/packages/client-rust/src/models/data_export.rs new file mode 100644 index 0000000000..7fa2b1e9cf --- /dev/null +++ b/packages/client-rust/src/models/data_export.rs @@ -0,0 +1,54 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DataExport : Mixin to validate that a valid enterprise license exists before allowing to save +/// the object +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataExport { + #[serde(rename = "id")] + pub id: uuid::Uuid, + #[serde(rename = "requested_by")] + pub requested_by: models::PartialUser, + #[serde(rename = "requested_on")] + pub requested_on: String, + #[serde(rename = "content_type")] + pub content_type: models::ContentType, + #[serde(rename = "query_params")] + pub query_params: std::collections::HashMap, + #[serde(rename = "file_url")] + pub file_url: String, + #[serde(rename = "completed")] + pub completed: bool, +} + +impl DataExport { + /// Mixin to validate that a valid enterprise license exists before allowing to save the object + pub fn new( + id: uuid::Uuid, + requested_by: models::PartialUser, + requested_on: String, + content_type: models::ContentType, + query_params: std::collections::HashMap, + file_url: String, + completed: bool, + ) -> DataExport { + DataExport { + id, + requested_by, + requested_on, + content_type, + query_params, + file_url, + completed, + } + } +} diff --git a/packages/client-rust/src/models/delivery_method_enum.rs b/packages/client-rust/src/models/delivery_method_enum.rs new file mode 100644 index 0000000000..2d5d0ebe7b --- /dev/null +++ b/packages/client-rust/src/models/delivery_method_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum DeliveryMethodEnum { + #[serde(rename = "https://schemas.openid.net/secevent/risc/delivery-method/push")] + HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashRiscSlashDeliveryMethodSlashPush, + #[serde(rename = "https://schemas.openid.net/secevent/risc/delivery-method/poll")] + HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashRiscSlashDeliveryMethodSlashPoll, +} + +impl std::fmt::Display for DeliveryMethodEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashRiscSlashDeliveryMethodSlashPush => write!(f, "https://schemas.openid.net/secevent/risc/delivery-method/push"), + Self::HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashRiscSlashDeliveryMethodSlashPoll => write!(f, "https://schemas.openid.net/secevent/risc/delivery-method/poll"), + } + } +} + +impl Default for DeliveryMethodEnum { + fn default() -> DeliveryMethodEnum { + Self::HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashRiscSlashDeliveryMethodSlashPush + } +} diff --git a/packages/client-rust/src/models/denied_action_enum.rs b/packages/client-rust/src/models/denied_action_enum.rs new file mode 100644 index 0000000000..af737fe64f --- /dev/null +++ b/packages/client-rust/src/models/denied_action_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum DeniedActionEnum { + #[serde(rename = "message_continue")] + MessageContinue, + #[serde(rename = "message")] + Message, + #[serde(rename = "continue")] + Continue, +} + +impl std::fmt::Display for DeniedActionEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::MessageContinue => write!(f, "message_continue"), + Self::Message => write!(f, "message"), + Self::Continue => write!(f, "continue"), + } + } +} + +impl Default for DeniedActionEnum { + fn default() -> DeniedActionEnum { + Self::MessageContinue + } +} diff --git a/packages/client-rust/src/models/deny_stage.rs b/packages/client-rust/src/models/deny_stage.rs new file mode 100644 index 0000000000..3ed39d3810 --- /dev/null +++ b/packages/client-rust/src/models/deny_stage.rs @@ -0,0 +1,60 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DenyStage : DenyStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DenyStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + #[serde(rename = "deny_message", skip_serializing_if = "Option::is_none")] + pub deny_message: Option, +} + +impl DenyStage { + /// DenyStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + ) -> DenyStage { + DenyStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + deny_message: None, + } + } +} diff --git a/packages/client-rust/src/models/deny_stage_request.rs b/packages/client-rust/src/models/deny_stage_request.rs new file mode 100644 index 0000000000..274e01d060 --- /dev/null +++ b/packages/client-rust/src/models/deny_stage_request.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DenyStageRequest : DenyStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DenyStageRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "deny_message", skip_serializing_if = "Option::is_none")] + pub deny_message: Option, +} + +impl DenyStageRequest { + /// DenyStage Serializer + pub fn new(name: String) -> DenyStageRequest { + DenyStageRequest { + name, + deny_message: None, + } + } +} diff --git a/packages/client-rust/src/models/detailed_country.rs b/packages/client-rust/src/models/detailed_country.rs new file mode 100644 index 0000000000..9e6b6907aa --- /dev/null +++ b/packages/client-rust/src/models/detailed_country.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DetailedCountry { + #[serde(rename = "code")] + pub code: models::CountryCodeEnum, + #[serde(rename = "name")] + pub name: String, +} + +impl DetailedCountry { + pub fn new(code: models::CountryCodeEnum, name: String) -> DetailedCountry { + DetailedCountry { code, name } + } +} diff --git a/packages/client-rust/src/models/device.rs b/packages/client-rust/src/models/device.rs new file mode 100644 index 0000000000..7dd6c5d649 --- /dev/null +++ b/packages/client-rust/src/models/device.rs @@ -0,0 +1,79 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Device : Serializer for authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Device { + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "pk")] + pub pk: String, + #[serde(rename = "name")] + pub name: String, + /// Get type of device + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "confirmed")] + pub confirmed: bool, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "last_updated")] + pub last_updated: String, + #[serde(rename = "last_used", deserialize_with = "Option::deserialize")] + pub last_used: Option, + /// Get extra description + #[serde(rename = "extra_description", deserialize_with = "Option::deserialize")] + pub extra_description: Option, + /// Get external Device ID + #[serde(rename = "external_id", deserialize_with = "Option::deserialize")] + pub external_id: Option, +} + +impl Device { + /// Serializer for authenticator devices + pub fn new( + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + pk: String, + name: String, + r#type: String, + confirmed: bool, + created: String, + last_updated: String, + last_used: Option, + extra_description: Option, + external_id: Option, + ) -> Device { + Device { + verbose_name, + verbose_name_plural, + meta_model_name, + pk, + name, + r#type, + confirmed, + created, + last_updated, + last_used, + extra_description, + external_id, + } + } +} diff --git a/packages/client-rust/src/models/device_access_group.rs b/packages/client-rust/src/models/device_access_group.rs new file mode 100644 index 0000000000..ef6ab2373c --- /dev/null +++ b/packages/client-rust/src/models/device_access_group.rs @@ -0,0 +1,31 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceAccessGroup { + #[serde(rename = "pbm_uuid")] + pub pbm_uuid: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl DeviceAccessGroup { + pub fn new(pbm_uuid: uuid::Uuid, name: String) -> DeviceAccessGroup { + DeviceAccessGroup { + pbm_uuid, + name, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/device_access_group_request.rs b/packages/client-rust/src/models/device_access_group_request.rs new file mode 100644 index 0000000000..4a22747fd9 --- /dev/null +++ b/packages/client-rust/src/models/device_access_group_request.rs @@ -0,0 +1,28 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceAccessGroupRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl DeviceAccessGroupRequest { + pub fn new(name: String) -> DeviceAccessGroupRequest { + DeviceAccessGroupRequest { + name, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/device_challenge.rs b/packages/client-rust/src/models/device_challenge.rs new file mode 100644 index 0000000000..e5498b4cd7 --- /dev/null +++ b/packages/client-rust/src/models/device_challenge.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DeviceChallenge : Single device challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceChallenge { + #[serde(rename = "device_class")] + pub device_class: models::DeviceClassesEnum, + #[serde(rename = "device_uid")] + pub device_uid: String, + #[serde(rename = "challenge")] + pub challenge: std::collections::HashMap, + #[serde(rename = "last_used", deserialize_with = "Option::deserialize")] + pub last_used: Option, +} + +impl DeviceChallenge { + /// Single device challenge + pub fn new( + device_class: models::DeviceClassesEnum, + device_uid: String, + challenge: std::collections::HashMap, + last_used: Option, + ) -> DeviceChallenge { + DeviceChallenge { + device_class, + device_uid, + challenge, + last_used, + } + } +} diff --git a/packages/client-rust/src/models/device_challenge_request.rs b/packages/client-rust/src/models/device_challenge_request.rs new file mode 100644 index 0000000000..72991223d9 --- /dev/null +++ b/packages/client-rust/src/models/device_challenge_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DeviceChallengeRequest : Single device challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceChallengeRequest { + #[serde(rename = "device_class")] + pub device_class: models::DeviceClassesEnum, + #[serde(rename = "device_uid")] + pub device_uid: String, + #[serde(rename = "challenge")] + pub challenge: std::collections::HashMap, + #[serde(rename = "last_used", deserialize_with = "Option::deserialize")] + pub last_used: Option, +} + +impl DeviceChallengeRequest { + /// Single device challenge + pub fn new( + device_class: models::DeviceClassesEnum, + device_uid: String, + challenge: std::collections::HashMap, + last_used: Option, + ) -> DeviceChallengeRequest { + DeviceChallengeRequest { + device_class, + device_uid, + challenge, + last_used, + } + } +} diff --git a/packages/client-rust/src/models/device_classes_enum.rs b/packages/client-rust/src/models/device_classes_enum.rs new file mode 100644 index 0000000000..d7c00ce2ab --- /dev/null +++ b/packages/client-rust/src/models/device_classes_enum.rs @@ -0,0 +1,47 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum DeviceClassesEnum { + #[serde(rename = "static")] + Static, + #[serde(rename = "totp")] + Totp, + #[serde(rename = "webauthn")] + Webauthn, + #[serde(rename = "duo")] + Duo, + #[serde(rename = "sms")] + Sms, + #[serde(rename = "email")] + Email, +} + +impl std::fmt::Display for DeviceClassesEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Static => write!(f, "static"), + Self::Totp => write!(f, "totp"), + Self::Webauthn => write!(f, "webauthn"), + Self::Duo => write!(f, "duo"), + Self::Sms => write!(f, "sms"), + Self::Email => write!(f, "email"), + } + } +} + +impl Default for DeviceClassesEnum { + fn default() -> DeviceClassesEnum { + Self::Static + } +} diff --git a/packages/client-rust/src/models/device_connection.rs b/packages/client-rust/src/models/device_connection.rs new file mode 100644 index 0000000000..52978e7476 --- /dev/null +++ b/packages/client-rust/src/models/device_connection.rs @@ -0,0 +1,39 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceConnection { + #[serde(rename = "device")] + pub device: uuid::Uuid, + #[serde(rename = "connector")] + pub connector: uuid::Uuid, + #[serde(rename = "connector_obj")] + pub connector_obj: models::Connector, + #[serde(rename = "latest_snapshot", deserialize_with = "Option::deserialize")] + pub latest_snapshot: Option, +} + +impl DeviceConnection { + pub fn new( + device: uuid::Uuid, + connector: uuid::Uuid, + connector_obj: models::Connector, + latest_snapshot: Option, + ) -> DeviceConnection { + DeviceConnection { + device, + connector, + connector_obj, + latest_snapshot, + } + } +} diff --git a/packages/client-rust/src/models/device_fact_snapshot.rs b/packages/client-rust/src/models/device_fact_snapshot.rs new file mode 100644 index 0000000000..fc4a96abd6 --- /dev/null +++ b/packages/client-rust/src/models/device_fact_snapshot.rs @@ -0,0 +1,43 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceFactSnapshot { + #[serde(rename = "data")] + pub data: models::DeviceFacts, + #[serde(rename = "connection")] + pub connection: uuid::Uuid, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "expires", deserialize_with = "Option::deserialize")] + pub expires: Option, + #[serde(rename = "vendor")] + pub vendor: models::VendorEnum, +} + +impl DeviceFactSnapshot { + pub fn new( + data: models::DeviceFacts, + connection: uuid::Uuid, + created: String, + expires: Option, + vendor: models::VendorEnum, + ) -> DeviceFactSnapshot { + DeviceFactSnapshot { + data, + connection, + created, + expires, + vendor, + } + } +} diff --git a/packages/client-rust/src/models/device_facts.rs b/packages/client-rust/src/models/device_facts.rs new file mode 100644 index 0000000000..2a1d33d0cc --- /dev/null +++ b/packages/client-rust/src/models/device_facts.rs @@ -0,0 +1,89 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceFacts { + #[serde( + rename = "os", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub os: Option>, + #[serde( + rename = "disks", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub disks: Option>>, + #[serde( + rename = "network", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub network: Option>, + #[serde( + rename = "hardware", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub hardware: Option>, + #[serde( + rename = "software", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub software: Option>>, + #[serde( + rename = "processes", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub processes: Option>>, + #[serde( + rename = "users", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub users: Option>>, + #[serde( + rename = "groups", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub groups: Option>>, + #[serde(rename = "vendor", skip_serializing_if = "Option::is_none")] + pub vendor: Option>, +} + +impl DeviceFacts { + pub fn new() -> DeviceFacts { + DeviceFacts { + os: None, + disks: None, + network: None, + hardware: None, + software: None, + processes: None, + users: None, + groups: None, + vendor: None, + } + } +} diff --git a/packages/client-rust/src/models/device_facts_os_family.rs b/packages/client-rust/src/models/device_facts_os_family.rs new file mode 100644 index 0000000000..34e948fc9b --- /dev/null +++ b/packages/client-rust/src/models/device_facts_os_family.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum DeviceFactsOsFamily { + #[serde(rename = "linux")] + Linux, + #[serde(rename = "unix")] + Unix, + #[serde(rename = "bsd")] + Bsd, + #[serde(rename = "windows")] + Windows, + #[serde(rename = "mac_os")] + MacOs, + #[serde(rename = "android")] + Android, + #[serde(rename = "i_os")] + IOs, + #[serde(rename = "other")] + Other, +} + +impl std::fmt::Display for DeviceFactsOsFamily { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Linux => write!(f, "linux"), + Self::Unix => write!(f, "unix"), + Self::Bsd => write!(f, "bsd"), + Self::Windows => write!(f, "windows"), + Self::MacOs => write!(f, "mac_os"), + Self::Android => write!(f, "android"), + Self::IOs => write!(f, "i_os"), + Self::Other => write!(f, "other"), + } + } +} + +impl Default for DeviceFactsOsFamily { + fn default() -> DeviceFactsOsFamily { + Self::Linux + } +} diff --git a/packages/client-rust/src/models/device_facts_request.rs b/packages/client-rust/src/models/device_facts_request.rs new file mode 100644 index 0000000000..5a1fa8688b --- /dev/null +++ b/packages/client-rust/src/models/device_facts_request.rs @@ -0,0 +1,89 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceFactsRequest { + #[serde( + rename = "os", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub os: Option>, + #[serde( + rename = "disks", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub disks: Option>>, + #[serde( + rename = "network", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub network: Option>, + #[serde( + rename = "hardware", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub hardware: Option>, + #[serde( + rename = "software", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub software: Option>>, + #[serde( + rename = "processes", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub processes: Option>>, + #[serde( + rename = "users", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub users: Option>>, + #[serde( + rename = "groups", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub groups: Option>>, + #[serde(rename = "vendor", skip_serializing_if = "Option::is_none")] + pub vendor: Option>, +} + +impl DeviceFactsRequest { + pub fn new() -> DeviceFactsRequest { + DeviceFactsRequest { + os: None, + disks: None, + network: None, + hardware: None, + software: None, + processes: None, + users: None, + groups: None, + vendor: None, + } + } +} diff --git a/packages/client-rust/src/models/device_group.rs b/packages/client-rust/src/models/device_group.rs new file mode 100644 index 0000000000..22d136769f --- /dev/null +++ b/packages/client-rust/src/models/device_group.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceGroup { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl DeviceGroup { + pub fn new(id: String) -> DeviceGroup { + DeviceGroup { id, name: None } + } +} diff --git a/packages/client-rust/src/models/device_group_request.rs b/packages/client-rust/src/models/device_group_request.rs new file mode 100644 index 0000000000..4999bbf963 --- /dev/null +++ b/packages/client-rust/src/models/device_group_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceGroupRequest { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl DeviceGroupRequest { + pub fn new(id: String) -> DeviceGroupRequest { + DeviceGroupRequest { id, name: None } + } +} diff --git a/packages/client-rust/src/models/device_summary.rs b/packages/client-rust/src/models/device_summary.rs new file mode 100644 index 0000000000..7a4e33b096 --- /dev/null +++ b/packages/client-rust/src/models/device_summary.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DeviceSummary : Summary of registered devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceSummary { + #[serde(rename = "total_count")] + pub total_count: i32, + #[serde(rename = "unreachable_count")] + pub unreachable_count: i32, + #[serde(rename = "outdated_agent_count")] + pub outdated_agent_count: i32, +} + +impl DeviceSummary { + /// Summary of registered devices + pub fn new( + total_count: i32, + unreachable_count: i32, + outdated_agent_count: i32, + ) -> DeviceSummary { + DeviceSummary { + total_count, + unreachable_count, + outdated_agent_count, + } + } +} diff --git a/packages/client-rust/src/models/device_user.rs b/packages/client-rust/src/models/device_user.rs new file mode 100644 index 0000000000..9dbd020408 --- /dev/null +++ b/packages/client-rust/src/models/device_user.rs @@ -0,0 +1,34 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceUser { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "home", skip_serializing_if = "Option::is_none")] + pub home: Option, +} + +impl DeviceUser { + pub fn new(id: String) -> DeviceUser { + DeviceUser { + id, + username: None, + name: None, + home: None, + } + } +} diff --git a/packages/client-rust/src/models/device_user_binding.rs b/packages/client-rust/src/models/device_user_binding.rs new file mode 100644 index 0000000000..3102af1c1f --- /dev/null +++ b/packages/client-rust/src/models/device_user_binding.rs @@ -0,0 +1,99 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DeviceUserBinding : PolicyBinding Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceUserBinding { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde( + rename = "policy", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub policy: Option>, + #[serde( + rename = "group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub group: Option>, + #[serde( + rename = "user", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub user: Option>, + #[serde(rename = "policy_obj")] + pub policy_obj: models::Policy, + #[serde(rename = "group_obj")] + pub group_obj: models::PartialGroup, + #[serde(rename = "user_obj")] + pub user_obj: models::PartialUser, + #[serde(rename = "target")] + pub target: uuid::Uuid, + /// Negates the outcome of the policy. Messages are unaffected. + #[serde(rename = "negate", skip_serializing_if = "Option::is_none")] + pub negate: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "order")] + pub order: i32, + /// Timeout after which Policy execution is terminated. + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + /// Result if the Policy execution fails. + #[serde(rename = "failure_result", skip_serializing_if = "Option::is_none")] + pub failure_result: Option, + #[serde(rename = "is_primary", skip_serializing_if = "Option::is_none")] + pub is_primary: Option, + #[serde(rename = "connector", deserialize_with = "Option::deserialize")] + pub connector: Option, + #[serde(rename = "connector_obj")] + pub connector_obj: models::Connector, +} + +impl DeviceUserBinding { + /// PolicyBinding Serializer + pub fn new( + pk: uuid::Uuid, + policy_obj: models::Policy, + group_obj: models::PartialGroup, + user_obj: models::PartialUser, + target: uuid::Uuid, + order: i32, + connector: Option, + connector_obj: models::Connector, + ) -> DeviceUserBinding { + DeviceUserBinding { + pk, + policy: None, + group: None, + user: None, + policy_obj, + group_obj, + user_obj, + target, + negate: None, + enabled: None, + order, + timeout: None, + failure_result: None, + is_primary: None, + connector, + connector_obj, + } + } +} diff --git a/packages/client-rust/src/models/device_user_binding_request.rs b/packages/client-rust/src/models/device_user_binding_request.rs new file mode 100644 index 0000000000..d98b0d9140 --- /dev/null +++ b/packages/client-rust/src/models/device_user_binding_request.rs @@ -0,0 +1,72 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DeviceUserBindingRequest : PolicyBinding Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceUserBindingRequest { + #[serde( + rename = "policy", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub policy: Option>, + #[serde( + rename = "group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub group: Option>, + #[serde( + rename = "user", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub user: Option>, + #[serde(rename = "target")] + pub target: uuid::Uuid, + /// Negates the outcome of the policy. Messages are unaffected. + #[serde(rename = "negate", skip_serializing_if = "Option::is_none")] + pub negate: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "order")] + pub order: i32, + /// Timeout after which Policy execution is terminated. + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + /// Result if the Policy execution fails. + #[serde(rename = "failure_result", skip_serializing_if = "Option::is_none")] + pub failure_result: Option, + #[serde(rename = "is_primary", skip_serializing_if = "Option::is_none")] + pub is_primary: Option, +} + +impl DeviceUserBindingRequest { + /// PolicyBinding Serializer + pub fn new(target: uuid::Uuid, order: i32) -> DeviceUserBindingRequest { + DeviceUserBindingRequest { + policy: None, + group: None, + user: None, + target, + negate: None, + enabled: None, + order, + timeout: None, + failure_result: None, + is_primary: None, + } + } +} diff --git a/packages/client-rust/src/models/device_user_request.rs b/packages/client-rust/src/models/device_user_request.rs new file mode 100644 index 0000000000..c452753e78 --- /dev/null +++ b/packages/client-rust/src/models/device_user_request.rs @@ -0,0 +1,34 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DeviceUserRequest { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "home", skip_serializing_if = "Option::is_none")] + pub home: Option, +} + +impl DeviceUserRequest { + pub fn new(id: String) -> DeviceUserRequest { + DeviceUserRequest { + id, + username: None, + name: None, + home: None, + } + } +} diff --git a/packages/client-rust/src/models/digest_algorithm_enum.rs b/packages/client-rust/src/models/digest_algorithm_enum.rs new file mode 100644 index 0000000000..cb85d7b82c --- /dev/null +++ b/packages/client-rust/src/models/digest_algorithm_enum.rs @@ -0,0 +1,49 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum DigestAlgorithmEnum { + #[serde(rename = "http://www.w3.org/2000/09/xmldsig#sha1")] + HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashSha1, + #[serde(rename = "http://www.w3.org/2001/04/xmlenc#sha256")] + HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmlencHashSha256, + #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#sha384")] + HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashSha384, + #[serde(rename = "http://www.w3.org/2001/04/xmlenc#sha512")] + HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmlencHashSha512, +} + +impl std::fmt::Display for DigestAlgorithmEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashSha1 => { + write!(f, "http://www.w3.org/2000/09/xmldsig#sha1") + } + Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmlencHashSha256 => { + write!(f, "http://www.w3.org/2001/04/xmlenc#sha256") + } + Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashSha384 => { + write!(f, "http://www.w3.org/2001/04/xmldsig-more#sha384") + } + Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmlencHashSha512 => { + write!(f, "http://www.w3.org/2001/04/xmlenc#sha512") + } + } + } +} + +impl Default for DigestAlgorithmEnum { + fn default() -> DigestAlgorithmEnum { + Self::HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashSha1 + } +} diff --git a/packages/client-rust/src/models/digits_enum.rs b/packages/client-rust/src/models/digits_enum.rs new file mode 100644 index 0000000000..510ff44d70 --- /dev/null +++ b/packages/client-rust/src/models/digits_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum DigitsEnum { + #[serde(rename = "6")] + Variant6, + #[serde(rename = "8")] + Variant8, +} + +impl std::fmt::Display for DigitsEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Variant6 => write!(f, "6"), + Self::Variant8 => write!(f, "8"), + } + } +} + +impl Default for DigitsEnum { + fn default() -> DigitsEnum { + Self::Variant6 + } +} diff --git a/packages/client-rust/src/models/disk.rs b/packages/client-rust/src/models/disk.rs new file mode 100644 index 0000000000..7c4d1afdea --- /dev/null +++ b/packages/client-rust/src/models/disk.rs @@ -0,0 +1,46 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Disk { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "mountpoint")] + pub mountpoint: String, + #[serde(rename = "label", skip_serializing_if = "Option::is_none")] + pub label: Option, + #[serde( + rename = "capacity_total_bytes", + skip_serializing_if = "Option::is_none" + )] + pub capacity_total_bytes: Option, + #[serde( + rename = "capacity_used_bytes", + skip_serializing_if = "Option::is_none" + )] + pub capacity_used_bytes: Option, + #[serde(rename = "encryption_enabled", skip_serializing_if = "Option::is_none")] + pub encryption_enabled: Option, +} + +impl Disk { + pub fn new(name: String, mountpoint: String) -> Disk { + Disk { + name, + mountpoint, + label: None, + capacity_total_bytes: None, + capacity_used_bytes: None, + encryption_enabled: None, + } + } +} diff --git a/packages/client-rust/src/models/disk_request.rs b/packages/client-rust/src/models/disk_request.rs new file mode 100644 index 0000000000..b4fe9ea6e4 --- /dev/null +++ b/packages/client-rust/src/models/disk_request.rs @@ -0,0 +1,46 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DiskRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "mountpoint")] + pub mountpoint: String, + #[serde(rename = "label", skip_serializing_if = "Option::is_none")] + pub label: Option, + #[serde( + rename = "capacity_total_bytes", + skip_serializing_if = "Option::is_none" + )] + pub capacity_total_bytes: Option, + #[serde( + rename = "capacity_used_bytes", + skip_serializing_if = "Option::is_none" + )] + pub capacity_used_bytes: Option, + #[serde(rename = "encryption_enabled", skip_serializing_if = "Option::is_none")] + pub encryption_enabled: Option, +} + +impl DiskRequest { + pub fn new(name: String, mountpoint: String) -> DiskRequest { + DiskRequest { + name, + mountpoint, + label: None, + capacity_total_bytes: None, + capacity_used_bytes: None, + encryption_enabled: None, + } + } +} diff --git a/packages/client-rust/src/models/docker_service_connection.rs b/packages/client-rust/src/models/docker_service_connection.rs new file mode 100644 index 0000000000..fe2cec9dfd --- /dev/null +++ b/packages/client-rust/src/models/docker_service_connection.rs @@ -0,0 +1,80 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DockerServiceConnection : DockerServiceConnection Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DockerServiceConnection { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// If enabled, use the local connection. Required Docker socket/Kubernetes Integration + #[serde(rename = "local", skip_serializing_if = "Option::is_none")] + pub local: Option, + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Can be in the format of 'unix://' when connecting to a local docker daemon, or 'https://:2376' when connecting to a remote system. + #[serde(rename = "url")] + pub url: String, + /// CA which the endpoint's Certificate is verified against. Can be left empty for no + /// validation. + #[serde( + rename = "tls_verification", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub tls_verification: Option>, + /// Certificate/Key used for authentication. Can be left empty for no authentication. + #[serde( + rename = "tls_authentication", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub tls_authentication: Option>, +} + +impl DockerServiceConnection { + /// DockerServiceConnection Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + url: String, + ) -> DockerServiceConnection { + DockerServiceConnection { + pk, + name, + local: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + url, + tls_verification: None, + tls_authentication: None, + } + } +} diff --git a/packages/client-rust/src/models/docker_service_connection_request.rs b/packages/client-rust/src/models/docker_service_connection_request.rs new file mode 100644 index 0000000000..df47d8e695 --- /dev/null +++ b/packages/client-rust/src/models/docker_service_connection_request.rs @@ -0,0 +1,54 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DockerServiceConnectionRequest : DockerServiceConnection Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DockerServiceConnectionRequest { + #[serde(rename = "name")] + pub name: String, + /// If enabled, use the local connection. Required Docker socket/Kubernetes Integration + #[serde(rename = "local", skip_serializing_if = "Option::is_none")] + pub local: Option, + /// Can be in the format of 'unix://' when connecting to a local docker daemon, or 'https://:2376' when connecting to a remote system. + #[serde(rename = "url")] + pub url: String, + /// CA which the endpoint's Certificate is verified against. Can be left empty for no + /// validation. + #[serde( + rename = "tls_verification", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub tls_verification: Option>, + /// Certificate/Key used for authentication. Can be left empty for no authentication. + #[serde( + rename = "tls_authentication", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub tls_authentication: Option>, +} + +impl DockerServiceConnectionRequest { + /// DockerServiceConnection Serializer + pub fn new(name: String, url: String) -> DockerServiceConnectionRequest { + DockerServiceConnectionRequest { + name, + local: None, + url, + tls_verification: None, + tls_authentication: None, + } + } +} diff --git a/packages/client-rust/src/models/domain.rs b/packages/client-rust/src/models/domain.rs new file mode 100644 index 0000000000..d2ad597af2 --- /dev/null +++ b/packages/client-rust/src/models/domain.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Domain : Domain Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Domain { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "domain")] + pub domain: String, + #[serde(rename = "is_primary", skip_serializing_if = "Option::is_none")] + pub is_primary: Option, + #[serde(rename = "tenant")] + pub tenant: uuid::Uuid, +} + +impl Domain { + /// Domain Serializer + pub fn new(id: i32, domain: String, tenant: uuid::Uuid) -> Domain { + Domain { + id, + domain, + is_primary: None, + tenant, + } + } +} diff --git a/packages/client-rust/src/models/domain_request.rs b/packages/client-rust/src/models/domain_request.rs new file mode 100644 index 0000000000..dc65c52e50 --- /dev/null +++ b/packages/client-rust/src/models/domain_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DomainRequest : Domain Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DomainRequest { + #[serde(rename = "domain")] + pub domain: String, + #[serde(rename = "is_primary", skip_serializing_if = "Option::is_none")] + pub is_primary: Option, + #[serde(rename = "tenant")] + pub tenant: uuid::Uuid, +} + +impl DomainRequest { + /// Domain Serializer + pub fn new(domain: String, tenant: uuid::Uuid) -> DomainRequest { + DomainRequest { + domain, + is_primary: None, + tenant, + } + } +} diff --git a/packages/client-rust/src/models/dummy_challenge.rs b/packages/client-rust/src/models/dummy_challenge.rs new file mode 100644 index 0000000000..645a6dda91 --- /dev/null +++ b/packages/client-rust/src/models/dummy_challenge.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DummyChallenge : Dummy challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DummyChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "name")] + pub name: String, +} + +impl DummyChallenge { + /// Dummy challenge + pub fn new(name: String) -> DummyChallenge { + DummyChallenge { + flow_info: None, + component: None, + response_errors: None, + name, + } + } +} diff --git a/packages/client-rust/src/models/dummy_challenge_response_request.rs b/packages/client-rust/src/models/dummy_challenge_response_request.rs new file mode 100644 index 0000000000..c6f171db72 --- /dev/null +++ b/packages/client-rust/src/models/dummy_challenge_response_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DummyChallengeResponseRequest : Dummy challenge response +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DummyChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, +} + +impl DummyChallengeResponseRequest { + /// Dummy challenge response + pub fn new() -> DummyChallengeResponseRequest { + DummyChallengeResponseRequest { component: None } + } +} diff --git a/packages/client-rust/src/models/dummy_policy.rs b/packages/client-rust/src/models/dummy_policy.rs new file mode 100644 index 0000000000..aa567ad132 --- /dev/null +++ b/packages/client-rust/src/models/dummy_policy.rs @@ -0,0 +1,72 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DummyPolicy : Dummy Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DummyPolicy { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Return objects policy is bound to + #[serde(rename = "bound_to")] + pub bound_to: i32, + #[serde(rename = "result", skip_serializing_if = "Option::is_none")] + pub result: Option, + #[serde(rename = "wait_min", skip_serializing_if = "Option::is_none")] + pub wait_min: Option, + #[serde(rename = "wait_max", skip_serializing_if = "Option::is_none")] + pub wait_max: Option, +} + +impl DummyPolicy { + /// Dummy Policy Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + bound_to: i32, + ) -> DummyPolicy { + DummyPolicy { + pk, + name, + execution_logging: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + bound_to, + result: None, + wait_min: None, + wait_max: None, + } + } +} diff --git a/packages/client-rust/src/models/dummy_policy_request.rs b/packages/client-rust/src/models/dummy_policy_request.rs new file mode 100644 index 0000000000..2dd07d1c09 --- /dev/null +++ b/packages/client-rust/src/models/dummy_policy_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DummyPolicyRequest : Dummy Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DummyPolicyRequest { + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + #[serde(rename = "result", skip_serializing_if = "Option::is_none")] + pub result: Option, + #[serde(rename = "wait_min", skip_serializing_if = "Option::is_none")] + pub wait_min: Option, + #[serde(rename = "wait_max", skip_serializing_if = "Option::is_none")] + pub wait_max: Option, +} + +impl DummyPolicyRequest { + /// Dummy Policy Serializer + pub fn new(name: String) -> DummyPolicyRequest { + DummyPolicyRequest { + name, + execution_logging: None, + result: None, + wait_min: None, + wait_max: None, + } + } +} diff --git a/packages/client-rust/src/models/dummy_stage.rs b/packages/client-rust/src/models/dummy_stage.rs new file mode 100644 index 0000000000..f6cc98cfb3 --- /dev/null +++ b/packages/client-rust/src/models/dummy_stage.rs @@ -0,0 +1,60 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DummyStage : DummyStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DummyStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + #[serde(rename = "throw_error", skip_serializing_if = "Option::is_none")] + pub throw_error: Option, +} + +impl DummyStage { + /// DummyStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + ) -> DummyStage { + DummyStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + throw_error: None, + } + } +} diff --git a/packages/client-rust/src/models/dummy_stage_request.rs b/packages/client-rust/src/models/dummy_stage_request.rs new file mode 100644 index 0000000000..433af742ce --- /dev/null +++ b/packages/client-rust/src/models/dummy_stage_request.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DummyStageRequest : DummyStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DummyStageRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "throw_error", skip_serializing_if = "Option::is_none")] + pub throw_error: Option, +} + +impl DummyStageRequest { + /// DummyStage Serializer + pub fn new(name: String) -> DummyStageRequest { + DummyStageRequest { + name, + throw_error: None, + } + } +} diff --git a/packages/client-rust/src/models/duo_device.rs b/packages/client-rust/src/models/duo_device.rs new file mode 100644 index 0000000000..95b63d3296 --- /dev/null +++ b/packages/client-rust/src/models/duo_device.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DuoDevice : Serializer for Duo authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DuoDevice { + #[serde(rename = "pk")] + pub pk: i32, + /// The human-readable name of this device. + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "user")] + pub user: models::PartialUser, +} + +impl DuoDevice { + /// Serializer for Duo authenticator devices + pub fn new(pk: i32, name: String, user: models::PartialUser) -> DuoDevice { + DuoDevice { pk, name, user } + } +} diff --git a/packages/client-rust/src/models/duo_device_enrollment_status.rs b/packages/client-rust/src/models/duo_device_enrollment_status.rs new file mode 100644 index 0000000000..d47f2a8406 --- /dev/null +++ b/packages/client-rust/src/models/duo_device_enrollment_status.rs @@ -0,0 +1,23 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DuoDeviceEnrollmentStatus { + #[serde(rename = "duo_response")] + pub duo_response: models::DuoResponseEnum, +} + +impl DuoDeviceEnrollmentStatus { + pub fn new(duo_response: models::DuoResponseEnum) -> DuoDeviceEnrollmentStatus { + DuoDeviceEnrollmentStatus { duo_response } + } +} diff --git a/packages/client-rust/src/models/duo_device_request.rs b/packages/client-rust/src/models/duo_device_request.rs new file mode 100644 index 0000000000..6e8020e27e --- /dev/null +++ b/packages/client-rust/src/models/duo_device_request.rs @@ -0,0 +1,26 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// DuoDeviceRequest : Serializer for Duo authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DuoDeviceRequest { + /// The human-readable name of this device. + #[serde(rename = "name")] + pub name: String, +} + +impl DuoDeviceRequest { + /// Serializer for Duo authenticator devices + pub fn new(name: String) -> DuoDeviceRequest { + DuoDeviceRequest { name } + } +} diff --git a/packages/client-rust/src/models/duo_response_enum.rs b/packages/client-rust/src/models/duo_response_enum.rs new file mode 100644 index 0000000000..f031247afe --- /dev/null +++ b/packages/client-rust/src/models/duo_response_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum DuoResponseEnum { + #[serde(rename = "success")] + Success, + #[serde(rename = "waiting")] + Waiting, + #[serde(rename = "invalid")] + Invalid, +} + +impl std::fmt::Display for DuoResponseEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Success => write!(f, "success"), + Self::Waiting => write!(f, "waiting"), + Self::Invalid => write!(f, "invalid"), + } + } +} + +impl Default for DuoResponseEnum { + fn default() -> DuoResponseEnum { + Self::Success + } +} diff --git a/packages/client-rust/src/models/email_challenge.rs b/packages/client-rust/src/models/email_challenge.rs new file mode 100644 index 0000000000..9e656dce47 --- /dev/null +++ b/packages/client-rust/src/models/email_challenge.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EmailChallenge : Email challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EmailChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, +} + +impl EmailChallenge { + /// Email challenge + pub fn new() -> EmailChallenge { + EmailChallenge { + flow_info: None, + component: None, + response_errors: None, + } + } +} diff --git a/packages/client-rust/src/models/email_challenge_response_request.rs b/packages/client-rust/src/models/email_challenge_response_request.rs new file mode 100644 index 0000000000..ac2c8764c1 --- /dev/null +++ b/packages/client-rust/src/models/email_challenge_response_request.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EmailChallengeResponseRequest : Email challenge resposen. No fields. This challenge is always +/// declared invalid to give the user a chance to retry +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EmailChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, +} + +impl EmailChallengeResponseRequest { + /// Email challenge resposen. No fields. This challenge is always declared invalid to give the + /// user a chance to retry + pub fn new() -> EmailChallengeResponseRequest { + EmailChallengeResponseRequest { component: None } + } +} diff --git a/packages/client-rust/src/models/email_device.rs b/packages/client-rust/src/models/email_device.rs new file mode 100644 index 0000000000..ecbe314bf5 --- /dev/null +++ b/packages/client-rust/src/models/email_device.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EmailDevice : Serializer for email authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EmailDevice { + /// The human-readable name of this device. + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "email")] + pub email: String, + #[serde(rename = "user")] + pub user: models::PartialUser, +} + +impl EmailDevice { + /// Serializer for email authenticator devices + pub fn new(name: String, pk: i32, email: String, user: models::PartialUser) -> EmailDevice { + EmailDevice { + name, + pk, + email, + user, + } + } +} diff --git a/packages/client-rust/src/models/email_device_request.rs b/packages/client-rust/src/models/email_device_request.rs new file mode 100644 index 0000000000..14d8be93e6 --- /dev/null +++ b/packages/client-rust/src/models/email_device_request.rs @@ -0,0 +1,26 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EmailDeviceRequest : Serializer for email authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EmailDeviceRequest { + /// The human-readable name of this device. + #[serde(rename = "name")] + pub name: String, +} + +impl EmailDeviceRequest { + /// Serializer for email authenticator devices + pub fn new(name: String) -> EmailDeviceRequest { + EmailDeviceRequest { name } + } +} diff --git a/packages/client-rust/src/models/email_stage.rs b/packages/client-rust/src/models/email_stage.rs new file mode 100644 index 0000000000..bc34d640a8 --- /dev/null +++ b/packages/client-rust/src/models/email_stage.rs @@ -0,0 +1,118 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EmailStage : EmailStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EmailStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + /// When enabled, global Email connection settings will be used and connection settings below + /// will be ignored. + #[serde( + rename = "use_global_settings", + skip_serializing_if = "Option::is_none" + )] + pub use_global_settings: Option, + #[serde(rename = "host", skip_serializing_if = "Option::is_none")] + pub host: Option, + #[serde(rename = "port", skip_serializing_if = "Option::is_none")] + pub port: Option, + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")] + pub use_tls: Option, + #[serde(rename = "use_ssl", skip_serializing_if = "Option::is_none")] + pub use_ssl: Option, + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + #[serde(rename = "from_address", skip_serializing_if = "Option::is_none")] + pub from_address: Option, + /// Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). + #[serde(rename = "token_expiry", skip_serializing_if = "Option::is_none")] + pub token_expiry: Option, + #[serde(rename = "subject", skip_serializing_if = "Option::is_none")] + pub subject: Option, + #[serde(rename = "template", skip_serializing_if = "Option::is_none")] + pub template: Option, + /// Activate users upon completion of stage. + #[serde( + rename = "activate_user_on_success", + skip_serializing_if = "Option::is_none" + )] + pub activate_user_on_success: Option, + #[serde( + rename = "recovery_max_attempts", + skip_serializing_if = "Option::is_none" + )] + pub recovery_max_attempts: Option, + /// The time window used to count recent account recovery attempts. If the number of attempts + /// exceed recovery_max_attempts within this period, further attempts will be rate-limited. + /// (Format: hours=1;minutes=2;seconds=3). + #[serde( + rename = "recovery_cache_timeout", + skip_serializing_if = "Option::is_none" + )] + pub recovery_cache_timeout: Option, +} + +impl EmailStage { + /// EmailStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + ) -> EmailStage { + EmailStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + use_global_settings: None, + host: None, + port: None, + username: None, + use_tls: None, + use_ssl: None, + timeout: None, + from_address: None, + token_expiry: None, + subject: None, + template: None, + activate_user_on_success: None, + recovery_max_attempts: None, + recovery_cache_timeout: None, + } + } +} diff --git a/packages/client-rust/src/models/email_stage_request.rs b/packages/client-rust/src/models/email_stage_request.rs new file mode 100644 index 0000000000..ee7a9a7e47 --- /dev/null +++ b/packages/client-rust/src/models/email_stage_request.rs @@ -0,0 +1,91 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EmailStageRequest : EmailStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EmailStageRequest { + #[serde(rename = "name")] + pub name: String, + /// When enabled, global Email connection settings will be used and connection settings below + /// will be ignored. + #[serde( + rename = "use_global_settings", + skip_serializing_if = "Option::is_none" + )] + pub use_global_settings: Option, + #[serde(rename = "host", skip_serializing_if = "Option::is_none")] + pub host: Option, + #[serde(rename = "port", skip_serializing_if = "Option::is_none")] + pub port: Option, + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde(rename = "password", skip_serializing_if = "Option::is_none")] + pub password: Option, + #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")] + pub use_tls: Option, + #[serde(rename = "use_ssl", skip_serializing_if = "Option::is_none")] + pub use_ssl: Option, + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + #[serde(rename = "from_address", skip_serializing_if = "Option::is_none")] + pub from_address: Option, + /// Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). + #[serde(rename = "token_expiry", skip_serializing_if = "Option::is_none")] + pub token_expiry: Option, + #[serde(rename = "subject", skip_serializing_if = "Option::is_none")] + pub subject: Option, + #[serde(rename = "template", skip_serializing_if = "Option::is_none")] + pub template: Option, + /// Activate users upon completion of stage. + #[serde( + rename = "activate_user_on_success", + skip_serializing_if = "Option::is_none" + )] + pub activate_user_on_success: Option, + #[serde( + rename = "recovery_max_attempts", + skip_serializing_if = "Option::is_none" + )] + pub recovery_max_attempts: Option, + /// The time window used to count recent account recovery attempts. If the number of attempts + /// exceed recovery_max_attempts within this period, further attempts will be rate-limited. + /// (Format: hours=1;minutes=2;seconds=3). + #[serde( + rename = "recovery_cache_timeout", + skip_serializing_if = "Option::is_none" + )] + pub recovery_cache_timeout: Option, +} + +impl EmailStageRequest { + /// EmailStage Serializer + pub fn new(name: String) -> EmailStageRequest { + EmailStageRequest { + name, + use_global_settings: None, + host: None, + port: None, + username: None, + password: None, + use_tls: None, + use_ssl: None, + timeout: None, + from_address: None, + token_expiry: None, + subject: None, + template: None, + activate_user_on_success: None, + recovery_max_attempts: None, + recovery_cache_timeout: None, + } + } +} diff --git a/packages/client-rust/src/models/endpoint.rs b/packages/client-rust/src/models/endpoint.rs new file mode 100644 index 0000000000..51941afe2f --- /dev/null +++ b/packages/client-rust/src/models/endpoint.rs @@ -0,0 +1,70 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Endpoint : Endpoint Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Endpoint { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "provider")] + pub provider: i32, + #[serde(rename = "provider_obj")] + pub provider_obj: models::RacProvider, + #[serde(rename = "protocol")] + pub protocol: models::ProtocolEnum, + #[serde(rename = "host")] + pub host: String, + #[serde(rename = "settings", skip_serializing_if = "Option::is_none")] + pub settings: Option>, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + #[serde(rename = "auth_mode")] + pub auth_mode: models::EndpointAuthModeEnum, + /// Build actual launch URL (the provider itself does not have one, just individual endpoints) + #[serde(rename = "launch_url", deserialize_with = "Option::deserialize")] + pub launch_url: Option, + #[serde( + rename = "maximum_connections", + skip_serializing_if = "Option::is_none" + )] + pub maximum_connections: Option, +} + +impl Endpoint { + /// Endpoint Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + provider: i32, + provider_obj: models::RacProvider, + protocol: models::ProtocolEnum, + host: String, + auth_mode: models::EndpointAuthModeEnum, + launch_url: Option, + ) -> Endpoint { + Endpoint { + pk, + name, + provider, + provider_obj, + protocol, + host, + settings: None, + property_mappings: None, + auth_mode, + launch_url, + maximum_connections: None, + } + } +} diff --git a/packages/client-rust/src/models/endpoint_agent_challenge.rs b/packages/client-rust/src/models/endpoint_agent_challenge.rs new file mode 100644 index 0000000000..911cbb33ad --- /dev/null +++ b/packages/client-rust/src/models/endpoint_agent_challenge.rs @@ -0,0 +1,39 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EndpointAgentChallenge : Signed challenge for authentik agent to respond to +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EndpointAgentChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "challenge")] + pub challenge: String, + #[serde(rename = "challenge_idle_timeout")] + pub challenge_idle_timeout: i32, +} + +impl EndpointAgentChallenge { + /// Signed challenge for authentik agent to respond to + pub fn new(challenge: String, challenge_idle_timeout: i32) -> EndpointAgentChallenge { + EndpointAgentChallenge { + flow_info: None, + component: None, + response_errors: None, + challenge, + challenge_idle_timeout, + } + } +} diff --git a/packages/client-rust/src/models/endpoint_agent_challenge_response_request.rs b/packages/client-rust/src/models/endpoint_agent_challenge_response_request.rs new file mode 100644 index 0000000000..dad368a26c --- /dev/null +++ b/packages/client-rust/src/models/endpoint_agent_challenge_response_request.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EndpointAgentChallengeResponseRequest : Response to signed challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EndpointAgentChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde( + rename = "response", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub response: Option>, +} + +impl EndpointAgentChallengeResponseRequest { + /// Response to signed challenge + pub fn new() -> EndpointAgentChallengeResponseRequest { + EndpointAgentChallengeResponseRequest { + component: None, + response: None, + } + } +} diff --git a/packages/client-rust/src/models/endpoint_auth_mode_enum.rs b/packages/client-rust/src/models/endpoint_auth_mode_enum.rs new file mode 100644 index 0000000000..36d380d266 --- /dev/null +++ b/packages/client-rust/src/models/endpoint_auth_mode_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum EndpointAuthModeEnum { + #[serde(rename = "static")] + Static, + #[serde(rename = "prompt")] + Prompt, +} + +impl std::fmt::Display for EndpointAuthModeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Static => write!(f, "static"), + Self::Prompt => write!(f, "prompt"), + } + } +} + +impl Default for EndpointAuthModeEnum { + fn default() -> EndpointAuthModeEnum { + Self::Static + } +} diff --git a/packages/client-rust/src/models/endpoint_device.rs b/packages/client-rust/src/models/endpoint_device.rs new file mode 100644 index 0000000000..522d3326bd --- /dev/null +++ b/packages/client-rust/src/models/endpoint_device.rs @@ -0,0 +1,63 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EndpointDevice { + #[serde(rename = "device_uuid", skip_serializing_if = "Option::is_none")] + pub device_uuid: Option, + #[serde(rename = "pbm_uuid")] + pub pbm_uuid: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + #[serde( + rename = "access_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub access_group: Option>, + #[serde(rename = "access_group_obj", skip_serializing_if = "Option::is_none")] + pub access_group_obj: Option, + #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] + pub expiring: Option, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, + #[serde(rename = "facts")] + pub facts: models::DeviceFactSnapshot, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl EndpointDevice { + pub fn new( + pbm_uuid: uuid::Uuid, + name: String, + facts: models::DeviceFactSnapshot, + ) -> EndpointDevice { + EndpointDevice { + device_uuid: None, + pbm_uuid, + name, + access_group: None, + access_group_obj: None, + expiring: None, + expires: None, + facts, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/endpoint_device_details.rs b/packages/client-rust/src/models/endpoint_device_details.rs new file mode 100644 index 0000000000..1998315509 --- /dev/null +++ b/packages/client-rust/src/models/endpoint_device_details.rs @@ -0,0 +1,75 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EndpointDeviceDetails { + #[serde(rename = "device_uuid", skip_serializing_if = "Option::is_none")] + pub device_uuid: Option, + #[serde(rename = "pbm_uuid")] + pub pbm_uuid: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + #[serde( + rename = "access_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub access_group: Option>, + #[serde(rename = "access_group_obj", skip_serializing_if = "Option::is_none")] + pub access_group_obj: Option, + #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] + pub expiring: Option, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, + #[serde(rename = "facts")] + pub facts: models::DeviceFactSnapshot, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, + #[serde(rename = "connections_obj")] + pub connections_obj: Vec, + #[serde(rename = "policies")] + pub policies: Vec, + #[serde(rename = "connections")] + pub connections: Vec, +} + +impl EndpointDeviceDetails { + pub fn new( + pbm_uuid: uuid::Uuid, + name: String, + facts: models::DeviceFactSnapshot, + connections_obj: Vec, + policies: Vec, + connections: Vec, + ) -> EndpointDeviceDetails { + EndpointDeviceDetails { + device_uuid: None, + pbm_uuid, + name, + access_group: None, + access_group_obj: None, + expiring: None, + expires: None, + facts, + attributes: None, + connections_obj, + policies, + connections, + } + } +} diff --git a/packages/client-rust/src/models/endpoint_device_request.rs b/packages/client-rust/src/models/endpoint_device_request.rs new file mode 100644 index 0000000000..2cdbe459fb --- /dev/null +++ b/packages/client-rust/src/models/endpoint_device_request.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EndpointDeviceRequest { + #[serde(rename = "device_uuid", skip_serializing_if = "Option::is_none")] + pub device_uuid: Option, + #[serde(rename = "name")] + pub name: String, + #[serde( + rename = "access_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub access_group: Option>, + #[serde(rename = "access_group_obj", skip_serializing_if = "Option::is_none")] + pub access_group_obj: Option, + #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] + pub expiring: Option, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl EndpointDeviceRequest { + pub fn new(name: String) -> EndpointDeviceRequest { + EndpointDeviceRequest { + device_uuid: None, + name, + access_group: None, + access_group_obj: None, + expiring: None, + expires: None, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/endpoint_request.rs b/packages/client-rust/src/models/endpoint_request.rs new file mode 100644 index 0000000000..40f4a69528 --- /dev/null +++ b/packages/client-rust/src/models/endpoint_request.rs @@ -0,0 +1,57 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EndpointRequest : Endpoint Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EndpointRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "provider")] + pub provider: i32, + #[serde(rename = "protocol")] + pub protocol: models::ProtocolEnum, + #[serde(rename = "host")] + pub host: String, + #[serde(rename = "settings", skip_serializing_if = "Option::is_none")] + pub settings: Option>, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + #[serde(rename = "auth_mode")] + pub auth_mode: models::EndpointAuthModeEnum, + #[serde( + rename = "maximum_connections", + skip_serializing_if = "Option::is_none" + )] + pub maximum_connections: Option, +} + +impl EndpointRequest { + /// Endpoint Serializer + pub fn new( + name: String, + provider: i32, + protocol: models::ProtocolEnum, + host: String, + auth_mode: models::EndpointAuthModeEnum, + ) -> EndpointRequest { + EndpointRequest { + name, + provider, + protocol, + host, + settings: None, + property_mappings: None, + auth_mode, + maximum_connections: None, + } + } +} diff --git a/packages/client-rust/src/models/endpoint_stage.rs b/packages/client-rust/src/models/endpoint_stage.rs new file mode 100644 index 0000000000..5e646e7459 --- /dev/null +++ b/packages/client-rust/src/models/endpoint_stage.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EndpointStage : EndpointStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EndpointStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + #[serde(rename = "connector")] + pub connector: uuid::Uuid, + #[serde(rename = "connector_obj")] + pub connector_obj: models::Connector, + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, +} + +impl EndpointStage { + /// EndpointStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + connector: uuid::Uuid, + connector_obj: models::Connector, + ) -> EndpointStage { + EndpointStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + connector, + connector_obj, + mode: None, + } + } +} diff --git a/packages/client-rust/src/models/endpoint_stage_request.rs b/packages/client-rust/src/models/endpoint_stage_request.rs new file mode 100644 index 0000000000..ee7f08f587 --- /dev/null +++ b/packages/client-rust/src/models/endpoint_stage_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EndpointStageRequest : EndpointStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EndpointStageRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "connector")] + pub connector: uuid::Uuid, + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, +} + +impl EndpointStageRequest { + /// EndpointStage Serializer + pub fn new(name: String, connector: uuid::Uuid) -> EndpointStageRequest { + EndpointStageRequest { + name, + connector, + mode: None, + } + } +} diff --git a/packages/client-rust/src/models/enroll_request.rs b/packages/client-rust/src/models/enroll_request.rs new file mode 100644 index 0000000000..67e7a407f1 --- /dev/null +++ b/packages/client-rust/src/models/enroll_request.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EnrollRequest : Base serializer class which doesn't implement create/update methods +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EnrollRequest { + #[serde(rename = "device_serial")] + pub device_serial: String, + #[serde(rename = "device_name")] + pub device_name: String, +} + +impl EnrollRequest { + /// Base serializer class which doesn't implement create/update methods + pub fn new(device_serial: String, device_name: String) -> EnrollRequest { + EnrollRequest { + device_serial, + device_name, + } + } +} diff --git a/packages/client-rust/src/models/enrollment_token.rs b/packages/client-rust/src/models/enrollment_token.rs new file mode 100644 index 0000000000..fbb9c79f8e --- /dev/null +++ b/packages/client-rust/src/models/enrollment_token.rs @@ -0,0 +1,58 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EnrollmentToken { + #[serde(rename = "token_uuid")] + pub token_uuid: uuid::Uuid, + #[serde( + rename = "device_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub device_group: Option>, + #[serde(rename = "device_group_obj")] + pub device_group_obj: models::DeviceAccessGroup, + #[serde(rename = "connector")] + pub connector: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] + pub expiring: Option, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, +} + +impl EnrollmentToken { + pub fn new( + token_uuid: uuid::Uuid, + device_group_obj: models::DeviceAccessGroup, + connector: uuid::Uuid, + name: String, + ) -> EnrollmentToken { + EnrollmentToken { + token_uuid, + device_group: None, + device_group_obj, + connector, + name, + expiring: None, + expires: None, + } + } +} diff --git a/packages/client-rust/src/models/enrollment_token_request.rs b/packages/client-rust/src/models/enrollment_token_request.rs new file mode 100644 index 0000000000..d4fd7052ae --- /dev/null +++ b/packages/client-rust/src/models/enrollment_token_request.rs @@ -0,0 +1,47 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EnrollmentTokenRequest { + #[serde( + rename = "device_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub device_group: Option>, + #[serde(rename = "connector")] + pub connector: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] + pub expiring: Option, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, +} + +impl EnrollmentTokenRequest { + pub fn new(connector: uuid::Uuid, name: String) -> EnrollmentTokenRequest { + EnrollmentTokenRequest { + device_group: None, + connector, + name, + expiring: None, + expires: None, + } + } +} diff --git a/packages/client-rust/src/models/error_detail.rs b/packages/client-rust/src/models/error_detail.rs new file mode 100644 index 0000000000..4f6e5d7758 --- /dev/null +++ b/packages/client-rust/src/models/error_detail.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ErrorDetail : Serializer for rest_framework's error messages +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ErrorDetail { + #[serde(rename = "string")] + pub string: String, + #[serde(rename = "code")] + pub code: String, +} + +impl ErrorDetail { + /// Serializer for rest_framework's error messages + pub fn new(string: String, code: String) -> ErrorDetail { + ErrorDetail { string, code } + } +} diff --git a/packages/client-rust/src/models/error_reporting_config.rs b/packages/client-rust/src/models/error_reporting_config.rs new file mode 100644 index 0000000000..a882ed4190 --- /dev/null +++ b/packages/client-rust/src/models/error_reporting_config.rs @@ -0,0 +1,45 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ErrorReportingConfig : Config for error reporting +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ErrorReportingConfig { + #[serde(rename = "enabled")] + pub enabled: bool, + #[serde(rename = "sentry_dsn")] + pub sentry_dsn: String, + #[serde(rename = "environment")] + pub environment: String, + #[serde(rename = "send_pii")] + pub send_pii: bool, + #[serde(rename = "traces_sample_rate")] + pub traces_sample_rate: f64, +} + +impl ErrorReportingConfig { + /// Config for error reporting + pub fn new( + enabled: bool, + sentry_dsn: String, + environment: String, + send_pii: bool, + traces_sample_rate: f64, + ) -> ErrorReportingConfig { + ErrorReportingConfig { + enabled, + sentry_dsn, + environment, + send_pii, + traces_sample_rate, + } + } +} diff --git a/packages/client-rust/src/models/event.rs b/packages/client-rust/src/models/event.rs new file mode 100644 index 0000000000..82cb8d8f54 --- /dev/null +++ b/packages/client-rust/src/models/event.rs @@ -0,0 +1,61 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Event : Event Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Event { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option>, + #[serde(rename = "action")] + pub action: models::EventActions, + #[serde(rename = "app")] + pub app: String, + #[serde(rename = "context", skip_serializing_if = "Option::is_none")] + pub context: Option>, + #[serde( + rename = "client_ip", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub client_ip: Option>, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "expires", skip_serializing_if = "Option::is_none")] + pub expires: Option, + #[serde(rename = "brand", skip_serializing_if = "Option::is_none")] + pub brand: Option>, +} + +impl Event { + /// Event Serializer + pub fn new( + pk: uuid::Uuid, + action: models::EventActions, + app: String, + created: String, + ) -> Event { + Event { + pk, + user: None, + action, + app, + context: None, + client_ip: None, + created, + expires: None, + brand: None, + } + } +} diff --git a/packages/client-rust/src/models/event_actions.rs b/packages/client-rust/src/models/event_actions.rs new file mode 100644 index 0000000000..8f43b49d0f --- /dev/null +++ b/packages/client-rust/src/models/event_actions.rs @@ -0,0 +1,128 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum EventActions { + #[serde(rename = "login")] + Login, + #[serde(rename = "login_failed")] + LoginFailed, + #[serde(rename = "logout")] + Logout, + #[serde(rename = "user_write")] + UserWrite, + #[serde(rename = "suspicious_request")] + SuspiciousRequest, + #[serde(rename = "password_set")] + PasswordSet, + #[serde(rename = "secret_view")] + SecretView, + #[serde(rename = "secret_rotate")] + SecretRotate, + #[serde(rename = "invitation_used")] + InvitationUsed, + #[serde(rename = "authorize_application")] + AuthorizeApplication, + #[serde(rename = "source_linked")] + SourceLinked, + #[serde(rename = "impersonation_started")] + ImpersonationStarted, + #[serde(rename = "impersonation_ended")] + ImpersonationEnded, + #[serde(rename = "flow_execution")] + FlowExecution, + #[serde(rename = "policy_execution")] + PolicyExecution, + #[serde(rename = "policy_exception")] + PolicyException, + #[serde(rename = "property_mapping_exception")] + PropertyMappingException, + #[serde(rename = "system_task_execution")] + SystemTaskExecution, + #[serde(rename = "system_task_exception")] + SystemTaskException, + #[serde(rename = "system_exception")] + SystemException, + #[serde(rename = "configuration_error")] + ConfigurationError, + #[serde(rename = "configuration_warning")] + ConfigurationWarning, + #[serde(rename = "model_created")] + ModelCreated, + #[serde(rename = "model_updated")] + ModelUpdated, + #[serde(rename = "model_deleted")] + ModelDeleted, + #[serde(rename = "email_sent")] + EmailSent, + #[serde(rename = "update_available")] + UpdateAvailable, + #[serde(rename = "export_ready")] + ExportReady, + #[serde(rename = "review_initiated")] + ReviewInitiated, + #[serde(rename = "review_overdue")] + ReviewOverdue, + #[serde(rename = "review_attested")] + ReviewAttested, + #[serde(rename = "review_completed")] + ReviewCompleted, + #[serde(rename = "custom_")] + Custom, +} + +impl std::fmt::Display for EventActions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Login => write!(f, "login"), + Self::LoginFailed => write!(f, "login_failed"), + Self::Logout => write!(f, "logout"), + Self::UserWrite => write!(f, "user_write"), + Self::SuspiciousRequest => write!(f, "suspicious_request"), + Self::PasswordSet => write!(f, "password_set"), + Self::SecretView => write!(f, "secret_view"), + Self::SecretRotate => write!(f, "secret_rotate"), + Self::InvitationUsed => write!(f, "invitation_used"), + Self::AuthorizeApplication => write!(f, "authorize_application"), + Self::SourceLinked => write!(f, "source_linked"), + Self::ImpersonationStarted => write!(f, "impersonation_started"), + Self::ImpersonationEnded => write!(f, "impersonation_ended"), + Self::FlowExecution => write!(f, "flow_execution"), + Self::PolicyExecution => write!(f, "policy_execution"), + Self::PolicyException => write!(f, "policy_exception"), + Self::PropertyMappingException => write!(f, "property_mapping_exception"), + Self::SystemTaskExecution => write!(f, "system_task_execution"), + Self::SystemTaskException => write!(f, "system_task_exception"), + Self::SystemException => write!(f, "system_exception"), + Self::ConfigurationError => write!(f, "configuration_error"), + Self::ConfigurationWarning => write!(f, "configuration_warning"), + Self::ModelCreated => write!(f, "model_created"), + Self::ModelUpdated => write!(f, "model_updated"), + Self::ModelDeleted => write!(f, "model_deleted"), + Self::EmailSent => write!(f, "email_sent"), + Self::UpdateAvailable => write!(f, "update_available"), + Self::ExportReady => write!(f, "export_ready"), + Self::ReviewInitiated => write!(f, "review_initiated"), + Self::ReviewOverdue => write!(f, "review_overdue"), + Self::ReviewAttested => write!(f, "review_attested"), + Self::ReviewCompleted => write!(f, "review_completed"), + Self::Custom => write!(f, "custom_"), + } + } +} + +impl Default for EventActions { + fn default() -> EventActions { + Self::Login + } +} diff --git a/packages/client-rust/src/models/event_matcher_policy.rs b/packages/client-rust/src/models/event_matcher_policy.rs new file mode 100644 index 0000000000..48aa1e6d60 --- /dev/null +++ b/packages/client-rust/src/models/event_matcher_policy.rs @@ -0,0 +1,102 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EventMatcherPolicy : Event Matcher Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EventMatcherPolicy { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Return objects policy is bound to + #[serde(rename = "bound_to")] + pub bound_to: i32, + /// Match created events with this action type. When left empty, all action types will be + /// matched. + #[serde( + rename = "action", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub action: Option>, + /// Matches Event's Client IP (strict matching, for network matching use an Expression Policy) + #[serde( + rename = "client_ip", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub client_ip: Option>, + /// Match events created by selected application. When left empty, all applications are + /// matched. + #[serde( + rename = "app", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub app: Option>, + /// Match events created by selected model. When left empty, all models are matched. When an + /// app is selected, all the application's models are matched. + #[serde( + rename = "model", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub model: Option>, +} + +impl EventMatcherPolicy { + /// Event Matcher Policy Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + bound_to: i32, + ) -> EventMatcherPolicy { + EventMatcherPolicy { + pk, + name, + execution_logging: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + bound_to, + action: None, + client_ip: None, + app: None, + model: None, + } + } +} diff --git a/packages/client-rust/src/models/event_matcher_policy_request.rs b/packages/client-rust/src/models/event_matcher_policy_request.rs new file mode 100644 index 0000000000..fba6b64673 --- /dev/null +++ b/packages/client-rust/src/models/event_matcher_policy_request.rs @@ -0,0 +1,71 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EventMatcherPolicyRequest : Event Matcher Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EventMatcherPolicyRequest { + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + /// Match created events with this action type. When left empty, all action types will be + /// matched. + #[serde( + rename = "action", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub action: Option>, + /// Matches Event's Client IP (strict matching, for network matching use an Expression Policy) + #[serde( + rename = "client_ip", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub client_ip: Option>, + /// Match events created by selected application. When left empty, all applications are + /// matched. + #[serde( + rename = "app", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub app: Option>, + /// Match events created by selected model. When left empty, all models are matched. When an + /// app is selected, all the application's models are matched. + #[serde( + rename = "model", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub model: Option>, +} + +impl EventMatcherPolicyRequest { + /// Event Matcher Policy Serializer + pub fn new(name: String) -> EventMatcherPolicyRequest { + EventMatcherPolicyRequest { + name, + execution_logging: None, + action: None, + client_ip: None, + app: None, + model: None, + } + } +} diff --git a/packages/client-rust/src/models/event_request.rs b/packages/client-rust/src/models/event_request.rs new file mode 100644 index 0000000000..fefa99d93a --- /dev/null +++ b/packages/client-rust/src/models/event_request.rs @@ -0,0 +1,50 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EventRequest : Event Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EventRequest { + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option>, + #[serde(rename = "action")] + pub action: models::EventActions, + #[serde(rename = "app")] + pub app: String, + #[serde(rename = "context", skip_serializing_if = "Option::is_none")] + pub context: Option>, + #[serde( + rename = "client_ip", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub client_ip: Option>, + #[serde(rename = "expires", skip_serializing_if = "Option::is_none")] + pub expires: Option, + #[serde(rename = "brand", skip_serializing_if = "Option::is_none")] + pub brand: Option>, +} + +impl EventRequest { + /// Event Serializer + pub fn new(action: models::EventActions, app: String) -> EventRequest { + EventRequest { + user: None, + action, + app, + context: None, + client_ip: None, + expires: None, + brand: None, + } + } +} diff --git a/packages/client-rust/src/models/event_top_per_user.rs b/packages/client-rust/src/models/event_top_per_user.rs new file mode 100644 index 0000000000..b346c33a0b --- /dev/null +++ b/packages/client-rust/src/models/event_top_per_user.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EventTopPerUser : Response object of Event's top_per_user +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EventTopPerUser { + #[serde(rename = "application")] + pub application: std::collections::HashMap, + #[serde(rename = "counted_events")] + pub counted_events: i32, + #[serde(rename = "unique_users")] + pub unique_users: i32, +} + +impl EventTopPerUser { + /// Response object of Event's top_per_user + pub fn new( + application: std::collections::HashMap, + counted_events: i32, + unique_users: i32, + ) -> EventTopPerUser { + EventTopPerUser { + application, + counted_events, + unique_users, + } + } +} diff --git a/packages/client-rust/src/models/event_volume.rs b/packages/client-rust/src/models/event_volume.rs new file mode 100644 index 0000000000..6b2f77f015 --- /dev/null +++ b/packages/client-rust/src/models/event_volume.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// EventVolume : Count of events of action created on day +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct EventVolume { + #[serde(rename = "action")] + pub action: models::EventActions, + #[serde(rename = "time")] + pub time: String, + #[serde(rename = "count")] + pub count: i32, +} + +impl EventVolume { + /// Count of events of action created on day + pub fn new(action: models::EventActions, time: String, count: i32) -> EventVolume { + EventVolume { + action, + time, + count, + } + } +} diff --git a/packages/client-rust/src/models/events_requested_enum.rs b/packages/client-rust/src/models/events_requested_enum.rs new file mode 100644 index 0000000000..637f14651d --- /dev/null +++ b/packages/client-rust/src/models/events_requested_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum EventsRequestedEnum { + #[serde(rename = "https://schemas.openid.net/secevent/caep/event-type/session-revoked")] + HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashCaepSlashEventTypeSlashSessionRevoked, + #[serde(rename = "https://schemas.openid.net/secevent/caep/event-type/credential-change")] + HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashCaepSlashEventTypeSlashCredentialChange, + #[serde(rename = "https://schemas.openid.net/secevent/ssf/event-type/verification")] + HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashSsfSlashEventTypeSlashVerification, +} + +impl std::fmt::Display for EventsRequestedEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashCaepSlashEventTypeSlashSessionRevoked => write!(f, "https://schemas.openid.net/secevent/caep/event-type/session-revoked"), + Self::HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashCaepSlashEventTypeSlashCredentialChange => write!(f, "https://schemas.openid.net/secevent/caep/event-type/credential-change"), + Self::HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashSsfSlashEventTypeSlashVerification => write!(f, "https://schemas.openid.net/secevent/ssf/event-type/verification"), + } + } +} + +impl Default for EventsRequestedEnum { + fn default() -> EventsRequestedEnum { + Self::HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashCaepSlashEventTypeSlashSessionRevoked + } +} diff --git a/packages/client-rust/src/models/expiring_base_grant_model.rs b/packages/client-rust/src/models/expiring_base_grant_model.rs new file mode 100644 index 0000000000..d20d192011 --- /dev/null +++ b/packages/client-rust/src/models/expiring_base_grant_model.rs @@ -0,0 +1,54 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ExpiringBaseGrantModel : Serializer for BaseGrantModel and ExpiringBaseGrant +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExpiringBaseGrantModel { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "provider")] + pub provider: models::OAuth2Provider, + #[serde(rename = "user")] + pub user: models::User, + /// Check if token is expired yet. + #[serde(rename = "is_expired")] + pub is_expired: bool, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, + #[serde(rename = "scope")] + pub scope: Vec, +} + +impl ExpiringBaseGrantModel { + /// Serializer for BaseGrantModel and ExpiringBaseGrant + pub fn new( + pk: i32, + provider: models::OAuth2Provider, + user: models::User, + is_expired: bool, + scope: Vec, + ) -> ExpiringBaseGrantModel { + ExpiringBaseGrantModel { + pk, + provider, + user, + is_expired, + expires: None, + scope, + } + } +} diff --git a/packages/client-rust/src/models/expression_policy.rs b/packages/client-rust/src/models/expression_policy.rs new file mode 100644 index 0000000000..197e6a8eff --- /dev/null +++ b/packages/client-rust/src/models/expression_policy.rs @@ -0,0 +1,67 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ExpressionPolicy : Group Membership Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExpressionPolicy { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Return objects policy is bound to + #[serde(rename = "bound_to")] + pub bound_to: i32, + #[serde(rename = "expression")] + pub expression: String, +} + +impl ExpressionPolicy { + /// Group Membership Policy Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + bound_to: i32, + expression: String, + ) -> ExpressionPolicy { + ExpressionPolicy { + pk, + name, + execution_logging: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + bound_to, + expression, + } + } +} diff --git a/packages/client-rust/src/models/expression_policy_request.rs b/packages/client-rust/src/models/expression_policy_request.rs new file mode 100644 index 0000000000..8a0a0baa95 --- /dev/null +++ b/packages/client-rust/src/models/expression_policy_request.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ExpressionPolicyRequest : Group Membership Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExpressionPolicyRequest { + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + #[serde(rename = "expression")] + pub expression: String, +} + +impl ExpressionPolicyRequest { + /// Group Membership Policy Serializer + pub fn new(name: String, expression: String) -> ExpressionPolicyRequest { + ExpressionPolicyRequest { + name, + execution_logging: None, + expression, + } + } +} diff --git a/packages/client-rust/src/models/extra_role_object_permission.rs b/packages/client-rust/src/models/extra_role_object_permission.rs new file mode 100644 index 0000000000..9cc40c4e18 --- /dev/null +++ b/packages/client-rust/src/models/extra_role_object_permission.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ExtraRoleObjectPermission : Role permission with additional object-related data +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExtraRoleObjectPermission { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "codename")] + pub codename: String, + #[serde(rename = "model")] + pub model: String, + #[serde(rename = "app_label")] + pub app_label: String, + #[serde(rename = "object_pk")] + pub object_pk: String, + #[serde(rename = "name")] + pub name: String, + /// Get app label from permission's model + #[serde(rename = "app_label_verbose")] + pub app_label_verbose: String, + /// Get model label from permission's model + #[serde(rename = "model_verbose")] + pub model_verbose: String, + /// Get model description from attached model. This operation takes at least one additional + /// query, and the description is only shown if the role has the view_ permission on the object + #[serde( + rename = "object_description", + deserialize_with = "Option::deserialize" + )] + pub object_description: Option, +} + +impl ExtraRoleObjectPermission { + /// Role permission with additional object-related data + pub fn new( + id: i32, + codename: String, + model: String, + app_label: String, + object_pk: String, + name: String, + app_label_verbose: String, + model_verbose: String, + object_description: Option, + ) -> ExtraRoleObjectPermission { + ExtraRoleObjectPermission { + id, + codename, + model, + app_label, + object_pk, + name, + app_label_verbose, + model_verbose, + object_description, + } + } +} diff --git a/packages/client-rust/src/models/file_list.rs b/packages/client-rust/src/models/file_list.rs new file mode 100644 index 0000000000..71b464283e --- /dev/null +++ b/packages/client-rust/src/models/file_list.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// FileList : Base serializer class which doesn't implement create/update methods +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FileList { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "mime_type")] + pub mime_type: String, + #[serde(rename = "url")] + pub url: String, + #[serde( + rename = "themed_urls", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub themed_urls: Option>, +} + +impl FileList { + /// Base serializer class which doesn't implement create/update methods + pub fn new(name: String, mime_type: String, url: String) -> FileList { + FileList { + name, + mime_type, + url, + themed_urls: None, + } + } +} diff --git a/packages/client-rust/src/models/fleet_connector.rs b/packages/client-rust/src/models/fleet_connector.rs new file mode 100644 index 0000000000..995f65a8cd --- /dev/null +++ b/packages/client-rust/src/models/fleet_connector.rs @@ -0,0 +1,78 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// FleetConnector : FleetConnector Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FleetConnector { + #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] + pub connector_uuid: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "url")] + pub url: String, + /// Configure additional headers to be sent. Mapping should return a dictionary of key-value + /// pairs + #[serde( + rename = "headers_mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub headers_mapping: Option>, + #[serde(rename = "map_users", skip_serializing_if = "Option::is_none")] + pub map_users: Option, + #[serde( + rename = "map_teams_access_group", + skip_serializing_if = "Option::is_none" + )] + pub map_teams_access_group: Option, +} + +impl FleetConnector { + /// FleetConnector Serializer + pub fn new( + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + url: String, + ) -> FleetConnector { + FleetConnector { + connector_uuid: None, + name, + enabled: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + url, + headers_mapping: None, + map_users: None, + map_teams_access_group: None, + } + } +} diff --git a/packages/client-rust/src/models/fleet_connector_request.rs b/packages/client-rust/src/models/fleet_connector_request.rs new file mode 100644 index 0000000000..42b90a6ff8 --- /dev/null +++ b/packages/client-rust/src/models/fleet_connector_request.rs @@ -0,0 +1,58 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// FleetConnectorRequest : FleetConnector Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FleetConnectorRequest { + #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] + pub connector_uuid: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "url")] + pub url: String, + #[serde(rename = "token")] + pub token: String, + /// Configure additional headers to be sent. Mapping should return a dictionary of key-value + /// pairs + #[serde( + rename = "headers_mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub headers_mapping: Option>, + #[serde(rename = "map_users", skip_serializing_if = "Option::is_none")] + pub map_users: Option, + #[serde( + rename = "map_teams_access_group", + skip_serializing_if = "Option::is_none" + )] + pub map_teams_access_group: Option, +} + +impl FleetConnectorRequest { + /// FleetConnector Serializer + pub fn new(name: String, url: String, token: String) -> FleetConnectorRequest { + FleetConnectorRequest { + connector_uuid: None, + name, + enabled: None, + url, + token, + headers_mapping: None, + map_users: None, + map_teams_access_group: None, + } + } +} diff --git a/packages/client-rust/src/models/flow.rs b/packages/client-rust/src/models/flow.rs new file mode 100644 index 0000000000..a21a91dc2b --- /dev/null +++ b/packages/client-rust/src/models/flow.rs @@ -0,0 +1,106 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Flow : Flow Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Flow { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "policybindingmodel_ptr_id")] + pub policybindingmodel_ptr_id: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Visible in the URL. + #[serde(rename = "slug")] + pub slug: String, + /// Shown as the Title in Flow pages. + #[serde(rename = "title")] + pub title: String, + /// Decides what this Flow is used for. For example, the Authentication flow is redirect to + /// when an un-authenticated user visits authentik. + #[serde(rename = "designation")] + pub designation: models::FlowDesignationEnum, + /// Background shown during execution + #[serde(rename = "background", skip_serializing_if = "Option::is_none")] + pub background: Option, + /// Get the URL to the background image + #[serde(rename = "background_url")] + pub background_url: String, + #[serde( + rename = "background_themed_urls", + deserialize_with = "Option::deserialize" + )] + pub background_themed_urls: Option, + #[serde(rename = "stages")] + pub stages: Vec, + #[serde(rename = "policies")] + pub policies: Vec, + /// Get count of cached flows + #[serde(rename = "cache_count")] + pub cache_count: i32, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// Enable compatibility mode, increases compatibility with password managers on mobile + /// devices. + #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")] + pub compatibility_mode: Option, + /// Get export URL for flow + #[serde(rename = "export_url")] + pub export_url: String, + #[serde(rename = "layout", skip_serializing_if = "Option::is_none")] + pub layout: Option, + /// Configure what should happen when a flow denies access to a user. + #[serde(rename = "denied_action", skip_serializing_if = "Option::is_none")] + pub denied_action: Option, + /// Required level of authentication and authorization to access a flow. + #[serde(rename = "authentication", skip_serializing_if = "Option::is_none")] + pub authentication: Option, +} + +impl Flow { + /// Flow Serializer + pub fn new( + pk: uuid::Uuid, + policybindingmodel_ptr_id: uuid::Uuid, + name: String, + slug: String, + title: String, + designation: models::FlowDesignationEnum, + background_url: String, + background_themed_urls: Option, + stages: Vec, + policies: Vec, + cache_count: i32, + export_url: String, + ) -> Flow { + Flow { + pk, + policybindingmodel_ptr_id, + name, + slug, + title, + designation, + background: None, + background_url, + background_themed_urls, + stages, + policies, + cache_count, + policy_engine_mode: None, + compatibility_mode: None, + export_url, + layout: None, + denied_action: None, + authentication: None, + } + } +} diff --git a/packages/client-rust/src/models/flow_challenge_response_request.rs b/packages/client-rust/src/models/flow_challenge_response_request.rs new file mode 100644 index 0000000000..558eab0878 --- /dev/null +++ b/packages/client-rust/src/models/flow_challenge_response_request.rs @@ -0,0 +1,74 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(tag = "component")] +pub enum FlowChallengeResponseRequest { + #[serde(rename = "ak-source-oauth-apple")] + AkSourceOauthApple(models::AppleChallengeResponseRequest), + #[serde(rename = "ak-stage-authenticator-duo")] + AkStageAuthenticatorDuo(models::AuthenticatorDuoChallengeResponseRequest), + #[serde(rename = "ak-stage-authenticator-email")] + AkStageAuthenticatorEmail(models::AuthenticatorEmailChallengeResponseRequest), + #[serde(rename = "ak-stage-authenticator-sms")] + AkStageAuthenticatorSms(models::AuthenticatorSmsChallengeResponseRequest), + #[serde(rename = "ak-stage-authenticator-static")] + AkStageAuthenticatorStatic(models::AuthenticatorStaticChallengeResponseRequest), + #[serde(rename = "ak-stage-authenticator-totp")] + AkStageAuthenticatorTotp(models::AuthenticatorTotpChallengeResponseRequest), + #[serde(rename = "ak-stage-authenticator-validate")] + AkStageAuthenticatorValidate(models::AuthenticatorValidationChallengeResponseRequest), + #[serde(rename = "ak-stage-authenticator-webauthn")] + AkStageAuthenticatorWebauthn(models::AuthenticatorWebAuthnChallengeResponseRequest), + #[serde(rename = "ak-stage-autosubmit")] + AkStageAutosubmit(models::AutoSubmitChallengeResponseRequest), + #[serde(rename = "ak-stage-captcha")] + AkStageCaptcha(models::CaptchaChallengeResponseRequest), + #[serde(rename = "ak-stage-consent")] + AkStageConsent(models::ConsentChallengeResponseRequest), + #[serde(rename = "ak-stage-dummy")] + AkStageDummy(models::DummyChallengeResponseRequest), + #[serde(rename = "ak-stage-email")] + AkStageEmail(models::EmailChallengeResponseRequest), + #[serde(rename = "ak-stage-endpoint-agent")] + AkStageEndpointAgent(models::EndpointAgentChallengeResponseRequest), + #[serde(rename = "xak-flow-frame")] + XakFlowFrame(models::FrameChallengeResponseRequest), + #[serde(rename = "ak-stage-identification")] + AkStageIdentification(models::IdentificationChallengeResponseRequest), + #[serde(rename = "ak-provider-iframe-logout")] + AkProviderIframeLogout(models::IframeLogoutChallengeResponseRequest), + #[serde(rename = "ak-provider-saml-native-logout")] + AkProviderSamlNativeLogout(models::NativeLogoutChallengeResponseRequest), + #[serde(rename = "ak-provider-oauth2-device-code")] + AkProviderOauth2DeviceCode(models::OAuthDeviceCodeChallengeResponseRequest), + #[serde(rename = "ak-provider-oauth2-device-code-finish")] + AkProviderOauth2DeviceCodeFinish(models::OAuthDeviceCodeFinishChallengeResponseRequest), + #[serde(rename = "ak-stage-password")] + AkStagePassword(models::PasswordChallengeResponseRequest), + #[serde(rename = "ak-source-plex")] + AkSourcePlex(models::PlexAuthenticationChallengeResponseRequest), + #[serde(rename = "ak-stage-prompt")] + AkStagePrompt(models::PromptChallengeResponseRequest), + #[serde(rename = "xak-flow-redirect")] + XakFlowRedirect(models::RedirectChallengeResponseRequest), + #[serde(rename = "ak-source-telegram")] + AkSourceTelegram(models::TelegramChallengeResponseRequest), + #[serde(rename = "ak-stage-user-login")] + AkStageUserLogin(models::UserLoginChallengeResponseRequest), +} + +impl Default for FlowChallengeResponseRequest { + fn default() -> Self { + Self::AkSourceOauthApple(Default::default()) + } +} diff --git a/packages/client-rust/src/models/flow_designation_enum.rs b/packages/client-rust/src/models/flow_designation_enum.rs new file mode 100644 index 0000000000..a9928fd80e --- /dev/null +++ b/packages/client-rust/src/models/flow_designation_enum.rs @@ -0,0 +1,50 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum FlowDesignationEnum { + #[serde(rename = "authentication")] + Authentication, + #[serde(rename = "authorization")] + Authorization, + #[serde(rename = "invalidation")] + Invalidation, + #[serde(rename = "enrollment")] + Enrollment, + #[serde(rename = "unenrollment")] + Unenrollment, + #[serde(rename = "recovery")] + Recovery, + #[serde(rename = "stage_configuration")] + StageConfiguration, +} + +impl std::fmt::Display for FlowDesignationEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Authentication => write!(f, "authentication"), + Self::Authorization => write!(f, "authorization"), + Self::Invalidation => write!(f, "invalidation"), + Self::Enrollment => write!(f, "enrollment"), + Self::Unenrollment => write!(f, "unenrollment"), + Self::Recovery => write!(f, "recovery"), + Self::StageConfiguration => write!(f, "stage_configuration"), + } + } +} + +impl Default for FlowDesignationEnum { + fn default() -> FlowDesignationEnum { + Self::Authentication + } +} diff --git a/packages/client-rust/src/models/flow_diagram.rs b/packages/client-rust/src/models/flow_diagram.rs new file mode 100644 index 0000000000..0b2f0438ec --- /dev/null +++ b/packages/client-rust/src/models/flow_diagram.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// FlowDiagram : response of the flow's diagram action +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FlowDiagram { + #[serde(rename = "diagram")] + pub diagram: String, +} + +impl FlowDiagram { + /// response of the flow's diagram action + pub fn new(diagram: String) -> FlowDiagram { + FlowDiagram { diagram } + } +} diff --git a/packages/client-rust/src/models/flow_error_challenge.rs b/packages/client-rust/src/models/flow_error_challenge.rs new file mode 100644 index 0000000000..66d19325c8 --- /dev/null +++ b/packages/client-rust/src/models/flow_error_challenge.rs @@ -0,0 +1,44 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// FlowErrorChallenge : Challenge class when an unhandled error occurs during a stage. Normal users +/// are shown an error message, superusers are shown a full stacktrace. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FlowErrorChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "request_id")] + pub request_id: String, + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, + #[serde(rename = "traceback", skip_serializing_if = "Option::is_none")] + pub traceback: Option, +} + +impl FlowErrorChallenge { + /// Challenge class when an unhandled error occurs during a stage. Normal users are shown an + /// error message, superusers are shown a full stacktrace. + pub fn new(request_id: String) -> FlowErrorChallenge { + FlowErrorChallenge { + flow_info: None, + component: None, + response_errors: None, + request_id, + error: None, + traceback: None, + } + } +} diff --git a/packages/client-rust/src/models/flow_import_result.rs b/packages/client-rust/src/models/flow_import_result.rs new file mode 100644 index 0000000000..8fb96e0dfb --- /dev/null +++ b/packages/client-rust/src/models/flow_import_result.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// FlowImportResult : Logs of an attempted flow import +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FlowImportResult { + #[serde(rename = "logs")] + pub logs: Vec, + #[serde(rename = "success")] + pub success: bool, +} + +impl FlowImportResult { + /// Logs of an attempted flow import + pub fn new(logs: Vec, success: bool) -> FlowImportResult { + FlowImportResult { logs, success } + } +} diff --git a/packages/client-rust/src/models/flow_inspection.rs b/packages/client-rust/src/models/flow_inspection.rs new file mode 100644 index 0000000000..66b6278c8f --- /dev/null +++ b/packages/client-rust/src/models/flow_inspection.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// FlowInspection : Serializer for inspect endpoint +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FlowInspection { + #[serde(rename = "plans")] + pub plans: Vec, + #[serde(rename = "current_plan", skip_serializing_if = "Option::is_none")] + pub current_plan: Option, + #[serde(rename = "is_completed")] + pub is_completed: bool, +} + +impl FlowInspection { + /// Serializer for inspect endpoint + pub fn new(plans: Vec, is_completed: bool) -> FlowInspection { + FlowInspection { + plans, + current_plan: None, + is_completed, + } + } +} diff --git a/packages/client-rust/src/models/flow_inspector_plan.rs b/packages/client-rust/src/models/flow_inspector_plan.rs new file mode 100644 index 0000000000..40d6fc09f7 --- /dev/null +++ b/packages/client-rust/src/models/flow_inspector_plan.rs @@ -0,0 +1,43 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// FlowInspectorPlan : Serializer for an active FlowPlan +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FlowInspectorPlan { + #[serde(rename = "current_stage")] + pub current_stage: models::FlowStageBinding, + #[serde(rename = "next_planned_stage")] + pub next_planned_stage: models::FlowStageBinding, + /// Get the plan's context, sanitized + #[serde(rename = "plan_context")] + pub plan_context: std::collections::HashMap, + /// Get a unique session ID + #[serde(rename = "session_id")] + pub session_id: String, +} + +impl FlowInspectorPlan { + /// Serializer for an active FlowPlan + pub fn new( + current_stage: models::FlowStageBinding, + next_planned_stage: models::FlowStageBinding, + plan_context: std::collections::HashMap, + session_id: String, + ) -> FlowInspectorPlan { + FlowInspectorPlan { + current_stage, + next_planned_stage, + plan_context, + session_id, + } + } +} diff --git a/packages/client-rust/src/models/flow_layout_enum.rs b/packages/client-rust/src/models/flow_layout_enum.rs new file mode 100644 index 0000000000..b5fa759eb3 --- /dev/null +++ b/packages/client-rust/src/models/flow_layout_enum.rs @@ -0,0 +1,50 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum FlowLayoutEnum { + #[serde(rename = "stacked")] + Stacked, + #[serde(rename = "content_left")] + ContentLeft, + #[serde(rename = "content_right")] + ContentRight, + #[serde(rename = "sidebar_left")] + SidebarLeft, + #[serde(rename = "sidebar_right")] + SidebarRight, + #[serde(rename = "sidebar_left_frame_background")] + SidebarLeftFrameBackground, + #[serde(rename = "sidebar_right_frame_background")] + SidebarRightFrameBackground, +} + +impl std::fmt::Display for FlowLayoutEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Stacked => write!(f, "stacked"), + Self::ContentLeft => write!(f, "content_left"), + Self::ContentRight => write!(f, "content_right"), + Self::SidebarLeft => write!(f, "sidebar_left"), + Self::SidebarRight => write!(f, "sidebar_right"), + Self::SidebarLeftFrameBackground => write!(f, "sidebar_left_frame_background"), + Self::SidebarRightFrameBackground => write!(f, "sidebar_right_frame_background"), + } + } +} + +impl Default for FlowLayoutEnum { + fn default() -> FlowLayoutEnum { + Self::Stacked + } +} diff --git a/packages/client-rust/src/models/flow_request.rs b/packages/client-rust/src/models/flow_request.rs new file mode 100644 index 0000000000..a832b22e53 --- /dev/null +++ b/packages/client-rust/src/models/flow_request.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// FlowRequest : Flow Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FlowRequest { + #[serde(rename = "name")] + pub name: String, + /// Visible in the URL. + #[serde(rename = "slug")] + pub slug: String, + /// Shown as the Title in Flow pages. + #[serde(rename = "title")] + pub title: String, + /// Decides what this Flow is used for. For example, the Authentication flow is redirect to + /// when an un-authenticated user visits authentik. + #[serde(rename = "designation")] + pub designation: models::FlowDesignationEnum, + /// Background shown during execution + #[serde(rename = "background", skip_serializing_if = "Option::is_none")] + pub background: Option, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// Enable compatibility mode, increases compatibility with password managers on mobile + /// devices. + #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")] + pub compatibility_mode: Option, + #[serde(rename = "layout", skip_serializing_if = "Option::is_none")] + pub layout: Option, + /// Configure what should happen when a flow denies access to a user. + #[serde(rename = "denied_action", skip_serializing_if = "Option::is_none")] + pub denied_action: Option, + /// Required level of authentication and authorization to access a flow. + #[serde(rename = "authentication", skip_serializing_if = "Option::is_none")] + pub authentication: Option, +} + +impl FlowRequest { + /// Flow Serializer + pub fn new( + name: String, + slug: String, + title: String, + designation: models::FlowDesignationEnum, + ) -> FlowRequest { + FlowRequest { + name, + slug, + title, + designation, + background: None, + policy_engine_mode: None, + compatibility_mode: None, + layout: None, + denied_action: None, + authentication: None, + } + } +} diff --git a/packages/client-rust/src/models/flow_set.rs b/packages/client-rust/src/models/flow_set.rs new file mode 100644 index 0000000000..81432e3a3b --- /dev/null +++ b/packages/client-rust/src/models/flow_set.rs @@ -0,0 +1,78 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// FlowSet : Stripped down flow serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FlowSet { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "policybindingmodel_ptr_id")] + pub policybindingmodel_ptr_id: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Visible in the URL. + #[serde(rename = "slug")] + pub slug: String, + /// Shown as the Title in Flow pages. + #[serde(rename = "title")] + pub title: String, + /// Decides what this Flow is used for. For example, the Authentication flow is redirect to + /// when an un-authenticated user visits authentik. + #[serde(rename = "designation")] + pub designation: models::FlowDesignationEnum, + /// Get the URL to the background image + #[serde(rename = "background_url")] + pub background_url: String, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// Enable compatibility mode, increases compatibility with password managers on mobile + /// devices. + #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")] + pub compatibility_mode: Option, + /// Get export URL for flow + #[serde(rename = "export_url")] + pub export_url: String, + #[serde(rename = "layout", skip_serializing_if = "Option::is_none")] + pub layout: Option, + /// Configure what should happen when a flow denies access to a user. + #[serde(rename = "denied_action", skip_serializing_if = "Option::is_none")] + pub denied_action: Option, +} + +impl FlowSet { + /// Stripped down flow serializer + pub fn new( + pk: uuid::Uuid, + policybindingmodel_ptr_id: uuid::Uuid, + name: String, + slug: String, + title: String, + designation: models::FlowDesignationEnum, + background_url: String, + export_url: String, + ) -> FlowSet { + FlowSet { + pk, + policybindingmodel_ptr_id, + name, + slug, + title, + designation, + background_url, + policy_engine_mode: None, + compatibility_mode: None, + export_url, + layout: None, + denied_action: None, + } + } +} diff --git a/packages/client-rust/src/models/flow_stage_binding.rs b/packages/client-rust/src/models/flow_stage_binding.rs new file mode 100644 index 0000000000..15d8a6b431 --- /dev/null +++ b/packages/client-rust/src/models/flow_stage_binding.rs @@ -0,0 +1,73 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// FlowStageBinding : FlowStageBinding Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FlowStageBinding { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "policybindingmodel_ptr_id")] + pub policybindingmodel_ptr_id: uuid::Uuid, + #[serde(rename = "target")] + pub target: uuid::Uuid, + #[serde(rename = "stage")] + pub stage: uuid::Uuid, + #[serde(rename = "stage_obj")] + pub stage_obj: models::Stage, + /// Evaluate policies during the Flow planning process. + #[serde(rename = "evaluate_on_plan", skip_serializing_if = "Option::is_none")] + pub evaluate_on_plan: Option, + /// Evaluate policies when the Stage is presented to the user. + #[serde( + rename = "re_evaluate_policies", + skip_serializing_if = "Option::is_none" + )] + pub re_evaluate_policies: Option, + #[serde(rename = "order")] + pub order: i32, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// Configure how the flow executor should handle an invalid response to a challenge. RETRY + /// returns the error message and a similar challenge to the executor. RESTART restarts the + /// flow from the beginning, and RESTART_WITH_CONTEXT restarts the flow while keeping the + /// current context. + #[serde( + rename = "invalid_response_action", + skip_serializing_if = "Option::is_none" + )] + pub invalid_response_action: Option, +} + +impl FlowStageBinding { + /// FlowStageBinding Serializer + pub fn new( + pk: uuid::Uuid, + policybindingmodel_ptr_id: uuid::Uuid, + target: uuid::Uuid, + stage: uuid::Uuid, + stage_obj: models::Stage, + order: i32, + ) -> FlowStageBinding { + FlowStageBinding { + pk, + policybindingmodel_ptr_id, + target, + stage, + stage_obj, + evaluate_on_plan: None, + re_evaluate_policies: None, + order, + policy_engine_mode: None, + invalid_response_action: None, + } + } +} diff --git a/packages/client-rust/src/models/flow_stage_binding_request.rs b/packages/client-rust/src/models/flow_stage_binding_request.rs new file mode 100644 index 0000000000..a03c8d57b3 --- /dev/null +++ b/packages/client-rust/src/models/flow_stage_binding_request.rs @@ -0,0 +1,57 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// FlowStageBindingRequest : FlowStageBinding Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FlowStageBindingRequest { + #[serde(rename = "target")] + pub target: uuid::Uuid, + #[serde(rename = "stage")] + pub stage: uuid::Uuid, + /// Evaluate policies during the Flow planning process. + #[serde(rename = "evaluate_on_plan", skip_serializing_if = "Option::is_none")] + pub evaluate_on_plan: Option, + /// Evaluate policies when the Stage is presented to the user. + #[serde( + rename = "re_evaluate_policies", + skip_serializing_if = "Option::is_none" + )] + pub re_evaluate_policies: Option, + #[serde(rename = "order")] + pub order: i32, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// Configure how the flow executor should handle an invalid response to a challenge. RETRY + /// returns the error message and a similar challenge to the executor. RESTART restarts the + /// flow from the beginning, and RESTART_WITH_CONTEXT restarts the flow while keeping the + /// current context. + #[serde( + rename = "invalid_response_action", + skip_serializing_if = "Option::is_none" + )] + pub invalid_response_action: Option, +} + +impl FlowStageBindingRequest { + /// FlowStageBinding Serializer + pub fn new(target: uuid::Uuid, stage: uuid::Uuid, order: i32) -> FlowStageBindingRequest { + FlowStageBindingRequest { + target, + stage, + evaluate_on_plan: None, + re_evaluate_policies: None, + order, + policy_engine_mode: None, + invalid_response_action: None, + } + } +} diff --git a/packages/client-rust/src/models/footer_link.rs b/packages/client-rust/src/models/footer_link.rs new file mode 100644 index 0000000000..8964b740dd --- /dev/null +++ b/packages/client-rust/src/models/footer_link.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// FooterLink : Links returned in Config API +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FooterLink { + #[serde(rename = "href", deserialize_with = "Option::deserialize")] + pub href: Option, + #[serde(rename = "name")] + pub name: String, +} + +impl FooterLink { + /// Links returned in Config API + pub fn new(href: Option, name: String) -> FooterLink { + FooterLink { href, name } + } +} diff --git a/packages/client-rust/src/models/frame_challenge.rs b/packages/client-rust/src/models/frame_challenge.rs new file mode 100644 index 0000000000..c7f3a09761 --- /dev/null +++ b/packages/client-rust/src/models/frame_challenge.rs @@ -0,0 +1,42 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// FrameChallenge : Challenge type to render a frame +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FrameChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "url")] + pub url: String, + #[serde(rename = "loading_overlay", skip_serializing_if = "Option::is_none")] + pub loading_overlay: Option, + #[serde(rename = "loading_text")] + pub loading_text: String, +} + +impl FrameChallenge { + /// Challenge type to render a frame + pub fn new(url: String, loading_text: String) -> FrameChallenge { + FrameChallenge { + flow_info: None, + component: None, + response_errors: None, + url, + loading_overlay: None, + loading_text, + } + } +} diff --git a/packages/client-rust/src/models/frame_challenge_response_request.rs b/packages/client-rust/src/models/frame_challenge_response_request.rs new file mode 100644 index 0000000000..b435ff0f6f --- /dev/null +++ b/packages/client-rust/src/models/frame_challenge_response_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// FrameChallengeResponseRequest : Base class for all challenge responses +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct FrameChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, +} + +impl FrameChallengeResponseRequest { + /// Base class for all challenge responses + pub fn new() -> FrameChallengeResponseRequest { + FrameChallengeResponseRequest { component: None } + } +} diff --git a/packages/client-rust/src/models/generic_error.rs b/packages/client-rust/src/models/generic_error.rs new file mode 100644 index 0000000000..4a7b7c8179 --- /dev/null +++ b/packages/client-rust/src/models/generic_error.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GenericError : Generic API Error +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GenericError { + #[serde(rename = "detail")] + pub detail: String, + #[serde(rename = "code", skip_serializing_if = "Option::is_none")] + pub code: Option, +} + +impl GenericError { + /// Generic API Error + pub fn new(detail: String) -> GenericError { + GenericError { detail, code: None } + } +} diff --git a/packages/client-rust/src/models/geo_ip_policy.rs b/packages/client-rust/src/models/geo_ip_policy.rs new file mode 100644 index 0000000000..83335d1f52 --- /dev/null +++ b/packages/client-rust/src/models/geo_ip_policy.rs @@ -0,0 +1,110 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GeoIpPolicy : GeoIP Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GeoIpPolicy { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Return objects policy is bound to + #[serde(rename = "bound_to")] + pub bound_to: i32, + #[serde(rename = "asns", skip_serializing_if = "Option::is_none")] + pub asns: Option>, + #[serde(rename = "countries")] + pub countries: Vec, + #[serde(rename = "countries_obj")] + pub countries_obj: Vec, + #[serde( + rename = "check_history_distance", + skip_serializing_if = "Option::is_none" + )] + pub check_history_distance: Option, + #[serde( + rename = "history_max_distance_km", + skip_serializing_if = "Option::is_none" + )] + pub history_max_distance_km: Option, + #[serde( + rename = "distance_tolerance_km", + skip_serializing_if = "Option::is_none" + )] + pub distance_tolerance_km: Option, + #[serde( + rename = "history_login_count", + skip_serializing_if = "Option::is_none" + )] + pub history_login_count: Option, + #[serde( + rename = "check_impossible_travel", + skip_serializing_if = "Option::is_none" + )] + pub check_impossible_travel: Option, + #[serde( + rename = "impossible_tolerance_km", + skip_serializing_if = "Option::is_none" + )] + pub impossible_tolerance_km: Option, +} + +impl GeoIpPolicy { + /// GeoIP Policy Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + bound_to: i32, + countries: Vec, + countries_obj: Vec, + ) -> GeoIpPolicy { + GeoIpPolicy { + pk, + name, + execution_logging: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + bound_to, + asns: None, + countries, + countries_obj, + check_history_distance: None, + history_max_distance_km: None, + distance_tolerance_km: None, + history_login_count: None, + check_impossible_travel: None, + impossible_tolerance_km: None, + } + } +} diff --git a/packages/client-rust/src/models/geo_ip_policy_countries_obj_inner.rs b/packages/client-rust/src/models/geo_ip_policy_countries_obj_inner.rs new file mode 100644 index 0000000000..1f650c36f0 --- /dev/null +++ b/packages/client-rust/src/models/geo_ip_policy_countries_obj_inner.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GeoIpPolicyCountriesObjInner { + #[serde(rename = "code")] + pub code: String, + #[serde(rename = "name")] + pub name: String, +} + +impl GeoIpPolicyCountriesObjInner { + pub fn new(code: String, name: String) -> GeoIpPolicyCountriesObjInner { + GeoIpPolicyCountriesObjInner { code, name } + } +} diff --git a/packages/client-rust/src/models/geo_ip_policy_request.rs b/packages/client-rust/src/models/geo_ip_policy_request.rs new file mode 100644 index 0000000000..3a05ed7af2 --- /dev/null +++ b/packages/client-rust/src/models/geo_ip_policy_request.rs @@ -0,0 +1,74 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GeoIpPolicyRequest : GeoIP Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GeoIpPolicyRequest { + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + #[serde(rename = "asns", skip_serializing_if = "Option::is_none")] + pub asns: Option>, + #[serde(rename = "countries")] + pub countries: Vec, + #[serde( + rename = "check_history_distance", + skip_serializing_if = "Option::is_none" + )] + pub check_history_distance: Option, + #[serde( + rename = "history_max_distance_km", + skip_serializing_if = "Option::is_none" + )] + pub history_max_distance_km: Option, + #[serde( + rename = "distance_tolerance_km", + skip_serializing_if = "Option::is_none" + )] + pub distance_tolerance_km: Option, + #[serde( + rename = "history_login_count", + skip_serializing_if = "Option::is_none" + )] + pub history_login_count: Option, + #[serde( + rename = "check_impossible_travel", + skip_serializing_if = "Option::is_none" + )] + pub check_impossible_travel: Option, + #[serde( + rename = "impossible_tolerance_km", + skip_serializing_if = "Option::is_none" + )] + pub impossible_tolerance_km: Option, +} + +impl GeoIpPolicyRequest { + /// GeoIP Policy Serializer + pub fn new(name: String, countries: Vec) -> GeoIpPolicyRequest { + GeoIpPolicyRequest { + name, + execution_logging: None, + asns: None, + countries, + check_history_distance: None, + history_max_distance_km: None, + distance_tolerance_km: None, + history_login_count: None, + check_impossible_travel: None, + impossible_tolerance_km: None, + } + } +} diff --git a/packages/client-rust/src/models/geoip_binding_enum.rs b/packages/client-rust/src/models/geoip_binding_enum.rs new file mode 100644 index 0000000000..fee9bbd80b --- /dev/null +++ b/packages/client-rust/src/models/geoip_binding_enum.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum GeoipBindingEnum { + #[serde(rename = "no_binding")] + NoBinding, + #[serde(rename = "bind_continent")] + BindContinent, + #[serde(rename = "bind_continent_country")] + BindContinentCountry, + #[serde(rename = "bind_continent_country_city")] + BindContinentCountryCity, +} + +impl std::fmt::Display for GeoipBindingEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::NoBinding => write!(f, "no_binding"), + Self::BindContinent => write!(f, "bind_continent"), + Self::BindContinentCountry => write!(f, "bind_continent_country"), + Self::BindContinentCountryCity => write!(f, "bind_continent_country_city"), + } + } +} + +impl Default for GeoipBindingEnum { + fn default() -> GeoipBindingEnum { + Self::NoBinding + } +} diff --git a/packages/client-rust/src/models/global_task_status.rs b/packages/client-rust/src/models/global_task_status.rs new file mode 100644 index 0000000000..40da0fa866 --- /dev/null +++ b/packages/client-rust/src/models/global_task_status.rs @@ -0,0 +1,63 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GlobalTaskStatus { + #[serde(rename = "queued")] + pub queued: i32, + #[serde(rename = "consumed")] + pub consumed: i32, + #[serde(rename = "preprocess")] + pub preprocess: i32, + #[serde(rename = "running")] + pub running: i32, + #[serde(rename = "postprocess")] + pub postprocess: i32, + #[serde(rename = "rejected")] + pub rejected: i32, + #[serde(rename = "done")] + pub done: i32, + #[serde(rename = "info")] + pub info: i32, + #[serde(rename = "warning")] + pub warning: i32, + #[serde(rename = "error")] + pub error: i32, +} + +impl GlobalTaskStatus { + pub fn new( + queued: i32, + consumed: i32, + preprocess: i32, + running: i32, + postprocess: i32, + rejected: i32, + done: i32, + info: i32, + warning: i32, + error: i32, + ) -> GlobalTaskStatus { + GlobalTaskStatus { + queued, + consumed, + preprocess, + running, + postprocess, + rejected, + done, + info, + warning, + error, + } + } +} diff --git a/packages/client-rust/src/models/google_chrome_connector.rs b/packages/client-rust/src/models/google_chrome_connector.rs new file mode 100644 index 0000000000..f22866a9ec --- /dev/null +++ b/packages/client-rust/src/models/google_chrome_connector.rs @@ -0,0 +1,64 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GoogleChromeConnector : GoogleChromeConnector Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GoogleChromeConnector { + #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] + pub connector_uuid: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "credentials")] + pub credentials: std::collections::HashMap, + /// Full URL to be used in Google Workspace configuration + #[serde(rename = "chrome_url", deserialize_with = "Option::deserialize")] + pub chrome_url: Option, +} + +impl GoogleChromeConnector { + /// GoogleChromeConnector Serializer + pub fn new( + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + credentials: std::collections::HashMap, + chrome_url: Option, + ) -> GoogleChromeConnector { + GoogleChromeConnector { + connector_uuid: None, + name, + enabled: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + credentials, + chrome_url, + } + } +} diff --git a/packages/client-rust/src/models/google_chrome_connector_request.rs b/packages/client-rust/src/models/google_chrome_connector_request.rs new file mode 100644 index 0000000000..cac1e795fa --- /dev/null +++ b/packages/client-rust/src/models/google_chrome_connector_request.rs @@ -0,0 +1,39 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GoogleChromeConnectorRequest : GoogleChromeConnector Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GoogleChromeConnectorRequest { + #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] + pub connector_uuid: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "credentials")] + pub credentials: std::collections::HashMap, +} + +impl GoogleChromeConnectorRequest { + /// GoogleChromeConnector Serializer + pub fn new( + name: String, + credentials: std::collections::HashMap, + ) -> GoogleChromeConnectorRequest { + GoogleChromeConnectorRequest { + connector_uuid: None, + name, + enabled: None, + credentials, + } + } +} diff --git a/packages/client-rust/src/models/google_endpoint_device.rs b/packages/client-rust/src/models/google_endpoint_device.rs new file mode 100644 index 0000000000..88d22805ca --- /dev/null +++ b/packages/client-rust/src/models/google_endpoint_device.rs @@ -0,0 +1,28 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GoogleEndpointDevice : Serializer for Endpoint authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GoogleEndpointDevice { + #[serde(rename = "pk", skip_serializing_if = "Option::is_none")] + pub pk: Option, + /// The human-readable name of this device. + #[serde(rename = "name")] + pub name: String, +} + +impl GoogleEndpointDevice { + /// Serializer for Endpoint authenticator devices + pub fn new(name: String) -> GoogleEndpointDevice { + GoogleEndpointDevice { pk: None, name } + } +} diff --git a/packages/client-rust/src/models/google_endpoint_device_request.rs b/packages/client-rust/src/models/google_endpoint_device_request.rs new file mode 100644 index 0000000000..c6b349e789 --- /dev/null +++ b/packages/client-rust/src/models/google_endpoint_device_request.rs @@ -0,0 +1,28 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GoogleEndpointDeviceRequest : Serializer for Endpoint authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GoogleEndpointDeviceRequest { + #[serde(rename = "pk", skip_serializing_if = "Option::is_none")] + pub pk: Option, + /// The human-readable name of this device. + #[serde(rename = "name")] + pub name: String, +} + +impl GoogleEndpointDeviceRequest { + /// Serializer for Endpoint authenticator devices + pub fn new(name: String) -> GoogleEndpointDeviceRequest { + GoogleEndpointDeviceRequest { pk: None, name } + } +} diff --git a/packages/client-rust/src/models/google_workspace_provider.rs b/packages/client-rust/src/models/google_workspace_provider.rs new file mode 100644 index 0000000000..fab5d1806f --- /dev/null +++ b/packages/client-rust/src/models/google_workspace_provider.rs @@ -0,0 +1,129 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GoogleWorkspaceProvider : GoogleWorkspaceProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GoogleWorkspaceProvider { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Property mappings used for group creation/updating. + #[serde( + rename = "property_mappings_group", + skip_serializing_if = "Option::is_none" + )] + pub property_mappings_group: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_backchannel_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_backchannel_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_name: Option, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "delegated_subject")] + pub delegated_subject: String, + #[serde(rename = "credentials")] + pub credentials: std::collections::HashMap, + #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")] + pub scopes: Option, + #[serde( + rename = "exclude_users_service_account", + skip_serializing_if = "Option::is_none" + )] + pub exclude_users_service_account: Option, + #[serde( + rename = "filter_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub filter_group: Option>, + #[serde(rename = "user_delete_action", skip_serializing_if = "Option::is_none")] + pub user_delete_action: Option, + #[serde( + rename = "group_delete_action", + skip_serializing_if = "Option::is_none" + )] + pub group_delete_action: Option, + #[serde(rename = "default_group_email_domain")] + pub default_group_email_domain: String, + /// Controls the number of objects synced in a single task + #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] + pub sync_page_size: Option, + /// Timeout for synchronization of a single page + #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] + pub sync_page_timeout: Option, + /// When enabled, provider will not modify or create objects in the remote system. + #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] + pub dry_run: Option, +} + +impl GoogleWorkspaceProvider { + /// GoogleWorkspaceProvider Serializer + pub fn new( + pk: i32, + name: String, + component: String, + assigned_backchannel_application_slug: Option, + assigned_backchannel_application_name: Option, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + delegated_subject: String, + credentials: std::collections::HashMap, + default_group_email_domain: String, + ) -> GoogleWorkspaceProvider { + GoogleWorkspaceProvider { + pk, + name, + property_mappings: None, + property_mappings_group: None, + component, + assigned_backchannel_application_slug, + assigned_backchannel_application_name, + verbose_name, + verbose_name_plural, + meta_model_name, + delegated_subject, + credentials, + scopes: None, + exclude_users_service_account: None, + filter_group: None, + user_delete_action: None, + group_delete_action: None, + default_group_email_domain, + sync_page_size: None, + sync_page_timeout: None, + dry_run: None, + } + } +} diff --git a/packages/client-rust/src/models/google_workspace_provider_group.rs b/packages/client-rust/src/models/google_workspace_provider_group.rs new file mode 100644 index 0000000000..ea8226e630 --- /dev/null +++ b/packages/client-rust/src/models/google_workspace_provider_group.rs @@ -0,0 +1,49 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GoogleWorkspaceProviderGroup : GoogleWorkspaceProviderGroup Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GoogleWorkspaceProviderGroup { + #[serde(rename = "id")] + pub id: uuid::Uuid, + #[serde(rename = "google_id")] + pub google_id: String, + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "group_obj")] + pub group_obj: models::PartialGroup, + #[serde(rename = "provider")] + pub provider: i32, + #[serde(rename = "attributes")] + pub attributes: std::collections::HashMap, +} + +impl GoogleWorkspaceProviderGroup { + /// GoogleWorkspaceProviderGroup Serializer + pub fn new( + id: uuid::Uuid, + google_id: String, + group: uuid::Uuid, + group_obj: models::PartialGroup, + provider: i32, + attributes: std::collections::HashMap, + ) -> GoogleWorkspaceProviderGroup { + GoogleWorkspaceProviderGroup { + id, + google_id, + group, + group_obj, + provider, + attributes, + } + } +} diff --git a/packages/client-rust/src/models/google_workspace_provider_group_request.rs b/packages/client-rust/src/models/google_workspace_provider_group_request.rs new file mode 100644 index 0000000000..65be2b7e9a --- /dev/null +++ b/packages/client-rust/src/models/google_workspace_provider_group_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GoogleWorkspaceProviderGroupRequest : GoogleWorkspaceProviderGroup Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GoogleWorkspaceProviderGroupRequest { + #[serde(rename = "google_id")] + pub google_id: String, + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "provider")] + pub provider: i32, +} + +impl GoogleWorkspaceProviderGroupRequest { + /// GoogleWorkspaceProviderGroup Serializer + pub fn new( + google_id: String, + group: uuid::Uuid, + provider: i32, + ) -> GoogleWorkspaceProviderGroupRequest { + GoogleWorkspaceProviderGroupRequest { + google_id, + group, + provider, + } + } +} diff --git a/packages/client-rust/src/models/google_workspace_provider_mapping.rs b/packages/client-rust/src/models/google_workspace_provider_mapping.rs new file mode 100644 index 0000000000..a90768baa7 --- /dev/null +++ b/packages/client-rust/src/models/google_workspace_provider_mapping.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GoogleWorkspaceProviderMapping : GoogleWorkspaceProviderMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GoogleWorkspaceProviderMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + /// Get object's component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl GoogleWorkspaceProviderMapping { + /// GoogleWorkspaceProviderMapping Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + expression: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> GoogleWorkspaceProviderMapping { + GoogleWorkspaceProviderMapping { + pk, + managed: None, + name, + expression, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/google_workspace_provider_mapping_request.rs b/packages/client-rust/src/models/google_workspace_provider_mapping_request.rs new file mode 100644 index 0000000000..fa3ffc82c6 --- /dev/null +++ b/packages/client-rust/src/models/google_workspace_provider_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GoogleWorkspaceProviderMappingRequest : GoogleWorkspaceProviderMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GoogleWorkspaceProviderMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, +} + +impl GoogleWorkspaceProviderMappingRequest { + /// GoogleWorkspaceProviderMapping Serializer + pub fn new(name: String, expression: String) -> GoogleWorkspaceProviderMappingRequest { + GoogleWorkspaceProviderMappingRequest { + managed: None, + name, + expression, + } + } +} diff --git a/packages/client-rust/src/models/google_workspace_provider_request.rs b/packages/client-rust/src/models/google_workspace_provider_request.rs new file mode 100644 index 0000000000..98a586259f --- /dev/null +++ b/packages/client-rust/src/models/google_workspace_provider_request.rs @@ -0,0 +1,89 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GoogleWorkspaceProviderRequest : GoogleWorkspaceProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GoogleWorkspaceProviderRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Property mappings used for group creation/updating. + #[serde( + rename = "property_mappings_group", + skip_serializing_if = "Option::is_none" + )] + pub property_mappings_group: Option>, + #[serde(rename = "delegated_subject")] + pub delegated_subject: String, + #[serde(rename = "credentials")] + pub credentials: std::collections::HashMap, + #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")] + pub scopes: Option, + #[serde( + rename = "exclude_users_service_account", + skip_serializing_if = "Option::is_none" + )] + pub exclude_users_service_account: Option, + #[serde( + rename = "filter_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub filter_group: Option>, + #[serde(rename = "user_delete_action", skip_serializing_if = "Option::is_none")] + pub user_delete_action: Option, + #[serde( + rename = "group_delete_action", + skip_serializing_if = "Option::is_none" + )] + pub group_delete_action: Option, + #[serde(rename = "default_group_email_domain")] + pub default_group_email_domain: String, + /// Controls the number of objects synced in a single task + #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] + pub sync_page_size: Option, + /// Timeout for synchronization of a single page + #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] + pub sync_page_timeout: Option, + /// When enabled, provider will not modify or create objects in the remote system. + #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] + pub dry_run: Option, +} + +impl GoogleWorkspaceProviderRequest { + /// GoogleWorkspaceProvider Serializer + pub fn new( + name: String, + delegated_subject: String, + credentials: std::collections::HashMap, + default_group_email_domain: String, + ) -> GoogleWorkspaceProviderRequest { + GoogleWorkspaceProviderRequest { + name, + property_mappings: None, + property_mappings_group: None, + delegated_subject, + credentials, + scopes: None, + exclude_users_service_account: None, + filter_group: None, + user_delete_action: None, + group_delete_action: None, + default_group_email_domain, + sync_page_size: None, + sync_page_timeout: None, + dry_run: None, + } + } +} diff --git a/packages/client-rust/src/models/google_workspace_provider_user.rs b/packages/client-rust/src/models/google_workspace_provider_user.rs new file mode 100644 index 0000000000..98d6ddbe5e --- /dev/null +++ b/packages/client-rust/src/models/google_workspace_provider_user.rs @@ -0,0 +1,49 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GoogleWorkspaceProviderUser : GoogleWorkspaceProviderUser Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GoogleWorkspaceProviderUser { + #[serde(rename = "id")] + pub id: uuid::Uuid, + #[serde(rename = "google_id")] + pub google_id: String, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "user_obj")] + pub user_obj: models::PartialUser, + #[serde(rename = "provider")] + pub provider: i32, + #[serde(rename = "attributes")] + pub attributes: std::collections::HashMap, +} + +impl GoogleWorkspaceProviderUser { + /// GoogleWorkspaceProviderUser Serializer + pub fn new( + id: uuid::Uuid, + google_id: String, + user: i32, + user_obj: models::PartialUser, + provider: i32, + attributes: std::collections::HashMap, + ) -> GoogleWorkspaceProviderUser { + GoogleWorkspaceProviderUser { + id, + google_id, + user, + user_obj, + provider, + attributes, + } + } +} diff --git a/packages/client-rust/src/models/google_workspace_provider_user_request.rs b/packages/client-rust/src/models/google_workspace_provider_user_request.rs new file mode 100644 index 0000000000..04e4aececd --- /dev/null +++ b/packages/client-rust/src/models/google_workspace_provider_user_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GoogleWorkspaceProviderUserRequest : GoogleWorkspaceProviderUser Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GoogleWorkspaceProviderUserRequest { + #[serde(rename = "google_id")] + pub google_id: String, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "provider")] + pub provider: i32, +} + +impl GoogleWorkspaceProviderUserRequest { + /// GoogleWorkspaceProviderUser Serializer + pub fn new(google_id: String, user: i32, provider: i32) -> GoogleWorkspaceProviderUserRequest { + GoogleWorkspaceProviderUserRequest { + google_id, + user, + provider, + } + } +} diff --git a/packages/client-rust/src/models/group.rs b/packages/client-rust/src/models/group.rs new file mode 100644 index 0000000000..f4a298b30d --- /dev/null +++ b/packages/client-rust/src/models/group.rs @@ -0,0 +1,80 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Group : Group Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Group { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "num_pk")] + pub num_pk: i32, + #[serde(rename = "name")] + pub name: String, + /// Users added to this group will be superusers. + #[serde(rename = "is_superuser", skip_serializing_if = "Option::is_none")] + pub is_superuser: Option, + #[serde(rename = "parents", skip_serializing_if = "Option::is_none")] + pub parents: Option>, + #[serde(rename = "parents_obj", deserialize_with = "Option::deserialize")] + pub parents_obj: Option>, + #[serde(rename = "users", skip_serializing_if = "Option::is_none")] + pub users: Option>, + #[serde(rename = "users_obj", deserialize_with = "Option::deserialize")] + pub users_obj: Option>, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, + #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] + pub roles: Option>, + #[serde(rename = "roles_obj")] + pub roles_obj: Vec, + #[serde( + rename = "inherited_roles_obj", + deserialize_with = "Option::deserialize" + )] + pub inherited_roles_obj: Option>, + #[serde(rename = "children")] + pub children: Vec, + #[serde(rename = "children_obj", deserialize_with = "Option::deserialize")] + pub children_obj: Option>, +} + +impl Group { + /// Group Serializer + pub fn new( + pk: uuid::Uuid, + num_pk: i32, + name: String, + parents_obj: Option>, + users_obj: Option>, + roles_obj: Vec, + inherited_roles_obj: Option>, + children: Vec, + children_obj: Option>, + ) -> Group { + Group { + pk, + num_pk, + name, + is_superuser: None, + parents: None, + parents_obj, + users: None, + users_obj, + attributes: None, + roles: None, + roles_obj, + inherited_roles_obj, + children, + children_obj, + } + } +} diff --git a/packages/client-rust/src/models/group_kerberos_source_connection.rs b/packages/client-rust/src/models/group_kerberos_source_connection.rs new file mode 100644 index 0000000000..e76e1b7575 --- /dev/null +++ b/packages/client-rust/src/models/group_kerberos_source_connection.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GroupKerberosSourceConnection : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupKerberosSourceConnection { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "source_obj")] + pub source_obj: models::Source, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "last_updated")] + pub last_updated: String, +} + +impl GroupKerberosSourceConnection { + /// Group Source Connection + pub fn new( + pk: i32, + group: uuid::Uuid, + source: uuid::Uuid, + source_obj: models::Source, + identifier: String, + created: String, + last_updated: String, + ) -> GroupKerberosSourceConnection { + GroupKerberosSourceConnection { + pk, + group, + source, + source_obj, + identifier, + created, + last_updated, + } + } +} diff --git a/packages/client-rust/src/models/group_kerberos_source_connection_request.rs b/packages/client-rust/src/models/group_kerberos_source_connection_request.rs new file mode 100644 index 0000000000..ebb0ff9438 --- /dev/null +++ b/packages/client-rust/src/models/group_kerberos_source_connection_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GroupKerberosSourceConnectionRequest : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupKerberosSourceConnectionRequest { + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "identifier")] + pub identifier: String, +} + +impl GroupKerberosSourceConnectionRequest { + /// Group Source Connection + pub fn new( + group: uuid::Uuid, + source: uuid::Uuid, + identifier: String, + ) -> GroupKerberosSourceConnectionRequest { + GroupKerberosSourceConnectionRequest { + group, + source, + identifier, + } + } +} diff --git a/packages/client-rust/src/models/group_ldap_source_connection.rs b/packages/client-rust/src/models/group_ldap_source_connection.rs new file mode 100644 index 0000000000..fe324eb0ff --- /dev/null +++ b/packages/client-rust/src/models/group_ldap_source_connection.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GroupLdapSourceConnection : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupLdapSourceConnection { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "source_obj")] + pub source_obj: models::Source, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "last_updated")] + pub last_updated: String, +} + +impl GroupLdapSourceConnection { + /// Group Source Connection + pub fn new( + pk: i32, + group: uuid::Uuid, + source: uuid::Uuid, + source_obj: models::Source, + identifier: String, + created: String, + last_updated: String, + ) -> GroupLdapSourceConnection { + GroupLdapSourceConnection { + pk, + group, + source, + source_obj, + identifier, + created, + last_updated, + } + } +} diff --git a/packages/client-rust/src/models/group_ldap_source_connection_request.rs b/packages/client-rust/src/models/group_ldap_source_connection_request.rs new file mode 100644 index 0000000000..6978ee5f5a --- /dev/null +++ b/packages/client-rust/src/models/group_ldap_source_connection_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GroupLdapSourceConnectionRequest : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupLdapSourceConnectionRequest { + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "identifier")] + pub identifier: String, +} + +impl GroupLdapSourceConnectionRequest { + /// Group Source Connection + pub fn new( + group: uuid::Uuid, + source: uuid::Uuid, + identifier: String, + ) -> GroupLdapSourceConnectionRequest { + GroupLdapSourceConnectionRequest { + group, + source, + identifier, + } + } +} diff --git a/packages/client-rust/src/models/group_matching_mode_enum.rs b/packages/client-rust/src/models/group_matching_mode_enum.rs new file mode 100644 index 0000000000..109a8b12bc --- /dev/null +++ b/packages/client-rust/src/models/group_matching_mode_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum GroupMatchingModeEnum { + #[serde(rename = "identifier")] + Identifier, + #[serde(rename = "name_link")] + NameLink, + #[serde(rename = "name_deny")] + NameDeny, +} + +impl std::fmt::Display for GroupMatchingModeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Identifier => write!(f, "identifier"), + Self::NameLink => write!(f, "name_link"), + Self::NameDeny => write!(f, "name_deny"), + } + } +} + +impl Default for GroupMatchingModeEnum { + fn default() -> GroupMatchingModeEnum { + Self::Identifier + } +} diff --git a/packages/client-rust/src/models/group_o_auth_source_connection.rs b/packages/client-rust/src/models/group_o_auth_source_connection.rs new file mode 100644 index 0000000000..10bdacb8cc --- /dev/null +++ b/packages/client-rust/src/models/group_o_auth_source_connection.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GroupOAuthSourceConnection : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupOAuthSourceConnection { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "source_obj")] + pub source_obj: models::Source, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "last_updated")] + pub last_updated: String, +} + +impl GroupOAuthSourceConnection { + /// Group Source Connection + pub fn new( + pk: i32, + group: uuid::Uuid, + source: uuid::Uuid, + source_obj: models::Source, + identifier: String, + created: String, + last_updated: String, + ) -> GroupOAuthSourceConnection { + GroupOAuthSourceConnection { + pk, + group, + source, + source_obj, + identifier, + created, + last_updated, + } + } +} diff --git a/packages/client-rust/src/models/group_o_auth_source_connection_request.rs b/packages/client-rust/src/models/group_o_auth_source_connection_request.rs new file mode 100644 index 0000000000..029f46a923 --- /dev/null +++ b/packages/client-rust/src/models/group_o_auth_source_connection_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GroupOAuthSourceConnectionRequest : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupOAuthSourceConnectionRequest { + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "identifier")] + pub identifier: String, +} + +impl GroupOAuthSourceConnectionRequest { + /// Group Source Connection + pub fn new( + group: uuid::Uuid, + source: uuid::Uuid, + identifier: String, + ) -> GroupOAuthSourceConnectionRequest { + GroupOAuthSourceConnectionRequest { + group, + source, + identifier, + } + } +} diff --git a/packages/client-rust/src/models/group_plex_source_connection.rs b/packages/client-rust/src/models/group_plex_source_connection.rs new file mode 100644 index 0000000000..e2777c3441 --- /dev/null +++ b/packages/client-rust/src/models/group_plex_source_connection.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GroupPlexSourceConnection : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupPlexSourceConnection { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "source_obj")] + pub source_obj: models::Source, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "last_updated")] + pub last_updated: String, +} + +impl GroupPlexSourceConnection { + /// Group Source Connection + pub fn new( + pk: i32, + group: uuid::Uuid, + source: uuid::Uuid, + source_obj: models::Source, + identifier: String, + created: String, + last_updated: String, + ) -> GroupPlexSourceConnection { + GroupPlexSourceConnection { + pk, + group, + source, + source_obj, + identifier, + created, + last_updated, + } + } +} diff --git a/packages/client-rust/src/models/group_plex_source_connection_request.rs b/packages/client-rust/src/models/group_plex_source_connection_request.rs new file mode 100644 index 0000000000..70afd701cc --- /dev/null +++ b/packages/client-rust/src/models/group_plex_source_connection_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GroupPlexSourceConnectionRequest : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupPlexSourceConnectionRequest { + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "identifier")] + pub identifier: String, +} + +impl GroupPlexSourceConnectionRequest { + /// Group Source Connection + pub fn new( + group: uuid::Uuid, + source: uuid::Uuid, + identifier: String, + ) -> GroupPlexSourceConnectionRequest { + GroupPlexSourceConnectionRequest { + group, + source, + identifier, + } + } +} diff --git a/packages/client-rust/src/models/group_request.rs b/packages/client-rust/src/models/group_request.rs new file mode 100644 index 0000000000..8f587faa83 --- /dev/null +++ b/packages/client-rust/src/models/group_request.rs @@ -0,0 +1,43 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GroupRequest : Group Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupRequest { + #[serde(rename = "name")] + pub name: String, + /// Users added to this group will be superusers. + #[serde(rename = "is_superuser", skip_serializing_if = "Option::is_none")] + pub is_superuser: Option, + #[serde(rename = "parents", skip_serializing_if = "Option::is_none")] + pub parents: Option>, + #[serde(rename = "users", skip_serializing_if = "Option::is_none")] + pub users: Option>, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, + #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] + pub roles: Option>, +} + +impl GroupRequest { + /// Group Serializer + pub fn new(name: String) -> GroupRequest { + GroupRequest { + name, + is_superuser: None, + parents: None, + users: None, + attributes: None, + roles: None, + } + } +} diff --git a/packages/client-rust/src/models/group_saml_source_connection.rs b/packages/client-rust/src/models/group_saml_source_connection.rs new file mode 100644 index 0000000000..655676eb19 --- /dev/null +++ b/packages/client-rust/src/models/group_saml_source_connection.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GroupSamlSourceConnection : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupSamlSourceConnection { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "source_obj")] + pub source_obj: models::Source, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "last_updated")] + pub last_updated: String, +} + +impl GroupSamlSourceConnection { + /// Group Source Connection + pub fn new( + pk: i32, + group: uuid::Uuid, + source: uuid::Uuid, + source_obj: models::Source, + identifier: String, + created: String, + last_updated: String, + ) -> GroupSamlSourceConnection { + GroupSamlSourceConnection { + pk, + group, + source, + source_obj, + identifier, + created, + last_updated, + } + } +} diff --git a/packages/client-rust/src/models/group_saml_source_connection_request.rs b/packages/client-rust/src/models/group_saml_source_connection_request.rs new file mode 100644 index 0000000000..2827db8a37 --- /dev/null +++ b/packages/client-rust/src/models/group_saml_source_connection_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GroupSamlSourceConnectionRequest : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupSamlSourceConnectionRequest { + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "identifier")] + pub identifier: String, +} + +impl GroupSamlSourceConnectionRequest { + /// Group Source Connection + pub fn new( + group: uuid::Uuid, + source: uuid::Uuid, + identifier: String, + ) -> GroupSamlSourceConnectionRequest { + GroupSamlSourceConnectionRequest { + group, + source, + identifier, + } + } +} diff --git a/packages/client-rust/src/models/group_source_connection.rs b/packages/client-rust/src/models/group_source_connection.rs new file mode 100644 index 0000000000..a726c768df --- /dev/null +++ b/packages/client-rust/src/models/group_source_connection.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GroupSourceConnection : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupSourceConnection { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "source_obj")] + pub source_obj: models::Source, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "last_updated")] + pub last_updated: String, +} + +impl GroupSourceConnection { + /// Group Source Connection + pub fn new( + pk: i32, + group: uuid::Uuid, + source: uuid::Uuid, + source_obj: models::Source, + identifier: String, + created: String, + last_updated: String, + ) -> GroupSourceConnection { + GroupSourceConnection { + pk, + group, + source, + source_obj, + identifier, + created, + last_updated, + } + } +} diff --git a/packages/client-rust/src/models/group_source_connection_request.rs b/packages/client-rust/src/models/group_source_connection_request.rs new file mode 100644 index 0000000000..277fe286aa --- /dev/null +++ b/packages/client-rust/src/models/group_source_connection_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GroupSourceConnectionRequest : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupSourceConnectionRequest { + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "identifier")] + pub identifier: String, +} + +impl GroupSourceConnectionRequest { + /// Group Source Connection + pub fn new( + group: uuid::Uuid, + source: uuid::Uuid, + identifier: String, + ) -> GroupSourceConnectionRequest { + GroupSourceConnectionRequest { + group, + source, + identifier, + } + } +} diff --git a/packages/client-rust/src/models/group_telegram_source_connection.rs b/packages/client-rust/src/models/group_telegram_source_connection.rs new file mode 100644 index 0000000000..18a16cad47 --- /dev/null +++ b/packages/client-rust/src/models/group_telegram_source_connection.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GroupTelegramSourceConnection : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupTelegramSourceConnection { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "source_obj")] + pub source_obj: models::Source, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "last_updated")] + pub last_updated: String, +} + +impl GroupTelegramSourceConnection { + /// Group Source Connection + pub fn new( + pk: i32, + group: uuid::Uuid, + source: uuid::Uuid, + source_obj: models::Source, + identifier: String, + created: String, + last_updated: String, + ) -> GroupTelegramSourceConnection { + GroupTelegramSourceConnection { + pk, + group, + source, + source_obj, + identifier, + created, + last_updated, + } + } +} diff --git a/packages/client-rust/src/models/group_telegram_source_connection_request.rs b/packages/client-rust/src/models/group_telegram_source_connection_request.rs new file mode 100644 index 0000000000..6722c3de57 --- /dev/null +++ b/packages/client-rust/src/models/group_telegram_source_connection_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// GroupTelegramSourceConnectionRequest : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GroupTelegramSourceConnectionRequest { + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "identifier")] + pub identifier: String, +} + +impl GroupTelegramSourceConnectionRequest { + /// Group Source Connection + pub fn new( + group: uuid::Uuid, + source: uuid::Uuid, + identifier: String, + ) -> GroupTelegramSourceConnectionRequest { + GroupTelegramSourceConnectionRequest { + group, + source, + identifier, + } + } +} diff --git a/packages/client-rust/src/models/hardware.rs b/packages/client-rust/src/models/hardware.rs new file mode 100644 index 0000000000..15493f39fc --- /dev/null +++ b/packages/client-rust/src/models/hardware.rs @@ -0,0 +1,40 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Hardware { + #[serde(rename = "model", skip_serializing_if = "Option::is_none")] + pub model: Option, + #[serde(rename = "manufacturer", skip_serializing_if = "Option::is_none")] + pub manufacturer: Option, + #[serde(rename = "serial")] + pub serial: String, + #[serde(rename = "cpu_name", skip_serializing_if = "Option::is_none")] + pub cpu_name: Option, + #[serde(rename = "cpu_count", skip_serializing_if = "Option::is_none")] + pub cpu_count: Option, + #[serde(rename = "memory_bytes", skip_serializing_if = "Option::is_none")] + pub memory_bytes: Option, +} + +impl Hardware { + pub fn new(serial: String) -> Hardware { + Hardware { + model: None, + manufacturer: None, + serial, + cpu_name: None, + cpu_count: None, + memory_bytes: None, + } + } +} diff --git a/packages/client-rust/src/models/hardware_request.rs b/packages/client-rust/src/models/hardware_request.rs new file mode 100644 index 0000000000..ec9871aada --- /dev/null +++ b/packages/client-rust/src/models/hardware_request.rs @@ -0,0 +1,40 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HardwareRequest { + #[serde(rename = "model", skip_serializing_if = "Option::is_none")] + pub model: Option, + #[serde(rename = "manufacturer", skip_serializing_if = "Option::is_none")] + pub manufacturer: Option, + #[serde(rename = "serial")] + pub serial: String, + #[serde(rename = "cpu_name", skip_serializing_if = "Option::is_none")] + pub cpu_name: Option, + #[serde(rename = "cpu_count", skip_serializing_if = "Option::is_none")] + pub cpu_count: Option, + #[serde(rename = "memory_bytes", skip_serializing_if = "Option::is_none")] + pub memory_bytes: Option, +} + +impl HardwareRequest { + pub fn new(serial: String) -> HardwareRequest { + HardwareRequest { + model: None, + manufacturer: None, + serial, + cpu_name: None, + cpu_count: None, + memory_bytes: None, + } + } +} diff --git a/packages/client-rust/src/models/identification_challenge.rs b/packages/client-rust/src/models/identification_challenge.rs new file mode 100644 index 0000000000..30ca03f130 --- /dev/null +++ b/packages/client-rust/src/models/identification_challenge.rs @@ -0,0 +1,108 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// IdentificationChallenge : Identification challenges with all UI elements +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IdentificationChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "user_fields", deserialize_with = "Option::deserialize")] + pub user_fields: Option>, + #[serde( + rename = "pending_user_identifier", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub pending_user_identifier: Option>, + #[serde(rename = "password_fields")] + pub password_fields: bool, + #[serde( + rename = "allow_show_password", + skip_serializing_if = "Option::is_none" + )] + pub allow_show_password: Option, + #[serde(rename = "application_pre", skip_serializing_if = "Option::is_none")] + pub application_pre: Option, + #[serde( + rename = "application_pre_launch", + skip_serializing_if = "Option::is_none" + )] + pub application_pre_launch: Option, + #[serde(rename = "flow_designation")] + pub flow_designation: models::FlowDesignationEnum, + #[serde( + rename = "captcha_stage", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub captcha_stage: Option>, + #[serde(rename = "enroll_url", skip_serializing_if = "Option::is_none")] + pub enroll_url: Option, + #[serde(rename = "recovery_url", skip_serializing_if = "Option::is_none")] + pub recovery_url: Option, + #[serde(rename = "passwordless_url", skip_serializing_if = "Option::is_none")] + pub passwordless_url: Option, + #[serde(rename = "primary_action")] + pub primary_action: String, + #[serde(rename = "sources", skip_serializing_if = "Option::is_none")] + pub sources: Option>, + #[serde(rename = "show_source_labels")] + pub show_source_labels: bool, + #[serde(rename = "enable_remember_me", skip_serializing_if = "Option::is_none")] + pub enable_remember_me: Option, + #[serde( + rename = "passkey_challenge", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub passkey_challenge: Option>>, +} + +impl IdentificationChallenge { + /// Identification challenges with all UI elements + pub fn new( + user_fields: Option>, + password_fields: bool, + flow_designation: models::FlowDesignationEnum, + primary_action: String, + show_source_labels: bool, + ) -> IdentificationChallenge { + IdentificationChallenge { + flow_info: None, + component: None, + response_errors: None, + user_fields, + pending_user_identifier: None, + password_fields, + allow_show_password: None, + application_pre: None, + application_pre_launch: None, + flow_designation, + captcha_stage: None, + enroll_url: None, + recovery_url: None, + passwordless_url: None, + primary_action, + sources: None, + show_source_labels, + enable_remember_me: None, + passkey_challenge: None, + } + } +} diff --git a/packages/client-rust/src/models/identification_challenge_response_request.rs b/packages/client-rust/src/models/identification_challenge_response_request.rs new file mode 100644 index 0000000000..e387711c26 --- /dev/null +++ b/packages/client-rust/src/models/identification_challenge_response_request.rs @@ -0,0 +1,59 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// IdentificationChallengeResponseRequest : Identification challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IdentificationChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde( + rename = "uid_field", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub uid_field: Option>, + #[serde( + rename = "password", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub password: Option>, + #[serde( + rename = "captcha_token", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub captcha_token: Option>, + #[serde( + rename = "passkey", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub passkey: Option>>, +} + +impl IdentificationChallengeResponseRequest { + /// Identification challenge + pub fn new() -> IdentificationChallengeResponseRequest { + IdentificationChallengeResponseRequest { + component: None, + uid_field: None, + password: None, + captcha_token: None, + passkey: None, + } + } +} diff --git a/packages/client-rust/src/models/identification_stage.rs b/packages/client-rust/src/models/identification_stage.rs new file mode 100644 index 0000000000..3296ddee41 --- /dev/null +++ b/packages/client-rust/src/models/identification_stage.rs @@ -0,0 +1,148 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// IdentificationStage : IdentificationStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IdentificationStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + /// Fields of the user object to match against. (Hold shift to select multiple options) + #[serde(rename = "user_fields", skip_serializing_if = "Option::is_none")] + pub user_fields: Option>, + /// When set, shows a password field, instead of showing the password field as separate step. + #[serde( + rename = "password_stage", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub password_stage: Option>, + /// When set, adds functionality exactly like a Captcha stage, but baked into the + /// Identification stage. + #[serde( + rename = "captcha_stage", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub captcha_stage: Option>, + /// When enabled, user fields are matched regardless of their casing. + #[serde( + rename = "case_insensitive_matching", + skip_serializing_if = "Option::is_none" + )] + pub case_insensitive_matching: Option, + /// When a valid username/email has been entered, and this option is enabled, the user's + /// username and avatar will be shown. Otherwise, the text that the user entered will be shown + #[serde(rename = "show_matched_user", skip_serializing_if = "Option::is_none")] + pub show_matched_user: Option, + /// Optional enrollment flow, which is linked at the bottom of the page. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + /// Optional recovery flow, which is linked at the bottom of the page. + #[serde( + rename = "recovery_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub recovery_flow: Option>, + /// Optional passwordless flow, which is linked at the bottom of the page. + #[serde( + rename = "passwordless_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub passwordless_flow: Option>, + /// Specify which sources should be shown. + #[serde(rename = "sources", skip_serializing_if = "Option::is_none")] + pub sources: Option>, + #[serde(rename = "show_source_labels", skip_serializing_if = "Option::is_none")] + pub show_source_labels: Option, + /// When enabled, the stage will succeed and continue even when incorrect user info is entered. + #[serde( + rename = "pretend_user_exists", + skip_serializing_if = "Option::is_none" + )] + pub pretend_user_exists: Option, + /// Show the user the 'Remember me on this device' toggle, allowing repeat users to skip + /// straight to entering their password. + #[serde(rename = "enable_remember_me", skip_serializing_if = "Option::is_none")] + pub enable_remember_me: Option, + /// When set, and conditional WebAuthn is available, allow the user to use their passkey as a + /// first factor. + #[serde( + rename = "webauthn_stage", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub webauthn_stage: Option>, +} + +impl IdentificationStage { + /// IdentificationStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + ) -> IdentificationStage { + IdentificationStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + user_fields: None, + password_stage: None, + captcha_stage: None, + case_insensitive_matching: None, + show_matched_user: None, + enrollment_flow: None, + recovery_flow: None, + passwordless_flow: None, + sources: None, + show_source_labels: None, + pretend_user_exists: None, + enable_remember_me: None, + webauthn_stage: None, + } + } +} diff --git a/packages/client-rust/src/models/identification_stage_request.rs b/packages/client-rust/src/models/identification_stage_request.rs new file mode 100644 index 0000000000..9626eec5ed --- /dev/null +++ b/packages/client-rust/src/models/identification_stage_request.rs @@ -0,0 +1,118 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// IdentificationStageRequest : IdentificationStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IdentificationStageRequest { + #[serde(rename = "name")] + pub name: String, + /// Fields of the user object to match against. (Hold shift to select multiple options) + #[serde(rename = "user_fields", skip_serializing_if = "Option::is_none")] + pub user_fields: Option>, + /// When set, shows a password field, instead of showing the password field as separate step. + #[serde( + rename = "password_stage", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub password_stage: Option>, + /// When set, adds functionality exactly like a Captcha stage, but baked into the + /// Identification stage. + #[serde( + rename = "captcha_stage", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub captcha_stage: Option>, + /// When enabled, user fields are matched regardless of their casing. + #[serde( + rename = "case_insensitive_matching", + skip_serializing_if = "Option::is_none" + )] + pub case_insensitive_matching: Option, + /// When a valid username/email has been entered, and this option is enabled, the user's + /// username and avatar will be shown. Otherwise, the text that the user entered will be shown + #[serde(rename = "show_matched_user", skip_serializing_if = "Option::is_none")] + pub show_matched_user: Option, + /// Optional enrollment flow, which is linked at the bottom of the page. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + /// Optional recovery flow, which is linked at the bottom of the page. + #[serde( + rename = "recovery_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub recovery_flow: Option>, + /// Optional passwordless flow, which is linked at the bottom of the page. + #[serde( + rename = "passwordless_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub passwordless_flow: Option>, + /// Specify which sources should be shown. + #[serde(rename = "sources", skip_serializing_if = "Option::is_none")] + pub sources: Option>, + #[serde(rename = "show_source_labels", skip_serializing_if = "Option::is_none")] + pub show_source_labels: Option, + /// When enabled, the stage will succeed and continue even when incorrect user info is entered. + #[serde( + rename = "pretend_user_exists", + skip_serializing_if = "Option::is_none" + )] + pub pretend_user_exists: Option, + /// Show the user the 'Remember me on this device' toggle, allowing repeat users to skip + /// straight to entering their password. + #[serde(rename = "enable_remember_me", skip_serializing_if = "Option::is_none")] + pub enable_remember_me: Option, + /// When set, and conditional WebAuthn is available, allow the user to use their passkey as a + /// first factor. + #[serde( + rename = "webauthn_stage", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub webauthn_stage: Option>, +} + +impl IdentificationStageRequest { + /// IdentificationStage Serializer + pub fn new(name: String) -> IdentificationStageRequest { + IdentificationStageRequest { + name, + user_fields: None, + password_stage: None, + captcha_stage: None, + case_insensitive_matching: None, + show_matched_user: None, + enrollment_flow: None, + recovery_flow: None, + passwordless_flow: None, + sources: None, + show_source_labels: None, + pretend_user_exists: None, + enable_remember_me: None, + webauthn_stage: None, + } + } +} diff --git a/packages/client-rust/src/models/iframe_logout_challenge.rs b/packages/client-rust/src/models/iframe_logout_challenge.rs new file mode 100644 index 0000000000..85107a702d --- /dev/null +++ b/packages/client-rust/src/models/iframe_logout_challenge.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// IframeLogoutChallenge : Challenge for iframe logout +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IframeLogoutChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "logout_urls", skip_serializing_if = "Option::is_none")] + pub logout_urls: Option>, +} + +impl IframeLogoutChallenge { + /// Challenge for iframe logout + pub fn new() -> IframeLogoutChallenge { + IframeLogoutChallenge { + flow_info: None, + component: None, + response_errors: None, + logout_urls: None, + } + } +} diff --git a/packages/client-rust/src/models/iframe_logout_challenge_response_request.rs b/packages/client-rust/src/models/iframe_logout_challenge_response_request.rs new file mode 100644 index 0000000000..9fe40cf751 --- /dev/null +++ b/packages/client-rust/src/models/iframe_logout_challenge_response_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// IframeLogoutChallengeResponseRequest : Response for iframe logout +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct IframeLogoutChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, +} + +impl IframeLogoutChallengeResponseRequest { + /// Response for iframe logout + pub fn new() -> IframeLogoutChallengeResponseRequest { + IframeLogoutChallengeResponseRequest { component: None } + } +} diff --git a/packages/client-rust/src/models/impersonation_request.rs b/packages/client-rust/src/models/impersonation_request.rs new file mode 100644 index 0000000000..82f6b3a63d --- /dev/null +++ b/packages/client-rust/src/models/impersonation_request.rs @@ -0,0 +1,23 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ImpersonationRequest { + #[serde(rename = "reason")] + pub reason: String, +} + +impl ImpersonationRequest { + pub fn new(reason: String) -> ImpersonationRequest { + ImpersonationRequest { reason } + } +} diff --git a/packages/client-rust/src/models/initial_permissions.rs b/packages/client-rust/src/models/initial_permissions.rs new file mode 100644 index 0000000000..0127cced34 --- /dev/null +++ b/packages/client-rust/src/models/initial_permissions.rs @@ -0,0 +1,44 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// InitialPermissions : InitialPermissions serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct InitialPermissions { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "role")] + pub role: uuid::Uuid, + #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] + pub permissions: Option>, + #[serde(rename = "permissions_obj")] + pub permissions_obj: Vec, +} + +impl InitialPermissions { + /// InitialPermissions serializer + pub fn new( + pk: i32, + name: String, + role: uuid::Uuid, + permissions_obj: Vec, + ) -> InitialPermissions { + InitialPermissions { + pk, + name, + role, + permissions: None, + permissions_obj, + } + } +} diff --git a/packages/client-rust/src/models/initial_permissions_request.rs b/packages/client-rust/src/models/initial_permissions_request.rs new file mode 100644 index 0000000000..6f4bf85697 --- /dev/null +++ b/packages/client-rust/src/models/initial_permissions_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// InitialPermissionsRequest : InitialPermissions serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct InitialPermissionsRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "role")] + pub role: uuid::Uuid, + #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] + pub permissions: Option>, +} + +impl InitialPermissionsRequest { + /// InitialPermissions serializer + pub fn new(name: String, role: uuid::Uuid) -> InitialPermissionsRequest { + InitialPermissionsRequest { + name, + role, + permissions: None, + } + } +} diff --git a/packages/client-rust/src/models/install_id.rs b/packages/client-rust/src/models/install_id.rs new file mode 100644 index 0000000000..c8a3ffbbcd --- /dev/null +++ b/packages/client-rust/src/models/install_id.rs @@ -0,0 +1,23 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct InstallId { + #[serde(rename = "install_id")] + pub install_id: String, +} + +impl InstallId { + pub fn new(install_id: String) -> InstallId { + InstallId { install_id } + } +} diff --git a/packages/client-rust/src/models/intent_enum.rs b/packages/client-rust/src/models/intent_enum.rs new file mode 100644 index 0000000000..386ab42dd5 --- /dev/null +++ b/packages/client-rust/src/models/intent_enum.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum IntentEnum { + #[serde(rename = "verification")] + Verification, + #[serde(rename = "api")] + Api, + #[serde(rename = "recovery")] + Recovery, + #[serde(rename = "app_password")] + AppPassword, +} + +impl std::fmt::Display for IntentEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Verification => write!(f, "verification"), + Self::Api => write!(f, "api"), + Self::Recovery => write!(f, "recovery"), + Self::AppPassword => write!(f, "app_password"), + } + } +} + +impl Default for IntentEnum { + fn default() -> IntentEnum { + Self::Verification + } +} diff --git a/packages/client-rust/src/models/invalid_response_action_enum.rs b/packages/client-rust/src/models/invalid_response_action_enum.rs new file mode 100644 index 0000000000..904b20a790 --- /dev/null +++ b/packages/client-rust/src/models/invalid_response_action_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum InvalidResponseActionEnum { + #[serde(rename = "retry")] + Retry, + #[serde(rename = "restart")] + Restart, + #[serde(rename = "restart_with_context")] + RestartWithContext, +} + +impl std::fmt::Display for InvalidResponseActionEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Retry => write!(f, "retry"), + Self::Restart => write!(f, "restart"), + Self::RestartWithContext => write!(f, "restart_with_context"), + } + } +} + +impl Default for InvalidResponseActionEnum { + fn default() -> InvalidResponseActionEnum { + Self::Retry + } +} diff --git a/packages/client-rust/src/models/invitation.rs b/packages/client-rust/src/models/invitation.rs new file mode 100644 index 0000000000..c49cf2890d --- /dev/null +++ b/packages/client-rust/src/models/invitation.rs @@ -0,0 +1,65 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Invitation : Invitation Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Invitation { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, + #[serde(rename = "fixed_data", skip_serializing_if = "Option::is_none")] + pub fixed_data: Option>, + #[serde(rename = "created_by")] + pub created_by: models::PartialUser, + /// When enabled, the invitation will be deleted after usage. + #[serde(rename = "single_use", skip_serializing_if = "Option::is_none")] + pub single_use: Option, + /// When set, only the configured flow can use this invitation. + #[serde( + rename = "flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow: Option>, + #[serde(rename = "flow_obj")] + pub flow_obj: models::Flow, +} + +impl Invitation { + /// Invitation Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + created_by: models::PartialUser, + flow_obj: models::Flow, + ) -> Invitation { + Invitation { + pk, + name, + expires: None, + fixed_data: None, + created_by, + single_use: None, + flow: None, + flow_obj, + } + } +} diff --git a/packages/client-rust/src/models/invitation_request.rs b/packages/client-rust/src/models/invitation_request.rs new file mode 100644 index 0000000000..14b10f06d3 --- /dev/null +++ b/packages/client-rust/src/models/invitation_request.rs @@ -0,0 +1,51 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// InvitationRequest : Invitation Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct InvitationRequest { + #[serde(rename = "name")] + pub name: String, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, + #[serde(rename = "fixed_data", skip_serializing_if = "Option::is_none")] + pub fixed_data: Option>, + /// When enabled, the invitation will be deleted after usage. + #[serde(rename = "single_use", skip_serializing_if = "Option::is_none")] + pub single_use: Option, + /// When set, only the configured flow can use this invitation. + #[serde( + rename = "flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow: Option>, +} + +impl InvitationRequest { + /// Invitation Serializer + pub fn new(name: String) -> InvitationRequest { + InvitationRequest { + name, + expires: None, + fixed_data: None, + single_use: None, + flow: None, + } + } +} diff --git a/packages/client-rust/src/models/invitation_send_email_request.rs b/packages/client-rust/src/models/invitation_send_email_request.rs new file mode 100644 index 0000000000..03a1167a35 --- /dev/null +++ b/packages/client-rust/src/models/invitation_send_email_request.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// InvitationSendEmailRequest : Serializer for sending invitation emails +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct InvitationSendEmailRequest { + #[serde(rename = "email_addresses")] + pub email_addresses: Vec, + #[serde(rename = "cc_addresses", skip_serializing_if = "Option::is_none")] + pub cc_addresses: Option>, + #[serde(rename = "bcc_addresses", skip_serializing_if = "Option::is_none")] + pub bcc_addresses: Option>, + #[serde(rename = "template", skip_serializing_if = "Option::is_none")] + pub template: Option, +} + +impl InvitationSendEmailRequest { + /// Serializer for sending invitation emails + pub fn new(email_addresses: Vec) -> InvitationSendEmailRequest { + InvitationSendEmailRequest { + email_addresses, + cc_addresses: None, + bcc_addresses: None, + template: None, + } + } +} diff --git a/packages/client-rust/src/models/invitation_stage.rs b/packages/client-rust/src/models/invitation_stage.rs new file mode 100644 index 0000000000..66aa75b683 --- /dev/null +++ b/packages/client-rust/src/models/invitation_stage.rs @@ -0,0 +1,65 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// InvitationStage : InvitationStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct InvitationStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + /// If this flag is set, this Stage will jump to the next Stage when no Invitation is given. By + /// default this Stage will cancel the Flow when no invitation is given. + #[serde( + rename = "continue_flow_without_invitation", + skip_serializing_if = "Option::is_none" + )] + pub continue_flow_without_invitation: Option, +} + +impl InvitationStage { + /// InvitationStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + ) -> InvitationStage { + InvitationStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + continue_flow_without_invitation: None, + } + } +} diff --git a/packages/client-rust/src/models/invitation_stage_request.rs b/packages/client-rust/src/models/invitation_stage_request.rs new file mode 100644 index 0000000000..78e674e1d3 --- /dev/null +++ b/packages/client-rust/src/models/invitation_stage_request.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// InvitationStageRequest : InvitationStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct InvitationStageRequest { + #[serde(rename = "name")] + pub name: String, + /// If this flag is set, this Stage will jump to the next Stage when no Invitation is given. By + /// default this Stage will cancel the Flow when no invitation is given. + #[serde( + rename = "continue_flow_without_invitation", + skip_serializing_if = "Option::is_none" + )] + pub continue_flow_without_invitation: Option, +} + +impl InvitationStageRequest { + /// InvitationStage Serializer + pub fn new(name: String) -> InvitationStageRequest { + InvitationStageRequest { + name, + continue_flow_without_invitation: None, + } + } +} diff --git a/packages/client-rust/src/models/issuer_mode_enum.rs b/packages/client-rust/src/models/issuer_mode_enum.rs new file mode 100644 index 0000000000..ce6c9fceae --- /dev/null +++ b/packages/client-rust/src/models/issuer_mode_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum IssuerModeEnum { + #[serde(rename = "global")] + Global, + #[serde(rename = "per_provider")] + PerProvider, +} + +impl std::fmt::Display for IssuerModeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Global => write!(f, "global"), + Self::PerProvider => write!(f, "per_provider"), + } + } +} + +impl Default for IssuerModeEnum { + fn default() -> IssuerModeEnum { + Self::Global + } +} diff --git a/packages/client-rust/src/models/kadmin_type_enum.rs b/packages/client-rust/src/models/kadmin_type_enum.rs new file mode 100644 index 0000000000..95425b5dc0 --- /dev/null +++ b/packages/client-rust/src/models/kadmin_type_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum KadminTypeEnum { + #[serde(rename = "MIT")] + Mit, + #[serde(rename = "Heimdal")] + Heimdal, +} + +impl std::fmt::Display for KadminTypeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Mit => write!(f, "MIT"), + Self::Heimdal => write!(f, "Heimdal"), + } + } +} + +impl Default for KadminTypeEnum { + fn default() -> KadminTypeEnum { + Self::Mit + } +} diff --git a/packages/client-rust/src/models/kerberos_source.rs b/packages/client-rust/src/models/kerberos_source.rs new file mode 100644 index 0000000000..e1d2a84193 --- /dev/null +++ b/packages/client-rust/src/models/kerberos_source.rs @@ -0,0 +1,193 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// KerberosSource : Kerberos Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct KerberosSource { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Source's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal source name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde(rename = "managed", deserialize_with = "Option::deserialize")] + pub managed: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + #[serde(rename = "icon_url")] + pub icon_url: String, + #[serde(rename = "icon_themed_urls", deserialize_with = "Option::deserialize")] + pub icon_themed_urls: Option, + /// How the source determines if an existing group should be used or a new group created. + #[serde( + rename = "group_matching_mode", + skip_serializing_if = "Option::is_none" + )] + pub group_matching_mode: Option, + /// Kerberos realm + #[serde(rename = "realm")] + pub realm: String, + /// Custom krb5.conf to use. Uses the system one by default + #[serde(rename = "krb5_conf", skip_serializing_if = "Option::is_none")] + pub krb5_conf: Option, + /// KAdmin server type + #[serde(rename = "kadmin_type", skip_serializing_if = "Option::is_none")] + pub kadmin_type: Option, + /// Sync users from Kerberos into authentik + #[serde(rename = "sync_users", skip_serializing_if = "Option::is_none")] + pub sync_users: Option, + /// When a user changes their password, sync it back to Kerberos + #[serde( + rename = "sync_users_password", + skip_serializing_if = "Option::is_none" + )] + pub sync_users_password: Option, + /// Principal to authenticate to kadmin for sync. + #[serde(rename = "sync_principal", skip_serializing_if = "Option::is_none")] + pub sync_principal: Option, + /// Credentials cache to authenticate to kadmin for sync. Must be in the form TYPE:residual + #[serde(rename = "sync_ccache", skip_serializing_if = "Option::is_none")] + pub sync_ccache: Option, + /// Get cached source connectivity + #[serde(rename = "connectivity", deserialize_with = "Option::deserialize")] + pub connectivity: Option>, + /// Force the use of a specific server name for SPNEGO. Must be in the form HTTP@hostname + #[serde(rename = "spnego_server_name", skip_serializing_if = "Option::is_none")] + pub spnego_server_name: Option, + /// Credential cache to use for SPNEGO in form type:residual + #[serde(rename = "spnego_ccache", skip_serializing_if = "Option::is_none")] + pub spnego_ccache: Option, + /// If enabled, the authentik-stored password will be updated upon login with the Kerberos + /// password backend + #[serde( + rename = "password_login_update_internal_password", + skip_serializing_if = "Option::is_none" + )] + pub password_login_update_internal_password: Option, + /// When to trigger sync for outgoing providers + #[serde( + rename = "sync_outgoing_trigger_mode", + skip_serializing_if = "Option::is_none" + )] + pub sync_outgoing_trigger_mode: Option, +} + +impl KerberosSource { + /// Kerberos Source Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + slug: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + managed: Option, + icon_url: String, + icon_themed_urls: Option, + realm: String, + connectivity: Option>, + ) -> KerberosSource { + KerberosSource { + pk, + name, + slug, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + policy_engine_mode: None, + user_matching_mode: None, + managed, + user_path_template: None, + icon: None, + icon_url, + icon_themed_urls, + group_matching_mode: None, + realm, + krb5_conf: None, + kadmin_type: None, + sync_users: None, + sync_users_password: None, + sync_principal: None, + sync_ccache: None, + connectivity, + spnego_server_name: None, + spnego_ccache: None, + password_login_update_internal_password: None, + sync_outgoing_trigger_mode: None, + } + } +} diff --git a/packages/client-rust/src/models/kerberos_source_property_mapping.rs b/packages/client-rust/src/models/kerberos_source_property_mapping.rs new file mode 100644 index 0000000000..0280403133 --- /dev/null +++ b/packages/client-rust/src/models/kerberos_source_property_mapping.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// KerberosSourcePropertyMapping : Kerberos PropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct KerberosSourcePropertyMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + /// Get object's component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl KerberosSourcePropertyMapping { + /// Kerberos PropertyMapping Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + expression: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> KerberosSourcePropertyMapping { + KerberosSourcePropertyMapping { + pk, + managed: None, + name, + expression, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/kerberos_source_property_mapping_request.rs b/packages/client-rust/src/models/kerberos_source_property_mapping_request.rs new file mode 100644 index 0000000000..c4b516c9e8 --- /dev/null +++ b/packages/client-rust/src/models/kerberos_source_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// KerberosSourcePropertyMappingRequest : Kerberos PropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct KerberosSourcePropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, +} + +impl KerberosSourcePropertyMappingRequest { + /// Kerberos PropertyMapping Serializer + pub fn new(name: String, expression: String) -> KerberosSourcePropertyMappingRequest { + KerberosSourcePropertyMappingRequest { + managed: None, + name, + expression, + } + } +} diff --git a/packages/client-rust/src/models/kerberos_source_request.rs b/packages/client-rust/src/models/kerberos_source_request.rs new file mode 100644 index 0000000000..25f387fb81 --- /dev/null +++ b/packages/client-rust/src/models/kerberos_source_request.rs @@ -0,0 +1,158 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// KerberosSourceRequest : Kerberos Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct KerberosSourceRequest { + /// Source's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal source name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + /// How the source determines if an existing group should be used or a new group created. + #[serde( + rename = "group_matching_mode", + skip_serializing_if = "Option::is_none" + )] + pub group_matching_mode: Option, + /// Kerberos realm + #[serde(rename = "realm")] + pub realm: String, + /// Custom krb5.conf to use. Uses the system one by default + #[serde(rename = "krb5_conf", skip_serializing_if = "Option::is_none")] + pub krb5_conf: Option, + /// KAdmin server type + #[serde(rename = "kadmin_type", skip_serializing_if = "Option::is_none")] + pub kadmin_type: Option, + /// Sync users from Kerberos into authentik + #[serde(rename = "sync_users", skip_serializing_if = "Option::is_none")] + pub sync_users: Option, + /// When a user changes their password, sync it back to Kerberos + #[serde( + rename = "sync_users_password", + skip_serializing_if = "Option::is_none" + )] + pub sync_users_password: Option, + /// Principal to authenticate to kadmin for sync. + #[serde(rename = "sync_principal", skip_serializing_if = "Option::is_none")] + pub sync_principal: Option, + /// Password to authenticate to kadmin for sync + #[serde(rename = "sync_password", skip_serializing_if = "Option::is_none")] + pub sync_password: Option, + /// Keytab to authenticate to kadmin for sync. Must be base64-encoded or in the form + /// TYPE:residual + #[serde(rename = "sync_keytab", skip_serializing_if = "Option::is_none")] + pub sync_keytab: Option, + /// Credentials cache to authenticate to kadmin for sync. Must be in the form TYPE:residual + #[serde(rename = "sync_ccache", skip_serializing_if = "Option::is_none")] + pub sync_ccache: Option, + /// Force the use of a specific server name for SPNEGO. Must be in the form HTTP@hostname + #[serde(rename = "spnego_server_name", skip_serializing_if = "Option::is_none")] + pub spnego_server_name: Option, + /// SPNEGO keytab base64-encoded or path to keytab in the form FILE:path + #[serde(rename = "spnego_keytab", skip_serializing_if = "Option::is_none")] + pub spnego_keytab: Option, + /// Credential cache to use for SPNEGO in form type:residual + #[serde(rename = "spnego_ccache", skip_serializing_if = "Option::is_none")] + pub spnego_ccache: Option, + /// If enabled, the authentik-stored password will be updated upon login with the Kerberos + /// password backend + #[serde( + rename = "password_login_update_internal_password", + skip_serializing_if = "Option::is_none" + )] + pub password_login_update_internal_password: Option, + /// When to trigger sync for outgoing providers + #[serde( + rename = "sync_outgoing_trigger_mode", + skip_serializing_if = "Option::is_none" + )] + pub sync_outgoing_trigger_mode: Option, +} + +impl KerberosSourceRequest { + /// Kerberos Source Serializer + pub fn new(name: String, slug: String, realm: String) -> KerberosSourceRequest { + KerberosSourceRequest { + name, + slug, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + policy_engine_mode: None, + user_matching_mode: None, + user_path_template: None, + icon: None, + group_matching_mode: None, + realm, + krb5_conf: None, + kadmin_type: None, + sync_users: None, + sync_users_password: None, + sync_principal: None, + sync_password: None, + sync_keytab: None, + sync_ccache: None, + spnego_server_name: None, + spnego_keytab: None, + spnego_ccache: None, + password_login_update_internal_password: None, + sync_outgoing_trigger_mode: None, + } + } +} diff --git a/packages/client-rust/src/models/key_type_enum.rs b/packages/client-rust/src/models/key_type_enum.rs new file mode 100644 index 0000000000..a273ace8eb --- /dev/null +++ b/packages/client-rust/src/models/key_type_enum.rs @@ -0,0 +1,44 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum KeyTypeEnum { + #[serde(rename = "rsa")] + Rsa, + #[serde(rename = "ec")] + Ec, + #[serde(rename = "dsa")] + Dsa, + #[serde(rename = "ed25519")] + Ed25519, + #[serde(rename = "ed448")] + Ed448, +} + +impl std::fmt::Display for KeyTypeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Rsa => write!(f, "rsa"), + Self::Ec => write!(f, "ec"), + Self::Dsa => write!(f, "dsa"), + Self::Ed25519 => write!(f, "ed25519"), + Self::Ed448 => write!(f, "ed448"), + } + } +} + +impl Default for KeyTypeEnum { + fn default() -> KeyTypeEnum { + Self::Rsa + } +} diff --git a/packages/client-rust/src/models/kubernetes_service_connection.rs b/packages/client-rust/src/models/kubernetes_service_connection.rs new file mode 100644 index 0000000000..1a3cc53ceb --- /dev/null +++ b/packages/client-rust/src/models/kubernetes_service_connection.rs @@ -0,0 +1,65 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// KubernetesServiceConnection : KubernetesServiceConnection Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct KubernetesServiceConnection { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// If enabled, use the local connection. Required Docker socket/Kubernetes Integration + #[serde(rename = "local", skip_serializing_if = "Option::is_none")] + pub local: Option, + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Paste your kubeconfig here. authentik will automatically use the currently selected + /// context. + #[serde(rename = "kubeconfig", skip_serializing_if = "Option::is_none")] + pub kubeconfig: Option>, + /// Verify SSL Certificates of the Kubernetes API endpoint + #[serde(rename = "verify_ssl", skip_serializing_if = "Option::is_none")] + pub verify_ssl: Option, +} + +impl KubernetesServiceConnection { + /// KubernetesServiceConnection Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> KubernetesServiceConnection { + KubernetesServiceConnection { + pk, + name, + local: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + kubeconfig: None, + verify_ssl: None, + } + } +} diff --git a/packages/client-rust/src/models/kubernetes_service_connection_request.rs b/packages/client-rust/src/models/kubernetes_service_connection_request.rs new file mode 100644 index 0000000000..5aa8535c85 --- /dev/null +++ b/packages/client-rust/src/models/kubernetes_service_connection_request.rs @@ -0,0 +1,40 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// KubernetesServiceConnectionRequest : KubernetesServiceConnection Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct KubernetesServiceConnectionRequest { + #[serde(rename = "name")] + pub name: String, + /// If enabled, use the local connection. Required Docker socket/Kubernetes Integration + #[serde(rename = "local", skip_serializing_if = "Option::is_none")] + pub local: Option, + /// Paste your kubeconfig here. authentik will automatically use the currently selected + /// context. + #[serde(rename = "kubeconfig", skip_serializing_if = "Option::is_none")] + pub kubeconfig: Option>, + /// Verify SSL Certificates of the Kubernetes API endpoint + #[serde(rename = "verify_ssl", skip_serializing_if = "Option::is_none")] + pub verify_ssl: Option, +} + +impl KubernetesServiceConnectionRequest { + /// KubernetesServiceConnection Serializer + pub fn new(name: String) -> KubernetesServiceConnectionRequest { + KubernetesServiceConnectionRequest { + name, + local: None, + kubeconfig: None, + verify_ssl: None, + } + } +} diff --git a/packages/client-rust/src/models/last_task_status_enum.rs b/packages/client-rust/src/models/last_task_status_enum.rs new file mode 100644 index 0000000000..79575b26c8 --- /dev/null +++ b/packages/client-rust/src/models/last_task_status_enum.rs @@ -0,0 +1,59 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum LastTaskStatusEnum { + #[serde(rename = "queued")] + Queued, + #[serde(rename = "consumed")] + Consumed, + #[serde(rename = "preprocess")] + Preprocess, + #[serde(rename = "running")] + Running, + #[serde(rename = "postprocess")] + Postprocess, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "done")] + Done, + #[serde(rename = "info")] + Info, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, +} + +impl std::fmt::Display for LastTaskStatusEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Queued => write!(f, "queued"), + Self::Consumed => write!(f, "consumed"), + Self::Preprocess => write!(f, "preprocess"), + Self::Running => write!(f, "running"), + Self::Postprocess => write!(f, "postprocess"), + Self::Rejected => write!(f, "rejected"), + Self::Done => write!(f, "done"), + Self::Info => write!(f, "info"), + Self::Warning => write!(f, "warning"), + Self::Error => write!(f, "error"), + } + } +} + +impl Default for LastTaskStatusEnum { + fn default() -> LastTaskStatusEnum { + Self::Queued + } +} diff --git a/packages/client-rust/src/models/ldap_check_access.rs b/packages/client-rust/src/models/ldap_check_access.rs new file mode 100644 index 0000000000..369746361f --- /dev/null +++ b/packages/client-rust/src/models/ldap_check_access.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LdapCheckAccess : Base serializer class which doesn't implement create/update methods +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LdapCheckAccess { + #[serde( + rename = "has_search_permission", + skip_serializing_if = "Option::is_none" + )] + pub has_search_permission: Option, + #[serde(rename = "access")] + pub access: models::PolicyTestResult, +} + +impl LdapCheckAccess { + /// Base serializer class which doesn't implement create/update methods + pub fn new(access: models::PolicyTestResult) -> LdapCheckAccess { + LdapCheckAccess { + has_search_permission: None, + access, + } + } +} diff --git a/packages/client-rust/src/models/ldap_debug.rs b/packages/client-rust/src/models/ldap_debug.rs new file mode 100644 index 0000000000..0c8727e346 --- /dev/null +++ b/packages/client-rust/src/models/ldap_debug.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LdapDebug { + #[serde(rename = "user")] + pub user: Vec>, + #[serde(rename = "group")] + pub group: Vec>, + #[serde(rename = "membership")] + pub membership: Vec>, +} + +impl LdapDebug { + pub fn new( + user: Vec>, + group: Vec>, + membership: Vec>, + ) -> LdapDebug { + LdapDebug { + user, + group, + membership, + } + } +} diff --git a/packages/client-rust/src/models/ldap_outpost_config.rs b/packages/client-rust/src/models/ldap_outpost_config.rs new file mode 100644 index 0000000000..45918fc83a --- /dev/null +++ b/packages/client-rust/src/models/ldap_outpost_config.rs @@ -0,0 +1,87 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LdapOutpostConfig : LDAPProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LdapOutpostConfig { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + /// DN under which objects are accessible. + #[serde(rename = "base_dn", skip_serializing_if = "Option::is_none")] + pub base_dn: Option, + #[serde(rename = "bind_flow_slug")] + pub bind_flow_slug: String, + /// Get slug for unbind flow, defaulting to brand's default flow. + #[serde(rename = "unbind_flow_slug", deserialize_with = "Option::deserialize")] + pub unbind_flow_slug: Option, + /// Prioritise backchannel slug over direct application slug + #[serde(rename = "application_slug")] + pub application_slug: String, + #[serde( + rename = "certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub certificate: Option>, + #[serde(rename = "tls_server_name", skip_serializing_if = "Option::is_none")] + pub tls_server_name: Option, + /// The start for uidNumbers, this number is added to the user.pk to make sure that the numbers + /// aren't too low for POSIX users. Default is 2000 to ensure that we don't collide with local + /// users uidNumber + #[serde(rename = "uid_start_number", skip_serializing_if = "Option::is_none")] + pub uid_start_number: Option, + /// The start for gidNumbers, this number is added to a number generated from the group.pk to + /// make sure that the numbers aren't too low for POSIX groups. Default is 4000 to ensure that + /// we don't collide with local groups or users primary groups gidNumber + #[serde(rename = "gid_start_number", skip_serializing_if = "Option::is_none")] + pub gid_start_number: Option, + #[serde(rename = "search_mode", skip_serializing_if = "Option::is_none")] + pub search_mode: Option, + #[serde(rename = "bind_mode", skip_serializing_if = "Option::is_none")] + pub bind_mode: Option, + /// When enabled, code-based multi-factor authentication can be used by appending a semicolon + /// and the TOTP code to the password. This should only be enabled if all users that will bind + /// to this provider have a TOTP device configured, as otherwise a password may incorrectly be + /// rejected if it contains a semicolon. + #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")] + pub mfa_support: Option, +} + +impl LdapOutpostConfig { + /// LDAPProvider Serializer + pub fn new( + pk: i32, + name: String, + bind_flow_slug: String, + unbind_flow_slug: Option, + application_slug: String, + ) -> LdapOutpostConfig { + LdapOutpostConfig { + pk, + name, + base_dn: None, + bind_flow_slug, + unbind_flow_slug, + application_slug, + certificate: None, + tls_server_name: None, + uid_start_number: None, + gid_start_number: None, + search_mode: None, + bind_mode: None, + mfa_support: None, + } + } +} diff --git a/packages/client-rust/src/models/ldap_provider.rs b/packages/client-rust/src/models/ldap_provider.rs new file mode 100644 index 0000000000..87a4030de5 --- /dev/null +++ b/packages/client-rust/src/models/ldap_provider.rs @@ -0,0 +1,152 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LdapProvider : LDAPProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LdapProvider { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow")] + pub authorization_flow: uuid::Uuid, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow")] + pub invalidation_flow: uuid::Uuid, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_name: Option, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_backchannel_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_backchannel_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_name: Option, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// DN under which objects are accessible. + #[serde(rename = "base_dn", skip_serializing_if = "Option::is_none")] + pub base_dn: Option, + #[serde( + rename = "certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub certificate: Option>, + #[serde(rename = "tls_server_name", skip_serializing_if = "Option::is_none")] + pub tls_server_name: Option, + /// The start for uidNumbers, this number is added to the user.pk to make sure that the numbers + /// aren't too low for POSIX users. Default is 2000 to ensure that we don't collide with local + /// users uidNumber + #[serde(rename = "uid_start_number", skip_serializing_if = "Option::is_none")] + pub uid_start_number: Option, + /// The start for gidNumbers, this number is added to a number generated from the group.pk to + /// make sure that the numbers aren't too low for POSIX groups. Default is 4000 to ensure that + /// we don't collide with local groups or users primary groups gidNumber + #[serde(rename = "gid_start_number", skip_serializing_if = "Option::is_none")] + pub gid_start_number: Option, + #[serde(rename = "outpost_set")] + pub outpost_set: Vec, + #[serde(rename = "search_mode", skip_serializing_if = "Option::is_none")] + pub search_mode: Option, + #[serde(rename = "bind_mode", skip_serializing_if = "Option::is_none")] + pub bind_mode: Option, + /// When enabled, code-based multi-factor authentication can be used by appending a semicolon + /// and the TOTP code to the password. This should only be enabled if all users that will bind + /// to this provider have a TOTP device configured, as otherwise a password may incorrectly be + /// rejected if it contains a semicolon. + #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")] + pub mfa_support: Option, +} + +impl LdapProvider { + /// LDAPProvider Serializer + pub fn new( + pk: i32, + name: String, + authorization_flow: uuid::Uuid, + invalidation_flow: uuid::Uuid, + component: String, + assigned_application_slug: Option, + assigned_application_name: Option, + assigned_backchannel_application_slug: Option, + assigned_backchannel_application_name: Option, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + outpost_set: Vec, + ) -> LdapProvider { + LdapProvider { + pk, + name, + authentication_flow: None, + authorization_flow, + invalidation_flow, + property_mappings: None, + component, + assigned_application_slug, + assigned_application_name, + assigned_backchannel_application_slug, + assigned_backchannel_application_name, + verbose_name, + verbose_name_plural, + meta_model_name, + base_dn: None, + certificate: None, + tls_server_name: None, + uid_start_number: None, + gid_start_number: None, + outpost_set, + search_mode: None, + bind_mode: None, + mfa_support: None, + } + } +} diff --git a/packages/client-rust/src/models/ldap_provider_request.rs b/packages/client-rust/src/models/ldap_provider_request.rs new file mode 100644 index 0000000000..36e51c2f6e --- /dev/null +++ b/packages/client-rust/src/models/ldap_provider_request.rs @@ -0,0 +1,92 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LdapProviderRequest : LDAPProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LdapProviderRequest { + #[serde(rename = "name")] + pub name: String, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow")] + pub authorization_flow: uuid::Uuid, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow")] + pub invalidation_flow: uuid::Uuid, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// DN under which objects are accessible. + #[serde(rename = "base_dn", skip_serializing_if = "Option::is_none")] + pub base_dn: Option, + #[serde( + rename = "certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub certificate: Option>, + #[serde(rename = "tls_server_name", skip_serializing_if = "Option::is_none")] + pub tls_server_name: Option, + /// The start for uidNumbers, this number is added to the user.pk to make sure that the numbers + /// aren't too low for POSIX users. Default is 2000 to ensure that we don't collide with local + /// users uidNumber + #[serde(rename = "uid_start_number", skip_serializing_if = "Option::is_none")] + pub uid_start_number: Option, + /// The start for gidNumbers, this number is added to a number generated from the group.pk to + /// make sure that the numbers aren't too low for POSIX groups. Default is 4000 to ensure that + /// we don't collide with local groups or users primary groups gidNumber + #[serde(rename = "gid_start_number", skip_serializing_if = "Option::is_none")] + pub gid_start_number: Option, + #[serde(rename = "search_mode", skip_serializing_if = "Option::is_none")] + pub search_mode: Option, + #[serde(rename = "bind_mode", skip_serializing_if = "Option::is_none")] + pub bind_mode: Option, + /// When enabled, code-based multi-factor authentication can be used by appending a semicolon + /// and the TOTP code to the password. This should only be enabled if all users that will bind + /// to this provider have a TOTP device configured, as otherwise a password may incorrectly be + /// rejected if it contains a semicolon. + #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")] + pub mfa_support: Option, +} + +impl LdapProviderRequest { + /// LDAPProvider Serializer + pub fn new( + name: String, + authorization_flow: uuid::Uuid, + invalidation_flow: uuid::Uuid, + ) -> LdapProviderRequest { + LdapProviderRequest { + name, + authentication_flow: None, + authorization_flow, + invalidation_flow, + property_mappings: None, + base_dn: None, + certificate: None, + tls_server_name: None, + uid_start_number: None, + gid_start_number: None, + search_mode: None, + bind_mode: None, + mfa_support: None, + } + } +} diff --git a/packages/client-rust/src/models/ldap_source.rs b/packages/client-rust/src/models/ldap_source.rs new file mode 100644 index 0000000000..16f934bb70 --- /dev/null +++ b/packages/client-rust/src/models/ldap_source.rs @@ -0,0 +1,264 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LdapSource : LDAP Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LdapSource { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Source's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal source name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde(rename = "managed", deserialize_with = "Option::deserialize")] + pub managed: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + #[serde(rename = "icon_url")] + pub icon_url: String, + #[serde(rename = "icon_themed_urls", deserialize_with = "Option::deserialize")] + pub icon_themed_urls: Option, + #[serde(rename = "server_uri")] + pub server_uri: String, + /// Optionally verify the LDAP Server's Certificate against the CA Chain in this keypair. + #[serde( + rename = "peer_certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub peer_certificate: Option>, + /// Client certificate to authenticate against the LDAP Server's Certificate. + #[serde( + rename = "client_certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub client_certificate: Option>, + #[serde(rename = "bind_cn", skip_serializing_if = "Option::is_none")] + pub bind_cn: Option, + #[serde(rename = "start_tls", skip_serializing_if = "Option::is_none")] + pub start_tls: Option, + #[serde(rename = "sni", skip_serializing_if = "Option::is_none")] + pub sni: Option, + #[serde(rename = "base_dn")] + pub base_dn: String, + /// Prepended to Base DN for User-queries. + #[serde(rename = "additional_user_dn", skip_serializing_if = "Option::is_none")] + pub additional_user_dn: Option, + /// Prepended to Base DN for Group-queries. + #[serde( + rename = "additional_group_dn", + skip_serializing_if = "Option::is_none" + )] + pub additional_group_dn: Option, + /// Consider Objects matching this filter to be Users. + #[serde(rename = "user_object_filter", skip_serializing_if = "Option::is_none")] + pub user_object_filter: Option, + /// Consider Objects matching this filter to be Groups. + #[serde( + rename = "group_object_filter", + skip_serializing_if = "Option::is_none" + )] + pub group_object_filter: Option, + /// Field which contains members of a group. + #[serde( + rename = "group_membership_field", + skip_serializing_if = "Option::is_none" + )] + pub group_membership_field: Option, + /// Attribute which matches the value of `group_membership_field`. + #[serde( + rename = "user_membership_attribute", + skip_serializing_if = "Option::is_none" + )] + pub user_membership_attribute: Option, + /// Field which contains a unique Identifier. + #[serde( + rename = "object_uniqueness_field", + skip_serializing_if = "Option::is_none" + )] + pub object_uniqueness_field: Option, + /// Update internal authentik password when login succeeds with LDAP + #[serde( + rename = "password_login_update_internal_password", + skip_serializing_if = "Option::is_none" + )] + pub password_login_update_internal_password: Option, + #[serde(rename = "sync_users", skip_serializing_if = "Option::is_none")] + pub sync_users: Option, + /// When a user changes their password, sync it back to LDAP. This can only be enabled on a + /// single LDAP source. + #[serde( + rename = "sync_users_password", + skip_serializing_if = "Option::is_none" + )] + pub sync_users_password: Option, + #[serde(rename = "sync_groups", skip_serializing_if = "Option::is_none")] + pub sync_groups: Option, + #[serde( + rename = "sync_parent_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub sync_parent_group: Option>, + /// Get cached source connectivity + #[serde(rename = "connectivity", deserialize_with = "Option::deserialize")] + pub connectivity: + Option>>, + /// Lookup group membership based on a user attribute instead of a group attribute. This allows + /// nested group resolution on systems like FreeIPA and Active Directory + #[serde( + rename = "lookup_groups_from_user", + skip_serializing_if = "Option::is_none" + )] + pub lookup_groups_from_user: Option, + /// Delete authentik users and groups which were previously supplied by this source, but are + /// now missing from it. + #[serde( + rename = "delete_not_found_objects", + skip_serializing_if = "Option::is_none" + )] + pub delete_not_found_objects: Option, + /// When to trigger sync for outgoing providers + #[serde( + rename = "sync_outgoing_trigger_mode", + skip_serializing_if = "Option::is_none" + )] + pub sync_outgoing_trigger_mode: Option, +} + +impl LdapSource { + /// LDAP Source Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + slug: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + managed: Option, + icon_url: String, + icon_themed_urls: Option, + server_uri: String, + base_dn: String, + connectivity: Option< + std::collections::HashMap>, + >, + ) -> LdapSource { + LdapSource { + pk, + name, + slug, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + policy_engine_mode: None, + user_matching_mode: None, + managed, + user_path_template: None, + icon: None, + icon_url, + icon_themed_urls, + server_uri, + peer_certificate: None, + client_certificate: None, + bind_cn: None, + start_tls: None, + sni: None, + base_dn, + additional_user_dn: None, + additional_group_dn: None, + user_object_filter: None, + group_object_filter: None, + group_membership_field: None, + user_membership_attribute: None, + object_uniqueness_field: None, + password_login_update_internal_password: None, + sync_users: None, + sync_users_password: None, + sync_groups: None, + sync_parent_group: None, + connectivity, + lookup_groups_from_user: None, + delete_not_found_objects: None, + sync_outgoing_trigger_mode: None, + } + } +} diff --git a/packages/client-rust/src/models/ldap_source_property_mapping.rs b/packages/client-rust/src/models/ldap_source_property_mapping.rs new file mode 100644 index 0000000000..7aba86e5ef --- /dev/null +++ b/packages/client-rust/src/models/ldap_source_property_mapping.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LdapSourcePropertyMapping : LDAP PropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LdapSourcePropertyMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + /// Get object's component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl LdapSourcePropertyMapping { + /// LDAP PropertyMapping Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + expression: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> LdapSourcePropertyMapping { + LdapSourcePropertyMapping { + pk, + managed: None, + name, + expression, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/ldap_source_property_mapping_request.rs b/packages/client-rust/src/models/ldap_source_property_mapping_request.rs new file mode 100644 index 0000000000..b4b23ec18e --- /dev/null +++ b/packages/client-rust/src/models/ldap_source_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LdapSourcePropertyMappingRequest : LDAP PropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LdapSourcePropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, +} + +impl LdapSourcePropertyMappingRequest { + /// LDAP PropertyMapping Serializer + pub fn new(name: String, expression: String) -> LdapSourcePropertyMappingRequest { + LdapSourcePropertyMappingRequest { + managed: None, + name, + expression, + } + } +} diff --git a/packages/client-rust/src/models/ldap_source_request.rs b/packages/client-rust/src/models/ldap_source_request.rs new file mode 100644 index 0000000000..07e0cf3b36 --- /dev/null +++ b/packages/client-rust/src/models/ldap_source_request.rs @@ -0,0 +1,220 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LdapSourceRequest : LDAP Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LdapSourceRequest { + /// Source's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal source name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + #[serde(rename = "server_uri")] + pub server_uri: String, + /// Optionally verify the LDAP Server's Certificate against the CA Chain in this keypair. + #[serde( + rename = "peer_certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub peer_certificate: Option>, + /// Client certificate to authenticate against the LDAP Server's Certificate. + #[serde( + rename = "client_certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub client_certificate: Option>, + #[serde(rename = "bind_cn", skip_serializing_if = "Option::is_none")] + pub bind_cn: Option, + #[serde(rename = "bind_password", skip_serializing_if = "Option::is_none")] + pub bind_password: Option, + #[serde(rename = "start_tls", skip_serializing_if = "Option::is_none")] + pub start_tls: Option, + #[serde(rename = "sni", skip_serializing_if = "Option::is_none")] + pub sni: Option, + #[serde(rename = "base_dn")] + pub base_dn: String, + /// Prepended to Base DN for User-queries. + #[serde(rename = "additional_user_dn", skip_serializing_if = "Option::is_none")] + pub additional_user_dn: Option, + /// Prepended to Base DN for Group-queries. + #[serde( + rename = "additional_group_dn", + skip_serializing_if = "Option::is_none" + )] + pub additional_group_dn: Option, + /// Consider Objects matching this filter to be Users. + #[serde(rename = "user_object_filter", skip_serializing_if = "Option::is_none")] + pub user_object_filter: Option, + /// Consider Objects matching this filter to be Groups. + #[serde( + rename = "group_object_filter", + skip_serializing_if = "Option::is_none" + )] + pub group_object_filter: Option, + /// Field which contains members of a group. + #[serde( + rename = "group_membership_field", + skip_serializing_if = "Option::is_none" + )] + pub group_membership_field: Option, + /// Attribute which matches the value of `group_membership_field`. + #[serde( + rename = "user_membership_attribute", + skip_serializing_if = "Option::is_none" + )] + pub user_membership_attribute: Option, + /// Field which contains a unique Identifier. + #[serde( + rename = "object_uniqueness_field", + skip_serializing_if = "Option::is_none" + )] + pub object_uniqueness_field: Option, + /// Update internal authentik password when login succeeds with LDAP + #[serde( + rename = "password_login_update_internal_password", + skip_serializing_if = "Option::is_none" + )] + pub password_login_update_internal_password: Option, + #[serde(rename = "sync_users", skip_serializing_if = "Option::is_none")] + pub sync_users: Option, + /// When a user changes their password, sync it back to LDAP. This can only be enabled on a + /// single LDAP source. + #[serde( + rename = "sync_users_password", + skip_serializing_if = "Option::is_none" + )] + pub sync_users_password: Option, + #[serde(rename = "sync_groups", skip_serializing_if = "Option::is_none")] + pub sync_groups: Option, + #[serde( + rename = "sync_parent_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub sync_parent_group: Option>, + /// Lookup group membership based on a user attribute instead of a group attribute. This allows + /// nested group resolution on systems like FreeIPA and Active Directory + #[serde( + rename = "lookup_groups_from_user", + skip_serializing_if = "Option::is_none" + )] + pub lookup_groups_from_user: Option, + /// Delete authentik users and groups which were previously supplied by this source, but are + /// now missing from it. + #[serde( + rename = "delete_not_found_objects", + skip_serializing_if = "Option::is_none" + )] + pub delete_not_found_objects: Option, + /// When to trigger sync for outgoing providers + #[serde( + rename = "sync_outgoing_trigger_mode", + skip_serializing_if = "Option::is_none" + )] + pub sync_outgoing_trigger_mode: Option, +} + +impl LdapSourceRequest { + /// LDAP Source Serializer + pub fn new( + name: String, + slug: String, + server_uri: String, + base_dn: String, + ) -> LdapSourceRequest { + LdapSourceRequest { + name, + slug, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + policy_engine_mode: None, + user_matching_mode: None, + user_path_template: None, + icon: None, + server_uri, + peer_certificate: None, + client_certificate: None, + bind_cn: None, + bind_password: None, + start_tls: None, + sni: None, + base_dn, + additional_user_dn: None, + additional_group_dn: None, + user_object_filter: None, + group_object_filter: None, + group_membership_field: None, + user_membership_attribute: None, + object_uniqueness_field: None, + password_login_update_internal_password: None, + sync_users: None, + sync_users_password: None, + sync_groups: None, + sync_parent_group: None, + lookup_groups_from_user: None, + delete_not_found_objects: None, + sync_outgoing_trigger_mode: None, + } + } +} diff --git a/packages/client-rust/src/models/ldapapi_access_mode.rs b/packages/client-rust/src/models/ldapapi_access_mode.rs new file mode 100644 index 0000000000..2e695d5da6 --- /dev/null +++ b/packages/client-rust/src/models/ldapapi_access_mode.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum LdapapiAccessMode { + #[serde(rename = "direct")] + Direct, + #[serde(rename = "cached")] + Cached, +} + +impl std::fmt::Display for LdapapiAccessMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Direct => write!(f, "direct"), + Self::Cached => write!(f, "cached"), + } + } +} + +impl Default for LdapapiAccessMode { + fn default() -> LdapapiAccessMode { + Self::Direct + } +} diff --git a/packages/client-rust/src/models/license.rs b/packages/client-rust/src/models/license.rs new file mode 100644 index 0000000000..237b83c6bd --- /dev/null +++ b/packages/client-rust/src/models/license.rs @@ -0,0 +1,49 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// License : License Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct License { + #[serde(rename = "license_uuid")] + pub license_uuid: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "key")] + pub key: String, + #[serde(rename = "expiry")] + pub expiry: String, + #[serde(rename = "internal_users")] + pub internal_users: i32, + #[serde(rename = "external_users")] + pub external_users: i32, +} + +impl License { + /// License Serializer + pub fn new( + license_uuid: uuid::Uuid, + name: String, + key: String, + expiry: String, + internal_users: i32, + external_users: i32, + ) -> License { + License { + license_uuid, + name, + key, + expiry, + internal_users, + external_users, + } + } +} diff --git a/packages/client-rust/src/models/license_flags_enum.rs b/packages/client-rust/src/models/license_flags_enum.rs new file mode 100644 index 0000000000..223f374531 --- /dev/null +++ b/packages/client-rust/src/models/license_flags_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum LicenseFlagsEnum { + #[serde(rename = "trial")] + Trial, + #[serde(rename = "non_production")] + NonProduction, +} + +impl std::fmt::Display for LicenseFlagsEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Trial => write!(f, "trial"), + Self::NonProduction => write!(f, "non_production"), + } + } +} + +impl Default for LicenseFlagsEnum { + fn default() -> LicenseFlagsEnum { + Self::Trial + } +} diff --git a/packages/client-rust/src/models/license_forecast.rs b/packages/client-rust/src/models/license_forecast.rs new file mode 100644 index 0000000000..5ca4595042 --- /dev/null +++ b/packages/client-rust/src/models/license_forecast.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LicenseForecast : Serializer for license forecast +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LicenseForecast { + #[serde(rename = "internal_users")] + pub internal_users: i32, + #[serde(rename = "external_users")] + pub external_users: i32, + #[serde(rename = "forecasted_internal_users")] + pub forecasted_internal_users: i32, + #[serde(rename = "forecasted_external_users")] + pub forecasted_external_users: i32, +} + +impl LicenseForecast { + /// Serializer for license forecast + pub fn new( + internal_users: i32, + external_users: i32, + forecasted_internal_users: i32, + forecasted_external_users: i32, + ) -> LicenseForecast { + LicenseForecast { + internal_users, + external_users, + forecasted_internal_users, + forecasted_external_users, + } + } +} diff --git a/packages/client-rust/src/models/license_request.rs b/packages/client-rust/src/models/license_request.rs new file mode 100644 index 0000000000..6432b57d20 --- /dev/null +++ b/packages/client-rust/src/models/license_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LicenseRequest : License Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LicenseRequest { + #[serde(rename = "key")] + pub key: String, +} + +impl LicenseRequest { + /// License Serializer + pub fn new(key: String) -> LicenseRequest { + LicenseRequest { key } + } +} diff --git a/packages/client-rust/src/models/license_status_enum.rs b/packages/client-rust/src/models/license_status_enum.rs new file mode 100644 index 0000000000..f447b0385a --- /dev/null +++ b/packages/client-rust/src/models/license_status_enum.rs @@ -0,0 +1,50 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum LicenseStatusEnum { + #[serde(rename = "unlicensed")] + Unlicensed, + #[serde(rename = "valid")] + Valid, + #[serde(rename = "expired")] + Expired, + #[serde(rename = "expiry_soon")] + ExpirySoon, + #[serde(rename = "limit_exceeded_admin")] + LimitExceededAdmin, + #[serde(rename = "limit_exceeded_user")] + LimitExceededUser, + #[serde(rename = "read_only")] + ReadOnly, +} + +impl std::fmt::Display for LicenseStatusEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Unlicensed => write!(f, "unlicensed"), + Self::Valid => write!(f, "valid"), + Self::Expired => write!(f, "expired"), + Self::ExpirySoon => write!(f, "expiry_soon"), + Self::LimitExceededAdmin => write!(f, "limit_exceeded_admin"), + Self::LimitExceededUser => write!(f, "limit_exceeded_user"), + Self::ReadOnly => write!(f, "read_only"), + } + } +} + +impl Default for LicenseStatusEnum { + fn default() -> LicenseStatusEnum { + Self::Unlicensed + } +} diff --git a/packages/client-rust/src/models/license_summary.rs b/packages/client-rust/src/models/license_summary.rs new file mode 100644 index 0000000000..94e0bc714b --- /dev/null +++ b/packages/client-rust/src/models/license_summary.rs @@ -0,0 +1,45 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LicenseSummary : Serializer for license status +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LicenseSummary { + #[serde(rename = "internal_users")] + pub internal_users: i32, + #[serde(rename = "external_users")] + pub external_users: i32, + #[serde(rename = "status")] + pub status: models::LicenseSummaryStatusEnum, + #[serde(rename = "latest_valid")] + pub latest_valid: String, + #[serde(rename = "license_flags")] + pub license_flags: Vec, +} + +impl LicenseSummary { + /// Serializer for license status + pub fn new( + internal_users: i32, + external_users: i32, + status: models::LicenseSummaryStatusEnum, + latest_valid: String, + license_flags: Vec, + ) -> LicenseSummary { + LicenseSummary { + internal_users, + external_users, + status, + latest_valid, + license_flags, + } + } +} diff --git a/packages/client-rust/src/models/license_summary_status_enum.rs b/packages/client-rust/src/models/license_summary_status_enum.rs new file mode 100644 index 0000000000..ccf4eeefbf --- /dev/null +++ b/packages/client-rust/src/models/license_summary_status_enum.rs @@ -0,0 +1,50 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum LicenseSummaryStatusEnum { + #[serde(rename = "unlicensed")] + Unlicensed, + #[serde(rename = "valid")] + Valid, + #[serde(rename = "expired")] + Expired, + #[serde(rename = "expiry_soon")] + ExpirySoon, + #[serde(rename = "limit_exceeded_admin")] + LimitExceededAdmin, + #[serde(rename = "limit_exceeded_user")] + LimitExceededUser, + #[serde(rename = "read_only")] + ReadOnly, +} + +impl std::fmt::Display for LicenseSummaryStatusEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Unlicensed => write!(f, "unlicensed"), + Self::Valid => write!(f, "valid"), + Self::Expired => write!(f, "expired"), + Self::ExpirySoon => write!(f, "expiry_soon"), + Self::LimitExceededAdmin => write!(f, "limit_exceeded_admin"), + Self::LimitExceededUser => write!(f, "limit_exceeded_user"), + Self::ReadOnly => write!(f, "read_only"), + } + } +} + +impl Default for LicenseSummaryStatusEnum { + fn default() -> LicenseSummaryStatusEnum { + Self::Unlicensed + } +} diff --git a/packages/client-rust/src/models/lifecycle_iteration.rs b/packages/client-rust/src/models/lifecycle_iteration.rs new file mode 100644 index 0000000000..52b8a49550 --- /dev/null +++ b/packages/client-rust/src/models/lifecycle_iteration.rs @@ -0,0 +1,82 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LifecycleIteration : Mixin to validate that a valid enterprise license exists before allowing to +/// save the object +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LifecycleIteration { + #[serde(rename = "id")] + pub id: uuid::Uuid, + #[serde(rename = "content_type")] + pub content_type: models::ContentTypeEnum, + #[serde(rename = "object_id")] + pub object_id: String, + #[serde(rename = "object_verbose")] + pub object_verbose: String, + #[serde(rename = "object_admin_url")] + pub object_admin_url: String, + #[serde(rename = "state")] + pub state: models::LifecycleIterationStateEnum, + #[serde(rename = "opened_on")] + pub opened_on: String, + #[serde(rename = "grace_period_end")] + pub grace_period_end: String, + #[serde(rename = "next_review_date")] + pub next_review_date: String, + #[serde(rename = "reviews")] + pub reviews: Vec, + #[serde(rename = "user_can_review")] + pub user_can_review: bool, + #[serde(rename = "reviewer_groups")] + pub reviewer_groups: Vec, + #[serde(rename = "min_reviewers")] + pub min_reviewers: i32, + #[serde(rename = "reviewers")] + pub reviewers: Vec, +} + +impl LifecycleIteration { + /// Mixin to validate that a valid enterprise license exists before allowing to save the object + pub fn new( + id: uuid::Uuid, + content_type: models::ContentTypeEnum, + object_id: String, + object_verbose: String, + object_admin_url: String, + state: models::LifecycleIterationStateEnum, + opened_on: String, + grace_period_end: String, + next_review_date: String, + reviews: Vec, + user_can_review: bool, + reviewer_groups: Vec, + min_reviewers: i32, + reviewers: Vec, + ) -> LifecycleIteration { + LifecycleIteration { + id, + content_type, + object_id, + object_verbose, + object_admin_url, + state, + opened_on, + grace_period_end, + next_review_date, + reviews, + user_can_review, + reviewer_groups, + min_reviewers, + reviewers, + } + } +} diff --git a/packages/client-rust/src/models/lifecycle_iteration_request.rs b/packages/client-rust/src/models/lifecycle_iteration_request.rs new file mode 100644 index 0000000000..82534e754b --- /dev/null +++ b/packages/client-rust/src/models/lifecycle_iteration_request.rs @@ -0,0 +1,26 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LifecycleIterationRequest : Mixin to validate that a valid enterprise license exists before +/// allowing to save the object +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LifecycleIterationRequest { + #[serde(rename = "content_type")] + pub content_type: models::ContentTypeEnum, +} + +impl LifecycleIterationRequest { + /// Mixin to validate that a valid enterprise license exists before allowing to save the object + pub fn new(content_type: models::ContentTypeEnum) -> LifecycleIterationRequest { + LifecycleIterationRequest { content_type } + } +} diff --git a/packages/client-rust/src/models/lifecycle_iteration_state_enum.rs b/packages/client-rust/src/models/lifecycle_iteration_state_enum.rs new file mode 100644 index 0000000000..c3148e3da7 --- /dev/null +++ b/packages/client-rust/src/models/lifecycle_iteration_state_enum.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum LifecycleIterationStateEnum { + #[serde(rename = "REVIEWED")] + Reviewed, + #[serde(rename = "PENDING")] + Pending, + #[serde(rename = "OVERDUE")] + Overdue, + #[serde(rename = "CANCELED")] + Canceled, +} + +impl std::fmt::Display for LifecycleIterationStateEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Reviewed => write!(f, "REVIEWED"), + Self::Pending => write!(f, "PENDING"), + Self::Overdue => write!(f, "OVERDUE"), + Self::Canceled => write!(f, "CANCELED"), + } + } +} + +impl Default for LifecycleIterationStateEnum { + fn default() -> LifecycleIterationStateEnum { + Self::Reviewed + } +} diff --git a/packages/client-rust/src/models/lifecycle_rule.rs b/packages/client-rust/src/models/lifecycle_rule.rs new file mode 100644 index 0000000000..0680006d78 --- /dev/null +++ b/packages/client-rust/src/models/lifecycle_rule.rs @@ -0,0 +1,88 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LifecycleRule : Mixin to validate that a valid enterprise license exists before allowing to save +/// the object +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LifecycleRule { + #[serde(rename = "id")] + pub id: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "content_type")] + pub content_type: models::ContentTypeEnum, + #[serde( + rename = "object_id", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub object_id: Option>, + #[serde(rename = "interval", skip_serializing_if = "Option::is_none")] + pub interval: Option, + #[serde(rename = "grace_period", skip_serializing_if = "Option::is_none")] + pub grace_period: Option, + #[serde(rename = "reviewer_groups", skip_serializing_if = "Option::is_none")] + pub reviewer_groups: Option>, + #[serde(rename = "reviewer_groups_obj")] + pub reviewer_groups_obj: Vec, + #[serde(rename = "min_reviewers", skip_serializing_if = "Option::is_none")] + pub min_reviewers: Option, + #[serde( + rename = "min_reviewers_is_per_group", + skip_serializing_if = "Option::is_none" + )] + pub min_reviewers_is_per_group: Option, + #[serde(rename = "reviewers")] + pub reviewers: Vec, + #[serde(rename = "reviewers_obj")] + pub reviewers_obj: Vec, + /// Select which transports should be used to notify the reviewers. If none are selected, the + /// notification will only be shown in the authentik UI. + #[serde( + rename = "notification_transports", + skip_serializing_if = "Option::is_none" + )] + pub notification_transports: Option>, + #[serde(rename = "target_verbose")] + pub target_verbose: String, +} + +impl LifecycleRule { + /// Mixin to validate that a valid enterprise license exists before allowing to save the object + pub fn new( + id: uuid::Uuid, + name: String, + content_type: models::ContentTypeEnum, + reviewer_groups_obj: Vec, + reviewers: Vec, + reviewers_obj: Vec, + target_verbose: String, + ) -> LifecycleRule { + LifecycleRule { + id, + name, + content_type, + object_id: None, + interval: None, + grace_period: None, + reviewer_groups: None, + reviewer_groups_obj, + min_reviewers: None, + min_reviewers_is_per_group: None, + reviewers, + reviewers_obj, + notification_transports: None, + target_verbose, + } + } +} diff --git a/packages/client-rust/src/models/lifecycle_rule_request.rs b/packages/client-rust/src/models/lifecycle_rule_request.rs new file mode 100644 index 0000000000..b83768ccb3 --- /dev/null +++ b/packages/client-rust/src/models/lifecycle_rule_request.rs @@ -0,0 +1,72 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LifecycleRuleRequest : Mixin to validate that a valid enterprise license exists before allowing +/// to save the object +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LifecycleRuleRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "content_type")] + pub content_type: models::ContentTypeEnum, + #[serde( + rename = "object_id", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub object_id: Option>, + #[serde(rename = "interval", skip_serializing_if = "Option::is_none")] + pub interval: Option, + #[serde(rename = "grace_period", skip_serializing_if = "Option::is_none")] + pub grace_period: Option, + #[serde(rename = "reviewer_groups", skip_serializing_if = "Option::is_none")] + pub reviewer_groups: Option>, + #[serde(rename = "min_reviewers", skip_serializing_if = "Option::is_none")] + pub min_reviewers: Option, + #[serde( + rename = "min_reviewers_is_per_group", + skip_serializing_if = "Option::is_none" + )] + pub min_reviewers_is_per_group: Option, + #[serde(rename = "reviewers")] + pub reviewers: Vec, + /// Select which transports should be used to notify the reviewers. If none are selected, the + /// notification will only be shown in the authentik UI. + #[serde( + rename = "notification_transports", + skip_serializing_if = "Option::is_none" + )] + pub notification_transports: Option>, +} + +impl LifecycleRuleRequest { + /// Mixin to validate that a valid enterprise license exists before allowing to save the object + pub fn new( + name: String, + content_type: models::ContentTypeEnum, + reviewers: Vec, + ) -> LifecycleRuleRequest { + LifecycleRuleRequest { + name, + content_type, + object_id: None, + interval: None, + grace_period: None, + reviewer_groups: None, + min_reviewers: None, + min_reviewers_is_per_group: None, + reviewers, + notification_transports: None, + } + } +} diff --git a/packages/client-rust/src/models/link.rs b/packages/client-rust/src/models/link.rs new file mode 100644 index 0000000000..5de8799a7b --- /dev/null +++ b/packages/client-rust/src/models/link.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Link : Returns a single link +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Link { + #[serde(rename = "link")] + pub link: String, +} + +impl Link { + /// Returns a single link + pub fn new(link: String) -> Link { + Link { link } + } +} diff --git a/packages/client-rust/src/models/log_event.rs b/packages/client-rust/src/models/log_event.rs new file mode 100644 index 0000000000..5314ce6db9 --- /dev/null +++ b/packages/client-rust/src/models/log_event.rs @@ -0,0 +1,45 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LogEvent : Single log message with all context logged. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LogEvent { + #[serde(rename = "timestamp")] + pub timestamp: String, + #[serde(rename = "log_level")] + pub log_level: models::LogLevelEnum, + #[serde(rename = "logger")] + pub logger: String, + #[serde(rename = "event")] + pub event: String, + #[serde(rename = "attributes")] + pub attributes: std::collections::HashMap, +} + +impl LogEvent { + /// Single log message with all context logged. + pub fn new( + timestamp: String, + log_level: models::LogLevelEnum, + logger: String, + event: String, + attributes: std::collections::HashMap, + ) -> LogEvent { + LogEvent { + timestamp, + log_level, + logger, + event, + attributes, + } + } +} diff --git a/packages/client-rust/src/models/log_level_enum.rs b/packages/client-rust/src/models/log_level_enum.rs new file mode 100644 index 0000000000..7af4d69087 --- /dev/null +++ b/packages/client-rust/src/models/log_level_enum.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum LogLevelEnum { + #[serde(rename = "critical")] + Critical, + #[serde(rename = "exception")] + Exception, + #[serde(rename = "error")] + Error, + #[serde(rename = "warn")] + Warn, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "info")] + Info, + #[serde(rename = "debug")] + Debug, + #[serde(rename = "notset")] + Notset, +} + +impl std::fmt::Display for LogLevelEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Critical => write!(f, "critical"), + Self::Exception => write!(f, "exception"), + Self::Error => write!(f, "error"), + Self::Warn => write!(f, "warn"), + Self::Warning => write!(f, "warning"), + Self::Info => write!(f, "info"), + Self::Debug => write!(f, "debug"), + Self::Notset => write!(f, "notset"), + } + } +} + +impl Default for LogLevelEnum { + fn default() -> LogLevelEnum { + Self::Critical + } +} diff --git a/packages/client-rust/src/models/login_challenge_types.rs b/packages/client-rust/src/models/login_challenge_types.rs new file mode 100644 index 0000000000..28b05b5c5d --- /dev/null +++ b/packages/client-rust/src/models/login_challenge_types.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(tag = "component")] +pub enum LoginChallengeTypes { + #[serde(rename = "xak-flow-redirect")] + XakFlowRedirect(models::RedirectChallenge), + #[serde(rename = "ak-source-oauth-apple")] + AkSourceOauthApple(models::AppleLoginChallenge), + #[serde(rename = "ak-source-plex")] + AkSourcePlex(models::PlexAuthenticationChallenge), + #[serde(rename = "ak-source-telegram")] + AkSourceTelegram(models::TelegramLoginChallenge), +} + +impl Default for LoginChallengeTypes { + fn default() -> Self { + Self::XakFlowRedirect(Default::default()) + } +} diff --git a/packages/client-rust/src/models/login_source.rs b/packages/client-rust/src/models/login_source.rs new file mode 100644 index 0000000000..fc6b34ce82 --- /dev/null +++ b/packages/client-rust/src/models/login_source.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LoginSource : Serializer for Login buttons of sources +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LoginSource { + #[serde(rename = "name")] + pub name: String, + #[serde( + rename = "icon_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub icon_url: Option>, + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + #[serde(rename = "challenge")] + pub challenge: models::LoginChallengeTypes, +} + +impl LoginSource { + /// Serializer for Login buttons of sources + pub fn new(name: String, challenge: models::LoginChallengeTypes) -> LoginSource { + LoginSource { + name, + icon_url: None, + promoted: None, + challenge, + } + } +} diff --git a/packages/client-rust/src/models/logout_url.rs b/packages/client-rust/src/models/logout_url.rs new file mode 100644 index 0000000000..760079d49c --- /dev/null +++ b/packages/client-rust/src/models/logout_url.rs @@ -0,0 +1,67 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// LogoutUrl : Data for a single logout URL +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct LogoutUrl { + #[serde(rename = "url")] + pub url: String, + #[serde( + rename = "provider_name", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub provider_name: Option>, + #[serde( + rename = "binding", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub binding: Option>, + #[serde( + rename = "saml_request", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub saml_request: Option>, + #[serde( + rename = "saml_response", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub saml_response: Option>, + #[serde( + rename = "saml_relay_state", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub saml_relay_state: Option>, +} + +impl LogoutUrl { + /// Data for a single logout URL + pub fn new(url: String) -> LogoutUrl { + LogoutUrl { + url, + provider_name: None, + binding: None, + saml_request: None, + saml_response: None, + saml_relay_state: None, + } + } +} diff --git a/packages/client-rust/src/models/matching_mode_enum.rs b/packages/client-rust/src/models/matching_mode_enum.rs new file mode 100644 index 0000000000..f129062605 --- /dev/null +++ b/packages/client-rust/src/models/matching_mode_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum MatchingModeEnum { + #[serde(rename = "strict")] + Strict, + #[serde(rename = "regex")] + Regex, +} + +impl std::fmt::Display for MatchingModeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Strict => write!(f, "strict"), + Self::Regex => write!(f, "regex"), + } + } +} + +impl Default for MatchingModeEnum { + fn default() -> MatchingModeEnum { + Self::Strict + } +} diff --git a/packages/client-rust/src/models/mdm_config_request.rs b/packages/client-rust/src/models/mdm_config_request.rs new file mode 100644 index 0000000000..842a5e2972 --- /dev/null +++ b/packages/client-rust/src/models/mdm_config_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// MdmConfigRequest : Base serializer class which doesn't implement create/update methods +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MdmConfigRequest { + #[serde(rename = "platform")] + pub platform: models::DeviceFactsOsFamily, + #[serde(rename = "enrollment_token")] + pub enrollment_token: uuid::Uuid, +} + +impl MdmConfigRequest { + /// Base serializer class which doesn't implement create/update methods + pub fn new( + platform: models::DeviceFactsOsFamily, + enrollment_token: uuid::Uuid, + ) -> MdmConfigRequest { + MdmConfigRequest { + platform, + enrollment_token, + } + } +} diff --git a/packages/client-rust/src/models/mdm_config_response.rs b/packages/client-rust/src/models/mdm_config_response.rs new file mode 100644 index 0000000000..3d982b9cca --- /dev/null +++ b/packages/client-rust/src/models/mdm_config_response.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// MdmConfigResponse : Base serializer class which doesn't implement create/update methods +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MdmConfigResponse { + #[serde(rename = "config")] + pub config: String, + #[serde(rename = "mime_type")] + pub mime_type: String, + #[serde(rename = "filename")] + pub filename: String, +} + +impl MdmConfigResponse { + /// Base serializer class which doesn't implement create/update methods + pub fn new(config: String, mime_type: String, filename: String) -> MdmConfigResponse { + MdmConfigResponse { + config, + mime_type, + filename, + } + } +} diff --git a/packages/client-rust/src/models/metadata.rs b/packages/client-rust/src/models/metadata.rs new file mode 100644 index 0000000000..019545a240 --- /dev/null +++ b/packages/client-rust/src/models/metadata.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Metadata : Serializer for blueprint metadata +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Metadata { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "labels")] + pub labels: std::collections::HashMap, +} + +impl Metadata { + /// Serializer for blueprint metadata + pub fn new( + name: String, + labels: std::collections::HashMap, + ) -> Metadata { + Metadata { name, labels } + } +} diff --git a/packages/client-rust/src/models/microsoft_entra_provider.rs b/packages/client-rust/src/models/microsoft_entra_provider.rs new file mode 100644 index 0000000000..84c8f0ff87 --- /dev/null +++ b/packages/client-rust/src/models/microsoft_entra_provider.rs @@ -0,0 +1,126 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// MicrosoftEntraProvider : MicrosoftEntraProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MicrosoftEntraProvider { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Property mappings used for group creation/updating. + #[serde( + rename = "property_mappings_group", + skip_serializing_if = "Option::is_none" + )] + pub property_mappings_group: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_backchannel_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_backchannel_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_name: Option, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "client_id")] + pub client_id: String, + #[serde(rename = "client_secret")] + pub client_secret: String, + #[serde(rename = "tenant_id")] + pub tenant_id: String, + #[serde( + rename = "exclude_users_service_account", + skip_serializing_if = "Option::is_none" + )] + pub exclude_users_service_account: Option, + #[serde( + rename = "filter_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub filter_group: Option>, + #[serde(rename = "user_delete_action", skip_serializing_if = "Option::is_none")] + pub user_delete_action: Option, + #[serde( + rename = "group_delete_action", + skip_serializing_if = "Option::is_none" + )] + pub group_delete_action: Option, + /// Controls the number of objects synced in a single task + #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] + pub sync_page_size: Option, + /// Timeout for synchronization of a single page + #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] + pub sync_page_timeout: Option, + /// When enabled, provider will not modify or create objects in the remote system. + #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] + pub dry_run: Option, +} + +impl MicrosoftEntraProvider { + /// MicrosoftEntraProvider Serializer + pub fn new( + pk: i32, + name: String, + component: String, + assigned_backchannel_application_slug: Option, + assigned_backchannel_application_name: Option, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + client_id: String, + client_secret: String, + tenant_id: String, + ) -> MicrosoftEntraProvider { + MicrosoftEntraProvider { + pk, + name, + property_mappings: None, + property_mappings_group: None, + component, + assigned_backchannel_application_slug, + assigned_backchannel_application_name, + verbose_name, + verbose_name_plural, + meta_model_name, + client_id, + client_secret, + tenant_id, + exclude_users_service_account: None, + filter_group: None, + user_delete_action: None, + group_delete_action: None, + sync_page_size: None, + sync_page_timeout: None, + dry_run: None, + } + } +} diff --git a/packages/client-rust/src/models/microsoft_entra_provider_group.rs b/packages/client-rust/src/models/microsoft_entra_provider_group.rs new file mode 100644 index 0000000000..d2c165c422 --- /dev/null +++ b/packages/client-rust/src/models/microsoft_entra_provider_group.rs @@ -0,0 +1,49 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// MicrosoftEntraProviderGroup : MicrosoftEntraProviderGroup Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MicrosoftEntraProviderGroup { + #[serde(rename = "id")] + pub id: uuid::Uuid, + #[serde(rename = "microsoft_id")] + pub microsoft_id: String, + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "group_obj")] + pub group_obj: models::PartialGroup, + #[serde(rename = "provider")] + pub provider: i32, + #[serde(rename = "attributes")] + pub attributes: std::collections::HashMap, +} + +impl MicrosoftEntraProviderGroup { + /// MicrosoftEntraProviderGroup Serializer + pub fn new( + id: uuid::Uuid, + microsoft_id: String, + group: uuid::Uuid, + group_obj: models::PartialGroup, + provider: i32, + attributes: std::collections::HashMap, + ) -> MicrosoftEntraProviderGroup { + MicrosoftEntraProviderGroup { + id, + microsoft_id, + group, + group_obj, + provider, + attributes, + } + } +} diff --git a/packages/client-rust/src/models/microsoft_entra_provider_group_request.rs b/packages/client-rust/src/models/microsoft_entra_provider_group_request.rs new file mode 100644 index 0000000000..e84b62292a --- /dev/null +++ b/packages/client-rust/src/models/microsoft_entra_provider_group_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// MicrosoftEntraProviderGroupRequest : MicrosoftEntraProviderGroup Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MicrosoftEntraProviderGroupRequest { + #[serde(rename = "microsoft_id")] + pub microsoft_id: String, + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "provider")] + pub provider: i32, +} + +impl MicrosoftEntraProviderGroupRequest { + /// MicrosoftEntraProviderGroup Serializer + pub fn new( + microsoft_id: String, + group: uuid::Uuid, + provider: i32, + ) -> MicrosoftEntraProviderGroupRequest { + MicrosoftEntraProviderGroupRequest { + microsoft_id, + group, + provider, + } + } +} diff --git a/packages/client-rust/src/models/microsoft_entra_provider_mapping.rs b/packages/client-rust/src/models/microsoft_entra_provider_mapping.rs new file mode 100644 index 0000000000..6bd7b61ac7 --- /dev/null +++ b/packages/client-rust/src/models/microsoft_entra_provider_mapping.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// MicrosoftEntraProviderMapping : MicrosoftEntraProviderMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MicrosoftEntraProviderMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + /// Get object's component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl MicrosoftEntraProviderMapping { + /// MicrosoftEntraProviderMapping Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + expression: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> MicrosoftEntraProviderMapping { + MicrosoftEntraProviderMapping { + pk, + managed: None, + name, + expression, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/microsoft_entra_provider_mapping_request.rs b/packages/client-rust/src/models/microsoft_entra_provider_mapping_request.rs new file mode 100644 index 0000000000..ab95ade8fb --- /dev/null +++ b/packages/client-rust/src/models/microsoft_entra_provider_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// MicrosoftEntraProviderMappingRequest : MicrosoftEntraProviderMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MicrosoftEntraProviderMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, +} + +impl MicrosoftEntraProviderMappingRequest { + /// MicrosoftEntraProviderMapping Serializer + pub fn new(name: String, expression: String) -> MicrosoftEntraProviderMappingRequest { + MicrosoftEntraProviderMappingRequest { + managed: None, + name, + expression, + } + } +} diff --git a/packages/client-rust/src/models/microsoft_entra_provider_request.rs b/packages/client-rust/src/models/microsoft_entra_provider_request.rs new file mode 100644 index 0000000000..6c3b8007bc --- /dev/null +++ b/packages/client-rust/src/models/microsoft_entra_provider_request.rs @@ -0,0 +1,86 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// MicrosoftEntraProviderRequest : MicrosoftEntraProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MicrosoftEntraProviderRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Property mappings used for group creation/updating. + #[serde( + rename = "property_mappings_group", + skip_serializing_if = "Option::is_none" + )] + pub property_mappings_group: Option>, + #[serde(rename = "client_id")] + pub client_id: String, + #[serde(rename = "client_secret")] + pub client_secret: String, + #[serde(rename = "tenant_id")] + pub tenant_id: String, + #[serde( + rename = "exclude_users_service_account", + skip_serializing_if = "Option::is_none" + )] + pub exclude_users_service_account: Option, + #[serde( + rename = "filter_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub filter_group: Option>, + #[serde(rename = "user_delete_action", skip_serializing_if = "Option::is_none")] + pub user_delete_action: Option, + #[serde( + rename = "group_delete_action", + skip_serializing_if = "Option::is_none" + )] + pub group_delete_action: Option, + /// Controls the number of objects synced in a single task + #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] + pub sync_page_size: Option, + /// Timeout for synchronization of a single page + #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] + pub sync_page_timeout: Option, + /// When enabled, provider will not modify or create objects in the remote system. + #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] + pub dry_run: Option, +} + +impl MicrosoftEntraProviderRequest { + /// MicrosoftEntraProvider Serializer + pub fn new( + name: String, + client_id: String, + client_secret: String, + tenant_id: String, + ) -> MicrosoftEntraProviderRequest { + MicrosoftEntraProviderRequest { + name, + property_mappings: None, + property_mappings_group: None, + client_id, + client_secret, + tenant_id, + exclude_users_service_account: None, + filter_group: None, + user_delete_action: None, + group_delete_action: None, + sync_page_size: None, + sync_page_timeout: None, + dry_run: None, + } + } +} diff --git a/packages/client-rust/src/models/microsoft_entra_provider_user.rs b/packages/client-rust/src/models/microsoft_entra_provider_user.rs new file mode 100644 index 0000000000..64fc42f5e8 --- /dev/null +++ b/packages/client-rust/src/models/microsoft_entra_provider_user.rs @@ -0,0 +1,49 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// MicrosoftEntraProviderUser : MicrosoftEntraProviderUser Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MicrosoftEntraProviderUser { + #[serde(rename = "id")] + pub id: uuid::Uuid, + #[serde(rename = "microsoft_id")] + pub microsoft_id: String, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "user_obj")] + pub user_obj: models::PartialUser, + #[serde(rename = "provider")] + pub provider: i32, + #[serde(rename = "attributes")] + pub attributes: std::collections::HashMap, +} + +impl MicrosoftEntraProviderUser { + /// MicrosoftEntraProviderUser Serializer + pub fn new( + id: uuid::Uuid, + microsoft_id: String, + user: i32, + user_obj: models::PartialUser, + provider: i32, + attributes: std::collections::HashMap, + ) -> MicrosoftEntraProviderUser { + MicrosoftEntraProviderUser { + id, + microsoft_id, + user, + user_obj, + provider, + attributes, + } + } +} diff --git a/packages/client-rust/src/models/microsoft_entra_provider_user_request.rs b/packages/client-rust/src/models/microsoft_entra_provider_user_request.rs new file mode 100644 index 0000000000..2d7583643a --- /dev/null +++ b/packages/client-rust/src/models/microsoft_entra_provider_user_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// MicrosoftEntraProviderUserRequest : MicrosoftEntraProviderUser Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MicrosoftEntraProviderUserRequest { + #[serde(rename = "microsoft_id")] + pub microsoft_id: String, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "provider")] + pub provider: i32, +} + +impl MicrosoftEntraProviderUserRequest { + /// MicrosoftEntraProviderUser Serializer + pub fn new( + microsoft_id: String, + user: i32, + provider: i32, + ) -> MicrosoftEntraProviderUserRequest { + MicrosoftEntraProviderUserRequest { + microsoft_id, + user, + provider, + } + } +} diff --git a/packages/client-rust/src/models/mod.rs b/packages/client-rust/src/models/mod.rs new file mode 100644 index 0000000000..a1b2e42a72 --- /dev/null +++ b/packages/client-rust/src/models/mod.rs @@ -0,0 +1,1728 @@ +pub mod access_denied_challenge; +pub use self::access_denied_challenge::AccessDeniedChallenge; +pub mod agent_authentication_response; +pub use self::agent_authentication_response::AgentAuthenticationResponse; +pub mod agent_config; +pub use self::agent_config::AgentConfig; +pub mod agent_connector; +pub use self::agent_connector::AgentConnector; +pub mod agent_connector_request; +pub use self::agent_connector_request::AgentConnectorRequest; +pub mod agent_psso_device_registration_request; +pub use self::agent_psso_device_registration_request::AgentPssoDeviceRegistrationRequest; +pub mod agent_psso_device_registration_response; +pub use self::agent_psso_device_registration_response::AgentPssoDeviceRegistrationResponse; +pub mod agent_psso_user_registration_request; +pub use self::agent_psso_user_registration_request::AgentPssoUserRegistrationRequest; +pub mod agent_token_response; +pub use self::agent_token_response::AgentTokenResponse; +pub mod alg_enum; +pub use self::alg_enum::AlgEnum; +pub mod app; +pub use self::app::App; +pub mod app_enum; +pub use self::app_enum::AppEnum; +pub mod apple_challenge_response_request; +pub use self::apple_challenge_response_request::AppleChallengeResponseRequest; +pub mod apple_login_challenge; +pub use self::apple_login_challenge::AppleLoginChallenge; +pub mod application; +pub use self::application::Application; +pub mod application_entitlement; +pub use self::application_entitlement::ApplicationEntitlement; +pub mod application_entitlement_request; +pub use self::application_entitlement_request::ApplicationEntitlementRequest; +pub mod application_request; +pub use self::application_request::ApplicationRequest; +pub mod auth_type_enum; +pub use self::auth_type_enum::AuthTypeEnum; +pub mod authenticated_session; +pub use self::authenticated_session::AuthenticatedSession; +pub mod authenticated_session_asn; +pub use self::authenticated_session_asn::AuthenticatedSessionAsn; +pub mod authenticated_session_geo_ip; +pub use self::authenticated_session_geo_ip::AuthenticatedSessionGeoIp; +pub mod authenticated_session_user_agent; +pub use self::authenticated_session_user_agent::AuthenticatedSessionUserAgent; +pub mod authenticated_session_user_agent_device; +pub use self::authenticated_session_user_agent_device::AuthenticatedSessionUserAgentDevice; +pub mod authenticated_session_user_agent_os; +pub use self::authenticated_session_user_agent_os::AuthenticatedSessionUserAgentOs; +pub mod authenticated_session_user_agent_user_agent; +pub use self::authenticated_session_user_agent_user_agent::AuthenticatedSessionUserAgentUserAgent; +pub mod authentication_enum; +pub use self::authentication_enum::AuthenticationEnum; +pub mod authenticator_attachment_enum; +pub use self::authenticator_attachment_enum::AuthenticatorAttachmentEnum; +pub mod authenticator_duo_challenge; +pub use self::authenticator_duo_challenge::AuthenticatorDuoChallenge; +pub mod authenticator_duo_challenge_response_request; +pub use self::authenticator_duo_challenge_response_request::AuthenticatorDuoChallengeResponseRequest; +pub mod authenticator_duo_stage; +pub use self::authenticator_duo_stage::AuthenticatorDuoStage; +pub mod authenticator_duo_stage_device_import_response; +pub use self::authenticator_duo_stage_device_import_response::AuthenticatorDuoStageDeviceImportResponse; +pub mod authenticator_duo_stage_manual_device_import_request; +pub use self::authenticator_duo_stage_manual_device_import_request::AuthenticatorDuoStageManualDeviceImportRequest; +pub mod authenticator_duo_stage_request; +pub use self::authenticator_duo_stage_request::AuthenticatorDuoStageRequest; +pub mod authenticator_email_challenge; +pub use self::authenticator_email_challenge::AuthenticatorEmailChallenge; +pub mod authenticator_email_challenge_response_request; +pub use self::authenticator_email_challenge_response_request::AuthenticatorEmailChallengeResponseRequest; +pub mod authenticator_email_stage; +pub use self::authenticator_email_stage::AuthenticatorEmailStage; +pub mod authenticator_email_stage_request; +pub use self::authenticator_email_stage_request::AuthenticatorEmailStageRequest; +pub mod authenticator_endpoint_gdtc_stage; +pub use self::authenticator_endpoint_gdtc_stage::AuthenticatorEndpointGdtcStage; +pub mod authenticator_endpoint_gdtc_stage_request; +pub use self::authenticator_endpoint_gdtc_stage_request::AuthenticatorEndpointGdtcStageRequest; +pub mod authenticator_sms_challenge; +pub use self::authenticator_sms_challenge::AuthenticatorSmsChallenge; +pub mod authenticator_sms_challenge_response_request; +pub use self::authenticator_sms_challenge_response_request::AuthenticatorSmsChallengeResponseRequest; +pub mod authenticator_sms_stage; +pub use self::authenticator_sms_stage::AuthenticatorSmsStage; +pub mod authenticator_sms_stage_request; +pub use self::authenticator_sms_stage_request::AuthenticatorSmsStageRequest; +pub mod authenticator_static_challenge; +pub use self::authenticator_static_challenge::AuthenticatorStaticChallenge; +pub mod authenticator_static_challenge_response_request; +pub use self::authenticator_static_challenge_response_request::AuthenticatorStaticChallengeResponseRequest; +pub mod authenticator_static_stage; +pub use self::authenticator_static_stage::AuthenticatorStaticStage; +pub mod authenticator_static_stage_request; +pub use self::authenticator_static_stage_request::AuthenticatorStaticStageRequest; +pub mod authenticator_totp_challenge; +pub use self::authenticator_totp_challenge::AuthenticatorTotpChallenge; +pub mod authenticator_totp_challenge_response_request; +pub use self::authenticator_totp_challenge_response_request::AuthenticatorTotpChallengeResponseRequest; +pub mod authenticator_totp_stage; +pub use self::authenticator_totp_stage::AuthenticatorTotpStage; +pub mod authenticator_totp_stage_request; +pub use self::authenticator_totp_stage_request::AuthenticatorTotpStageRequest; +pub mod authenticator_validate_stage; +pub use self::authenticator_validate_stage::AuthenticatorValidateStage; +pub mod authenticator_validate_stage_request; +pub use self::authenticator_validate_stage_request::AuthenticatorValidateStageRequest; +pub mod authenticator_validation_challenge; +pub use self::authenticator_validation_challenge::AuthenticatorValidationChallenge; +pub mod authenticator_validation_challenge_response_request; +pub use self::authenticator_validation_challenge_response_request::AuthenticatorValidationChallengeResponseRequest; +pub mod authenticator_web_authn_challenge; +pub use self::authenticator_web_authn_challenge::AuthenticatorWebAuthnChallenge; +pub mod authenticator_web_authn_challenge_response_request; +pub use self::authenticator_web_authn_challenge_response_request::AuthenticatorWebAuthnChallengeResponseRequest; +pub mod authenticator_web_authn_stage; +pub use self::authenticator_web_authn_stage::AuthenticatorWebAuthnStage; +pub mod authenticator_web_authn_stage_request; +pub use self::authenticator_web_authn_stage_request::AuthenticatorWebAuthnStageRequest; +pub mod authorization_code_auth_method_enum; +pub use self::authorization_code_auth_method_enum::AuthorizationCodeAuthMethodEnum; +pub mod auto_submit_challenge_response_request; +pub use self::auto_submit_challenge_response_request::AutoSubmitChallengeResponseRequest; +pub mod autosubmit_challenge; +pub use self::autosubmit_challenge::AutosubmitChallenge; +pub mod backends_enum; +pub use self::backends_enum::BackendsEnum; +pub mod binding_type_enum; +pub use self::binding_type_enum::BindingTypeEnum; +pub mod blueprint_file; +pub use self::blueprint_file::BlueprintFile; +pub mod blueprint_instance; +pub use self::blueprint_instance::BlueprintInstance; +pub mod blueprint_instance_request; +pub use self::blueprint_instance_request::BlueprintInstanceRequest; +pub mod blueprint_instance_status_enum; +pub use self::blueprint_instance_status_enum::BlueprintInstanceStatusEnum; +pub mod brand; +pub use self::brand::Brand; +pub mod brand_request; +pub use self::brand_request::BrandRequest; +pub mod bulk_delete_session_response; +pub use self::bulk_delete_session_response::BulkDeleteSessionResponse; +pub mod cache; +pub use self::cache::Cache; +pub mod capabilities_enum; +pub use self::capabilities_enum::CapabilitiesEnum; +pub mod captcha_challenge; +pub use self::captcha_challenge::CaptchaChallenge; +pub mod captcha_challenge_response_request; +pub use self::captcha_challenge_response_request::CaptchaChallengeResponseRequest; +pub mod captcha_stage; +pub use self::captcha_stage::CaptchaStage; +pub mod captcha_stage_request; +pub use self::captcha_stage_request::CaptchaStageRequest; +pub mod cert_attribute_enum; +pub use self::cert_attribute_enum::CertAttributeEnum; +pub mod certificate_data; +pub use self::certificate_data::CertificateData; +pub mod certificate_generation_request; +pub use self::certificate_generation_request::CertificateGenerationRequest; +pub mod certificate_key_pair; +pub use self::certificate_key_pair::CertificateKeyPair; +pub mod certificate_key_pair_request; +pub use self::certificate_key_pair_request::CertificateKeyPairRequest; +pub mod challenge_types; +pub use self::challenge_types::ChallengeTypes; +pub mod client_type_enum; +pub use self::client_type_enum::ClientTypeEnum; +pub mod compatibility_mode_enum; +pub use self::compatibility_mode_enum::CompatibilityModeEnum; +pub mod config; +pub use self::config::Config; +pub mod connection_token; +pub use self::connection_token::ConnectionToken; +pub mod connection_token_request; +pub use self::connection_token_request::ConnectionTokenRequest; +pub mod connector; +pub use self::connector::Connector; +pub mod consent_challenge; +pub use self::consent_challenge::ConsentChallenge; +pub mod consent_challenge_response_request; +pub use self::consent_challenge_response_request::ConsentChallengeResponseRequest; +pub mod consent_permission; +pub use self::consent_permission::ConsentPermission; +pub mod consent_stage; +pub use self::consent_stage::ConsentStage; +pub mod consent_stage_mode_enum; +pub use self::consent_stage_mode_enum::ConsentStageModeEnum; +pub mod consent_stage_request; +pub use self::consent_stage_request::ConsentStageRequest; +pub mod content_type; +pub use self::content_type::ContentType; +pub mod content_type_enum; +pub use self::content_type_enum::ContentTypeEnum; +pub mod contextual_flow_info; +pub use self::contextual_flow_info::ContextualFlowInfo; +pub mod contextual_flow_info_layout_enum; +pub use self::contextual_flow_info_layout_enum::ContextualFlowInfoLayoutEnum; +pub mod country_code_enum; +pub use self::country_code_enum::CountryCodeEnum; +pub mod current_brand; +pub use self::current_brand::CurrentBrand; +pub mod current_brand_flags; +pub use self::current_brand_flags::CurrentBrandFlags; +pub mod data_export; +pub use self::data_export::DataExport; +pub mod delivery_method_enum; +pub use self::delivery_method_enum::DeliveryMethodEnum; +pub mod denied_action_enum; +pub use self::denied_action_enum::DeniedActionEnum; +pub mod deny_stage; +pub use self::deny_stage::DenyStage; +pub mod deny_stage_request; +pub use self::deny_stage_request::DenyStageRequest; +pub mod detailed_country; +pub use self::detailed_country::DetailedCountry; +pub mod device; +pub use self::device::Device; +pub mod device_access_group; +pub use self::device_access_group::DeviceAccessGroup; +pub mod device_access_group_request; +pub use self::device_access_group_request::DeviceAccessGroupRequest; +pub mod device_challenge; +pub use self::device_challenge::DeviceChallenge; +pub mod device_challenge_request; +pub use self::device_challenge_request::DeviceChallengeRequest; +pub mod device_classes_enum; +pub use self::device_classes_enum::DeviceClassesEnum; +pub mod device_connection; +pub use self::device_connection::DeviceConnection; +pub mod device_fact_snapshot; +pub use self::device_fact_snapshot::DeviceFactSnapshot; +pub mod device_facts; +pub use self::device_facts::DeviceFacts; +pub mod device_facts_os_family; +pub use self::device_facts_os_family::DeviceFactsOsFamily; +pub mod device_facts_request; +pub use self::device_facts_request::DeviceFactsRequest; +pub mod device_group; +pub use self::device_group::DeviceGroup; +pub mod device_group_request; +pub use self::device_group_request::DeviceGroupRequest; +pub mod device_summary; +pub use self::device_summary::DeviceSummary; +pub mod device_user; +pub use self::device_user::DeviceUser; +pub mod device_user_binding; +pub use self::device_user_binding::DeviceUserBinding; +pub mod device_user_binding_request; +pub use self::device_user_binding_request::DeviceUserBindingRequest; +pub mod device_user_request; +pub use self::device_user_request::DeviceUserRequest; +pub mod digest_algorithm_enum; +pub use self::digest_algorithm_enum::DigestAlgorithmEnum; +pub mod digits_enum; +pub use self::digits_enum::DigitsEnum; +pub mod disk; +pub use self::disk::Disk; +pub mod disk_request; +pub use self::disk_request::DiskRequest; +pub mod docker_service_connection; +pub use self::docker_service_connection::DockerServiceConnection; +pub mod docker_service_connection_request; +pub use self::docker_service_connection_request::DockerServiceConnectionRequest; +pub mod domain; +pub use self::domain::Domain; +pub mod domain_request; +pub use self::domain_request::DomainRequest; +pub mod dummy_challenge; +pub use self::dummy_challenge::DummyChallenge; +pub mod dummy_challenge_response_request; +pub use self::dummy_challenge_response_request::DummyChallengeResponseRequest; +pub mod dummy_policy; +pub use self::dummy_policy::DummyPolicy; +pub mod dummy_policy_request; +pub use self::dummy_policy_request::DummyPolicyRequest; +pub mod dummy_stage; +pub use self::dummy_stage::DummyStage; +pub mod dummy_stage_request; +pub use self::dummy_stage_request::DummyStageRequest; +pub mod duo_device; +pub use self::duo_device::DuoDevice; +pub mod duo_device_enrollment_status; +pub use self::duo_device_enrollment_status::DuoDeviceEnrollmentStatus; +pub mod duo_device_request; +pub use self::duo_device_request::DuoDeviceRequest; +pub mod duo_response_enum; +pub use self::duo_response_enum::DuoResponseEnum; +pub mod email_challenge; +pub use self::email_challenge::EmailChallenge; +pub mod email_challenge_response_request; +pub use self::email_challenge_response_request::EmailChallengeResponseRequest; +pub mod email_device; +pub use self::email_device::EmailDevice; +pub mod email_device_request; +pub use self::email_device_request::EmailDeviceRequest; +pub mod email_stage; +pub use self::email_stage::EmailStage; +pub mod email_stage_request; +pub use self::email_stage_request::EmailStageRequest; +pub mod endpoint; +pub use self::endpoint::Endpoint; +pub mod endpoint_agent_challenge; +pub use self::endpoint_agent_challenge::EndpointAgentChallenge; +pub mod endpoint_agent_challenge_response_request; +pub use self::endpoint_agent_challenge_response_request::EndpointAgentChallengeResponseRequest; +pub mod endpoint_auth_mode_enum; +pub use self::endpoint_auth_mode_enum::EndpointAuthModeEnum; +pub mod endpoint_device; +pub use self::endpoint_device::EndpointDevice; +pub mod endpoint_device_details; +pub use self::endpoint_device_details::EndpointDeviceDetails; +pub mod endpoint_device_request; +pub use self::endpoint_device_request::EndpointDeviceRequest; +pub mod endpoint_request; +pub use self::endpoint_request::EndpointRequest; +pub mod endpoint_stage; +pub use self::endpoint_stage::EndpointStage; +pub mod endpoint_stage_request; +pub use self::endpoint_stage_request::EndpointStageRequest; +pub mod enroll_request; +pub use self::enroll_request::EnrollRequest; +pub mod enrollment_token; +pub use self::enrollment_token::EnrollmentToken; +pub mod enrollment_token_request; +pub use self::enrollment_token_request::EnrollmentTokenRequest; +pub mod error_detail; +pub use self::error_detail::ErrorDetail; +pub mod error_reporting_config; +pub use self::error_reporting_config::ErrorReportingConfig; +pub mod event; +pub use self::event::Event; +pub mod event_actions; +pub use self::event_actions::EventActions; +pub mod event_matcher_policy; +pub use self::event_matcher_policy::EventMatcherPolicy; +pub mod event_matcher_policy_request; +pub use self::event_matcher_policy_request::EventMatcherPolicyRequest; +pub mod event_request; +pub use self::event_request::EventRequest; +pub mod event_top_per_user; +pub use self::event_top_per_user::EventTopPerUser; +pub mod event_volume; +pub use self::event_volume::EventVolume; +pub mod events_requested_enum; +pub use self::events_requested_enum::EventsRequestedEnum; +pub mod expiring_base_grant_model; +pub use self::expiring_base_grant_model::ExpiringBaseGrantModel; +pub mod expression_policy; +pub use self::expression_policy::ExpressionPolicy; +pub mod expression_policy_request; +pub use self::expression_policy_request::ExpressionPolicyRequest; +pub mod extra_role_object_permission; +pub use self::extra_role_object_permission::ExtraRoleObjectPermission; +pub mod file_list; +pub use self::file_list::FileList; +pub mod fleet_connector; +pub use self::fleet_connector::FleetConnector; +pub mod fleet_connector_request; +pub use self::fleet_connector_request::FleetConnectorRequest; +pub mod flow; +pub use self::flow::Flow; +pub mod flow_challenge_response_request; +pub use self::flow_challenge_response_request::FlowChallengeResponseRequest; +pub mod flow_designation_enum; +pub use self::flow_designation_enum::FlowDesignationEnum; +pub mod flow_diagram; +pub use self::flow_diagram::FlowDiagram; +pub mod flow_error_challenge; +pub use self::flow_error_challenge::FlowErrorChallenge; +pub mod flow_import_result; +pub use self::flow_import_result::FlowImportResult; +pub mod flow_inspection; +pub use self::flow_inspection::FlowInspection; +pub mod flow_inspector_plan; +pub use self::flow_inspector_plan::FlowInspectorPlan; +pub mod flow_layout_enum; +pub use self::flow_layout_enum::FlowLayoutEnum; +pub mod flow_request; +pub use self::flow_request::FlowRequest; +pub mod flow_set; +pub use self::flow_set::FlowSet; +pub mod flow_stage_binding; +pub use self::flow_stage_binding::FlowStageBinding; +pub mod flow_stage_binding_request; +pub use self::flow_stage_binding_request::FlowStageBindingRequest; +pub mod footer_link; +pub use self::footer_link::FooterLink; +pub mod frame_challenge; +pub use self::frame_challenge::FrameChallenge; +pub mod frame_challenge_response_request; +pub use self::frame_challenge_response_request::FrameChallengeResponseRequest; +pub mod generic_error; +pub use self::generic_error::GenericError; +pub mod geo_ip_policy; +pub use self::geo_ip_policy::GeoIpPolicy; +pub mod geo_ip_policy_countries_obj_inner; +pub use self::geo_ip_policy_countries_obj_inner::GeoIpPolicyCountriesObjInner; +pub mod geo_ip_policy_request; +pub use self::geo_ip_policy_request::GeoIpPolicyRequest; +pub mod geoip_binding_enum; +pub use self::geoip_binding_enum::GeoipBindingEnum; +pub mod global_task_status; +pub use self::global_task_status::GlobalTaskStatus; +pub mod google_chrome_connector; +pub use self::google_chrome_connector::GoogleChromeConnector; +pub mod google_chrome_connector_request; +pub use self::google_chrome_connector_request::GoogleChromeConnectorRequest; +pub mod google_endpoint_device; +pub use self::google_endpoint_device::GoogleEndpointDevice; +pub mod google_endpoint_device_request; +pub use self::google_endpoint_device_request::GoogleEndpointDeviceRequest; +pub mod google_workspace_provider; +pub use self::google_workspace_provider::GoogleWorkspaceProvider; +pub mod google_workspace_provider_group; +pub use self::google_workspace_provider_group::GoogleWorkspaceProviderGroup; +pub mod google_workspace_provider_group_request; +pub use self::google_workspace_provider_group_request::GoogleWorkspaceProviderGroupRequest; +pub mod google_workspace_provider_mapping; +pub use self::google_workspace_provider_mapping::GoogleWorkspaceProviderMapping; +pub mod google_workspace_provider_mapping_request; +pub use self::google_workspace_provider_mapping_request::GoogleWorkspaceProviderMappingRequest; +pub mod google_workspace_provider_request; +pub use self::google_workspace_provider_request::GoogleWorkspaceProviderRequest; +pub mod google_workspace_provider_user; +pub use self::google_workspace_provider_user::GoogleWorkspaceProviderUser; +pub mod google_workspace_provider_user_request; +pub use self::google_workspace_provider_user_request::GoogleWorkspaceProviderUserRequest; +pub mod group; +pub use self::group::Group; +pub mod group_kerberos_source_connection; +pub use self::group_kerberos_source_connection::GroupKerberosSourceConnection; +pub mod group_kerberos_source_connection_request; +pub use self::group_kerberos_source_connection_request::GroupKerberosSourceConnectionRequest; +pub mod group_ldap_source_connection; +pub use self::group_ldap_source_connection::GroupLdapSourceConnection; +pub mod group_ldap_source_connection_request; +pub use self::group_ldap_source_connection_request::GroupLdapSourceConnectionRequest; +pub mod group_matching_mode_enum; +pub use self::group_matching_mode_enum::GroupMatchingModeEnum; +pub mod group_o_auth_source_connection; +pub use self::group_o_auth_source_connection::GroupOAuthSourceConnection; +pub mod group_o_auth_source_connection_request; +pub use self::group_o_auth_source_connection_request::GroupOAuthSourceConnectionRequest; +pub mod group_plex_source_connection; +pub use self::group_plex_source_connection::GroupPlexSourceConnection; +pub mod group_plex_source_connection_request; +pub use self::group_plex_source_connection_request::GroupPlexSourceConnectionRequest; +pub mod group_request; +pub use self::group_request::GroupRequest; +pub mod group_saml_source_connection; +pub use self::group_saml_source_connection::GroupSamlSourceConnection; +pub mod group_saml_source_connection_request; +pub use self::group_saml_source_connection_request::GroupSamlSourceConnectionRequest; +pub mod group_source_connection; +pub use self::group_source_connection::GroupSourceConnection; +pub mod group_source_connection_request; +pub use self::group_source_connection_request::GroupSourceConnectionRequest; +pub mod group_telegram_source_connection; +pub use self::group_telegram_source_connection::GroupTelegramSourceConnection; +pub mod group_telegram_source_connection_request; +pub use self::group_telegram_source_connection_request::GroupTelegramSourceConnectionRequest; +pub mod hardware; +pub use self::hardware::Hardware; +pub mod hardware_request; +pub use self::hardware_request::HardwareRequest; +pub mod identification_challenge; +pub use self::identification_challenge::IdentificationChallenge; +pub mod identification_challenge_response_request; +pub use self::identification_challenge_response_request::IdentificationChallengeResponseRequest; +pub mod identification_stage; +pub use self::identification_stage::IdentificationStage; +pub mod identification_stage_request; +pub use self::identification_stage_request::IdentificationStageRequest; +pub mod iframe_logout_challenge; +pub use self::iframe_logout_challenge::IframeLogoutChallenge; +pub mod iframe_logout_challenge_response_request; +pub use self::iframe_logout_challenge_response_request::IframeLogoutChallengeResponseRequest; +pub mod impersonation_request; +pub use self::impersonation_request::ImpersonationRequest; +pub mod initial_permissions; +pub use self::initial_permissions::InitialPermissions; +pub mod initial_permissions_request; +pub use self::initial_permissions_request::InitialPermissionsRequest; +pub mod install_id; +pub use self::install_id::InstallId; +pub mod intent_enum; +pub use self::intent_enum::IntentEnum; +pub mod invalid_response_action_enum; +pub use self::invalid_response_action_enum::InvalidResponseActionEnum; +pub mod invitation; +pub use self::invitation::Invitation; +pub mod invitation_request; +pub use self::invitation_request::InvitationRequest; +pub mod invitation_send_email_request; +pub use self::invitation_send_email_request::InvitationSendEmailRequest; +pub mod invitation_stage; +pub use self::invitation_stage::InvitationStage; +pub mod invitation_stage_request; +pub use self::invitation_stage_request::InvitationStageRequest; +pub mod issuer_mode_enum; +pub use self::issuer_mode_enum::IssuerModeEnum; +pub mod kadmin_type_enum; +pub use self::kadmin_type_enum::KadminTypeEnum; +pub mod kerberos_source; +pub use self::kerberos_source::KerberosSource; +pub mod kerberos_source_property_mapping; +pub use self::kerberos_source_property_mapping::KerberosSourcePropertyMapping; +pub mod kerberos_source_property_mapping_request; +pub use self::kerberos_source_property_mapping_request::KerberosSourcePropertyMappingRequest; +pub mod kerberos_source_request; +pub use self::kerberos_source_request::KerberosSourceRequest; +pub mod key_type_enum; +pub use self::key_type_enum::KeyTypeEnum; +pub mod kubernetes_service_connection; +pub use self::kubernetes_service_connection::KubernetesServiceConnection; +pub mod kubernetes_service_connection_request; +pub use self::kubernetes_service_connection_request::KubernetesServiceConnectionRequest; +pub mod last_task_status_enum; +pub use self::last_task_status_enum::LastTaskStatusEnum; +pub mod ldap_check_access; +pub use self::ldap_check_access::LdapCheckAccess; +pub mod ldap_debug; +pub use self::ldap_debug::LdapDebug; +pub mod ldap_outpost_config; +pub use self::ldap_outpost_config::LdapOutpostConfig; +pub mod ldap_provider; +pub use self::ldap_provider::LdapProvider; +pub mod ldap_provider_request; +pub use self::ldap_provider_request::LdapProviderRequest; +pub mod ldap_source; +pub use self::ldap_source::LdapSource; +pub mod ldap_source_property_mapping; +pub use self::ldap_source_property_mapping::LdapSourcePropertyMapping; +pub mod ldap_source_property_mapping_request; +pub use self::ldap_source_property_mapping_request::LdapSourcePropertyMappingRequest; +pub mod ldap_source_request; +pub use self::ldap_source_request::LdapSourceRequest; +pub mod ldapapi_access_mode; +pub use self::ldapapi_access_mode::LdapapiAccessMode; +pub mod license; +pub use self::license::License; +pub mod license_flags_enum; +pub use self::license_flags_enum::LicenseFlagsEnum; +pub mod license_forecast; +pub use self::license_forecast::LicenseForecast; +pub mod license_request; +pub use self::license_request::LicenseRequest; +pub mod license_status_enum; +pub use self::license_status_enum::LicenseStatusEnum; +pub mod license_summary; +pub use self::license_summary::LicenseSummary; +pub mod license_summary_status_enum; +pub use self::license_summary_status_enum::LicenseSummaryStatusEnum; +pub mod lifecycle_iteration; +pub use self::lifecycle_iteration::LifecycleIteration; +pub mod lifecycle_iteration_request; +pub use self::lifecycle_iteration_request::LifecycleIterationRequest; +pub mod lifecycle_iteration_state_enum; +pub use self::lifecycle_iteration_state_enum::LifecycleIterationStateEnum; +pub mod lifecycle_rule; +pub use self::lifecycle_rule::LifecycleRule; +pub mod lifecycle_rule_request; +pub use self::lifecycle_rule_request::LifecycleRuleRequest; +pub mod link; +pub use self::link::Link; +pub mod log_event; +pub use self::log_event::LogEvent; +pub mod log_level_enum; +pub use self::log_level_enum::LogLevelEnum; +pub mod login_challenge_types; +pub use self::login_challenge_types::LoginChallengeTypes; +pub mod login_source; +pub use self::login_source::LoginSource; +pub mod logout_url; +pub use self::logout_url::LogoutUrl; +pub mod matching_mode_enum; +pub use self::matching_mode_enum::MatchingModeEnum; +pub mod mdm_config_request; +pub use self::mdm_config_request::MdmConfigRequest; +pub mod mdm_config_response; +pub use self::mdm_config_response::MdmConfigResponse; +pub mod metadata; +pub use self::metadata::Metadata; +pub mod microsoft_entra_provider; +pub use self::microsoft_entra_provider::MicrosoftEntraProvider; +pub mod microsoft_entra_provider_group; +pub use self::microsoft_entra_provider_group::MicrosoftEntraProviderGroup; +pub mod microsoft_entra_provider_group_request; +pub use self::microsoft_entra_provider_group_request::MicrosoftEntraProviderGroupRequest; +pub mod microsoft_entra_provider_mapping; +pub use self::microsoft_entra_provider_mapping::MicrosoftEntraProviderMapping; +pub mod microsoft_entra_provider_mapping_request; +pub use self::microsoft_entra_provider_mapping_request::MicrosoftEntraProviderMappingRequest; +pub mod microsoft_entra_provider_request; +pub use self::microsoft_entra_provider_request::MicrosoftEntraProviderRequest; +pub mod microsoft_entra_provider_user; +pub use self::microsoft_entra_provider_user::MicrosoftEntraProviderUser; +pub mod microsoft_entra_provider_user_request; +pub use self::microsoft_entra_provider_user_request::MicrosoftEntraProviderUserRequest; +pub mod model_enum; +pub use self::model_enum::ModelEnum; +pub mod model_request; +pub use self::model_request::ModelRequest; +pub mod mutual_tls_stage; +pub use self::mutual_tls_stage::MutualTlsStage; +pub mod mutual_tls_stage_request; +pub use self::mutual_tls_stage_request::MutualTlsStageRequest; +pub mod native_logout_challenge; +pub use self::native_logout_challenge::NativeLogoutChallenge; +pub mod native_logout_challenge_response_request; +pub use self::native_logout_challenge_response_request::NativeLogoutChallengeResponseRequest; +pub mod network; +pub use self::network::Network; +pub mod network_binding_enum; +pub use self::network_binding_enum::NetworkBindingEnum; +pub mod network_interface; +pub use self::network_interface::NetworkInterface; +pub mod network_interface_request; +pub use self::network_interface_request::NetworkInterfaceRequest; +pub mod network_request; +pub use self::network_request::NetworkRequest; +pub mod not_configured_action_enum; +pub use self::not_configured_action_enum::NotConfiguredActionEnum; +pub mod notification; +pub use self::notification::Notification; +pub mod notification_request; +pub use self::notification_request::NotificationRequest; +pub mod notification_rule; +pub use self::notification_rule::NotificationRule; +pub mod notification_rule_request; +pub use self::notification_rule_request::NotificationRuleRequest; +pub mod notification_transport; +pub use self::notification_transport::NotificationTransport; +pub mod notification_transport_mode_enum; +pub use self::notification_transport_mode_enum::NotificationTransportModeEnum; +pub mod notification_transport_request; +pub use self::notification_transport_request::NotificationTransportRequest; +pub mod notification_transport_test; +pub use self::notification_transport_test::NotificationTransportTest; +pub mod notification_webhook_mapping; +pub use self::notification_webhook_mapping::NotificationWebhookMapping; +pub mod notification_webhook_mapping_request; +pub use self::notification_webhook_mapping_request::NotificationWebhookMappingRequest; +pub mod o_auth2_provider; +pub use self::o_auth2_provider::OAuth2Provider; +pub mod o_auth2_provider_logout_method_enum; +pub use self::o_auth2_provider_logout_method_enum::OAuth2ProviderLogoutMethodEnum; +pub mod o_auth2_provider_request; +pub use self::o_auth2_provider_request::OAuth2ProviderRequest; +pub mod o_auth2_provider_setup_urls; +pub use self::o_auth2_provider_setup_urls::OAuth2ProviderSetupUrls; +pub mod o_auth_device_code_challenge; +pub use self::o_auth_device_code_challenge::OAuthDeviceCodeChallenge; +pub mod o_auth_device_code_challenge_response_request; +pub use self::o_auth_device_code_challenge_response_request::OAuthDeviceCodeChallengeResponseRequest; +pub mod o_auth_device_code_finish_challenge; +pub use self::o_auth_device_code_finish_challenge::OAuthDeviceCodeFinishChallenge; +pub mod o_auth_device_code_finish_challenge_response_request; +pub use self::o_auth_device_code_finish_challenge_response_request::OAuthDeviceCodeFinishChallengeResponseRequest; +pub mod o_auth_source; +pub use self::o_auth_source::OAuthSource; +pub mod o_auth_source_property_mapping; +pub use self::o_auth_source_property_mapping::OAuthSourcePropertyMapping; +pub mod o_auth_source_property_mapping_request; +pub use self::o_auth_source_property_mapping_request::OAuthSourcePropertyMappingRequest; +pub mod o_auth_source_request; +pub use self::o_auth_source_request::OAuthSourceRequest; +pub mod open_id_connect_configuration; +pub use self::open_id_connect_configuration::OpenIdConnectConfiguration; +pub mod operating_system; +pub use self::operating_system::OperatingSystem; +pub mod operating_system_request; +pub use self::operating_system_request::OperatingSystemRequest; +pub mod outgoing_sync_delete_action; +pub use self::outgoing_sync_delete_action::OutgoingSyncDeleteAction; +pub mod outpost; +pub use self::outpost::Outpost; +pub mod outpost_default_config; +pub use self::outpost_default_config::OutpostDefaultConfig; +pub mod outpost_health; +pub use self::outpost_health::OutpostHealth; +pub mod outpost_request; +pub use self::outpost_request::OutpostRequest; +pub mod outpost_type_enum; +pub use self::outpost_type_enum::OutpostTypeEnum; +pub mod paginated_agent_connector_list; +pub use self::paginated_agent_connector_list::PaginatedAgentConnectorList; +pub mod paginated_application_entitlement_list; +pub use self::paginated_application_entitlement_list::PaginatedApplicationEntitlementList; +pub mod paginated_application_list; +pub use self::paginated_application_list::PaginatedApplicationList; +pub mod paginated_authenticated_session_list; +pub use self::paginated_authenticated_session_list::PaginatedAuthenticatedSessionList; +pub mod paginated_authenticator_duo_stage_list; +pub use self::paginated_authenticator_duo_stage_list::PaginatedAuthenticatorDuoStageList; +pub mod paginated_authenticator_email_stage_list; +pub use self::paginated_authenticator_email_stage_list::PaginatedAuthenticatorEmailStageList; +pub mod paginated_authenticator_endpoint_gdtc_stage_list; +pub use self::paginated_authenticator_endpoint_gdtc_stage_list::PaginatedAuthenticatorEndpointGdtcStageList; +pub mod paginated_authenticator_sms_stage_list; +pub use self::paginated_authenticator_sms_stage_list::PaginatedAuthenticatorSmsStageList; +pub mod paginated_authenticator_static_stage_list; +pub use self::paginated_authenticator_static_stage_list::PaginatedAuthenticatorStaticStageList; +pub mod paginated_authenticator_totp_stage_list; +pub use self::paginated_authenticator_totp_stage_list::PaginatedAuthenticatorTotpStageList; +pub mod paginated_authenticator_validate_stage_list; +pub use self::paginated_authenticator_validate_stage_list::PaginatedAuthenticatorValidateStageList; +pub mod paginated_authenticator_web_authn_stage_list; +pub use self::paginated_authenticator_web_authn_stage_list::PaginatedAuthenticatorWebAuthnStageList; +pub mod paginated_blueprint_instance_list; +pub use self::paginated_blueprint_instance_list::PaginatedBlueprintInstanceList; +pub mod paginated_brand_list; +pub use self::paginated_brand_list::PaginatedBrandList; +pub mod paginated_captcha_stage_list; +pub use self::paginated_captcha_stage_list::PaginatedCaptchaStageList; +pub mod paginated_certificate_key_pair_list; +pub use self::paginated_certificate_key_pair_list::PaginatedCertificateKeyPairList; +pub mod paginated_connection_token_list; +pub use self::paginated_connection_token_list::PaginatedConnectionTokenList; +pub mod paginated_connector_list; +pub use self::paginated_connector_list::PaginatedConnectorList; +pub mod paginated_consent_stage_list; +pub use self::paginated_consent_stage_list::PaginatedConsentStageList; +pub mod paginated_data_export_list; +pub use self::paginated_data_export_list::PaginatedDataExportList; +pub mod paginated_deny_stage_list; +pub use self::paginated_deny_stage_list::PaginatedDenyStageList; +pub mod paginated_device_access_group_list; +pub use self::paginated_device_access_group_list::PaginatedDeviceAccessGroupList; +pub mod paginated_device_user_binding_list; +pub use self::paginated_device_user_binding_list::PaginatedDeviceUserBindingList; +pub mod paginated_docker_service_connection_list; +pub use self::paginated_docker_service_connection_list::PaginatedDockerServiceConnectionList; +pub mod paginated_domain_list; +pub use self::paginated_domain_list::PaginatedDomainList; +pub mod paginated_dummy_policy_list; +pub use self::paginated_dummy_policy_list::PaginatedDummyPolicyList; +pub mod paginated_dummy_stage_list; +pub use self::paginated_dummy_stage_list::PaginatedDummyStageList; +pub mod paginated_duo_device_list; +pub use self::paginated_duo_device_list::PaginatedDuoDeviceList; +pub mod paginated_email_device_list; +pub use self::paginated_email_device_list::PaginatedEmailDeviceList; +pub mod paginated_email_stage_list; +pub use self::paginated_email_stage_list::PaginatedEmailStageList; +pub mod paginated_endpoint_device_list; +pub use self::paginated_endpoint_device_list::PaginatedEndpointDeviceList; +pub mod paginated_endpoint_list; +pub use self::paginated_endpoint_list::PaginatedEndpointList; +pub mod paginated_endpoint_stage_list; +pub use self::paginated_endpoint_stage_list::PaginatedEndpointStageList; +pub mod paginated_enrollment_token_list; +pub use self::paginated_enrollment_token_list::PaginatedEnrollmentTokenList; +pub mod paginated_event_list; +pub use self::paginated_event_list::PaginatedEventList; +pub mod paginated_event_matcher_policy_list; +pub use self::paginated_event_matcher_policy_list::PaginatedEventMatcherPolicyList; +pub mod paginated_expiring_base_grant_model_list; +pub use self::paginated_expiring_base_grant_model_list::PaginatedExpiringBaseGrantModelList; +pub mod paginated_expression_policy_list; +pub use self::paginated_expression_policy_list::PaginatedExpressionPolicyList; +pub mod paginated_extra_role_object_permission_list; +pub use self::paginated_extra_role_object_permission_list::PaginatedExtraRoleObjectPermissionList; +pub mod paginated_fleet_connector_list; +pub use self::paginated_fleet_connector_list::PaginatedFleetConnectorList; +pub mod paginated_flow_list; +pub use self::paginated_flow_list::PaginatedFlowList; +pub mod paginated_flow_stage_binding_list; +pub use self::paginated_flow_stage_binding_list::PaginatedFlowStageBindingList; +pub mod paginated_geo_ip_policy_list; +pub use self::paginated_geo_ip_policy_list::PaginatedGeoIpPolicyList; +pub mod paginated_google_chrome_connector_list; +pub use self::paginated_google_chrome_connector_list::PaginatedGoogleChromeConnectorList; +pub mod paginated_google_endpoint_device_list; +pub use self::paginated_google_endpoint_device_list::PaginatedGoogleEndpointDeviceList; +pub mod paginated_google_workspace_provider_group_list; +pub use self::paginated_google_workspace_provider_group_list::PaginatedGoogleWorkspaceProviderGroupList; +pub mod paginated_google_workspace_provider_list; +pub use self::paginated_google_workspace_provider_list::PaginatedGoogleWorkspaceProviderList; +pub mod paginated_google_workspace_provider_mapping_list; +pub use self::paginated_google_workspace_provider_mapping_list::PaginatedGoogleWorkspaceProviderMappingList; +pub mod paginated_google_workspace_provider_user_list; +pub use self::paginated_google_workspace_provider_user_list::PaginatedGoogleWorkspaceProviderUserList; +pub mod paginated_group_kerberos_source_connection_list; +pub use self::paginated_group_kerberos_source_connection_list::PaginatedGroupKerberosSourceConnectionList; +pub mod paginated_group_ldap_source_connection_list; +pub use self::paginated_group_ldap_source_connection_list::PaginatedGroupLdapSourceConnectionList; +pub mod paginated_group_list; +pub use self::paginated_group_list::PaginatedGroupList; +pub mod paginated_group_o_auth_source_connection_list; +pub use self::paginated_group_o_auth_source_connection_list::PaginatedGroupOAuthSourceConnectionList; +pub mod paginated_group_plex_source_connection_list; +pub use self::paginated_group_plex_source_connection_list::PaginatedGroupPlexSourceConnectionList; +pub mod paginated_group_saml_source_connection_list; +pub use self::paginated_group_saml_source_connection_list::PaginatedGroupSamlSourceConnectionList; +pub mod paginated_group_source_connection_list; +pub use self::paginated_group_source_connection_list::PaginatedGroupSourceConnectionList; +pub mod paginated_group_telegram_source_connection_list; +pub use self::paginated_group_telegram_source_connection_list::PaginatedGroupTelegramSourceConnectionList; +pub mod paginated_identification_stage_list; +pub use self::paginated_identification_stage_list::PaginatedIdentificationStageList; +pub mod paginated_initial_permissions_list; +pub use self::paginated_initial_permissions_list::PaginatedInitialPermissionsList; +pub mod paginated_invitation_list; +pub use self::paginated_invitation_list::PaginatedInvitationList; +pub mod paginated_invitation_stage_list; +pub use self::paginated_invitation_stage_list::PaginatedInvitationStageList; +pub mod paginated_kerberos_source_list; +pub use self::paginated_kerberos_source_list::PaginatedKerberosSourceList; +pub mod paginated_kerberos_source_property_mapping_list; +pub use self::paginated_kerberos_source_property_mapping_list::PaginatedKerberosSourcePropertyMappingList; +pub mod paginated_kubernetes_service_connection_list; +pub use self::paginated_kubernetes_service_connection_list::PaginatedKubernetesServiceConnectionList; +pub mod paginated_ldap_outpost_config_list; +pub use self::paginated_ldap_outpost_config_list::PaginatedLdapOutpostConfigList; +pub mod paginated_ldap_provider_list; +pub use self::paginated_ldap_provider_list::PaginatedLdapProviderList; +pub mod paginated_ldap_source_list; +pub use self::paginated_ldap_source_list::PaginatedLdapSourceList; +pub mod paginated_ldap_source_property_mapping_list; +pub use self::paginated_ldap_source_property_mapping_list::PaginatedLdapSourcePropertyMappingList; +pub mod paginated_license_list; +pub use self::paginated_license_list::PaginatedLicenseList; +pub mod paginated_lifecycle_iteration_list; +pub use self::paginated_lifecycle_iteration_list::PaginatedLifecycleIterationList; +pub mod paginated_lifecycle_rule_list; +pub use self::paginated_lifecycle_rule_list::PaginatedLifecycleRuleList; +pub mod paginated_microsoft_entra_provider_group_list; +pub use self::paginated_microsoft_entra_provider_group_list::PaginatedMicrosoftEntraProviderGroupList; +pub mod paginated_microsoft_entra_provider_list; +pub use self::paginated_microsoft_entra_provider_list::PaginatedMicrosoftEntraProviderList; +pub mod paginated_microsoft_entra_provider_mapping_list; +pub use self::paginated_microsoft_entra_provider_mapping_list::PaginatedMicrosoftEntraProviderMappingList; +pub mod paginated_microsoft_entra_provider_user_list; +pub use self::paginated_microsoft_entra_provider_user_list::PaginatedMicrosoftEntraProviderUserList; +pub mod paginated_mutual_tls_stage_list; +pub use self::paginated_mutual_tls_stage_list::PaginatedMutualTlsStageList; +pub mod paginated_notification_list; +pub use self::paginated_notification_list::PaginatedNotificationList; +pub mod paginated_notification_rule_list; +pub use self::paginated_notification_rule_list::PaginatedNotificationRuleList; +pub mod paginated_notification_transport_list; +pub use self::paginated_notification_transport_list::PaginatedNotificationTransportList; +pub mod paginated_notification_webhook_mapping_list; +pub use self::paginated_notification_webhook_mapping_list::PaginatedNotificationWebhookMappingList; +pub mod paginated_o_auth2_provider_list; +pub use self::paginated_o_auth2_provider_list::PaginatedOAuth2ProviderList; +pub mod paginated_o_auth_source_list; +pub use self::paginated_o_auth_source_list::PaginatedOAuthSourceList; +pub mod paginated_o_auth_source_property_mapping_list; +pub use self::paginated_o_auth_source_property_mapping_list::PaginatedOAuthSourcePropertyMappingList; +pub mod paginated_outpost_list; +pub use self::paginated_outpost_list::PaginatedOutpostList; +pub mod paginated_password_expiry_policy_list; +pub use self::paginated_password_expiry_policy_list::PaginatedPasswordExpiryPolicyList; +pub mod paginated_password_policy_list; +pub use self::paginated_password_policy_list::PaginatedPasswordPolicyList; +pub mod paginated_password_stage_list; +pub use self::paginated_password_stage_list::PaginatedPasswordStageList; +pub mod paginated_permission_list; +pub use self::paginated_permission_list::PaginatedPermissionList; +pub mod paginated_plex_source_list; +pub use self::paginated_plex_source_list::PaginatedPlexSourceList; +pub mod paginated_plex_source_property_mapping_list; +pub use self::paginated_plex_source_property_mapping_list::PaginatedPlexSourcePropertyMappingList; +pub mod paginated_policy_binding_list; +pub use self::paginated_policy_binding_list::PaginatedPolicyBindingList; +pub mod paginated_policy_list; +pub use self::paginated_policy_list::PaginatedPolicyList; +pub mod paginated_prompt_list; +pub use self::paginated_prompt_list::PaginatedPromptList; +pub mod paginated_prompt_stage_list; +pub use self::paginated_prompt_stage_list::PaginatedPromptStageList; +pub mod paginated_property_mapping_list; +pub use self::paginated_property_mapping_list::PaginatedPropertyMappingList; +pub mod paginated_provider_list; +pub use self::paginated_provider_list::PaginatedProviderList; +pub mod paginated_proxy_outpost_config_list; +pub use self::paginated_proxy_outpost_config_list::PaginatedProxyOutpostConfigList; +pub mod paginated_proxy_provider_list; +pub use self::paginated_proxy_provider_list::PaginatedProxyProviderList; +pub mod paginated_rac_property_mapping_list; +pub use self::paginated_rac_property_mapping_list::PaginatedRacPropertyMappingList; +pub mod paginated_rac_provider_list; +pub use self::paginated_rac_provider_list::PaginatedRacProviderList; +pub mod paginated_radius_outpost_config_list; +pub use self::paginated_radius_outpost_config_list::PaginatedRadiusOutpostConfigList; +pub mod paginated_radius_provider_list; +pub use self::paginated_radius_provider_list::PaginatedRadiusProviderList; +pub mod paginated_radius_provider_property_mapping_list; +pub use self::paginated_radius_provider_property_mapping_list::PaginatedRadiusProviderPropertyMappingList; +pub mod paginated_redirect_stage_list; +pub use self::paginated_redirect_stage_list::PaginatedRedirectStageList; +pub mod paginated_reputation_list; +pub use self::paginated_reputation_list::PaginatedReputationList; +pub mod paginated_reputation_policy_list; +pub use self::paginated_reputation_policy_list::PaginatedReputationPolicyList; +pub mod paginated_role_assigned_object_permission_list; +pub use self::paginated_role_assigned_object_permission_list::PaginatedRoleAssignedObjectPermissionList; +pub mod paginated_role_list; +pub use self::paginated_role_list::PaginatedRoleList; +pub mod paginated_saml_property_mapping_list; +pub use self::paginated_saml_property_mapping_list::PaginatedSamlPropertyMappingList; +pub mod paginated_saml_provider_list; +pub use self::paginated_saml_provider_list::PaginatedSamlProviderList; +pub mod paginated_saml_source_list; +pub use self::paginated_saml_source_list::PaginatedSamlSourceList; +pub mod paginated_saml_source_property_mapping_list; +pub use self::paginated_saml_source_property_mapping_list::PaginatedSamlSourcePropertyMappingList; +pub mod paginated_schedule_list; +pub use self::paginated_schedule_list::PaginatedScheduleList; +pub mod paginated_scim_mapping_list; +pub use self::paginated_scim_mapping_list::PaginatedScimMappingList; +pub mod paginated_scim_provider_group_list; +pub use self::paginated_scim_provider_group_list::PaginatedScimProviderGroupList; +pub mod paginated_scim_provider_list; +pub use self::paginated_scim_provider_list::PaginatedScimProviderList; +pub mod paginated_scim_provider_user_list; +pub use self::paginated_scim_provider_user_list::PaginatedScimProviderUserList; +pub mod paginated_scim_source_group_list; +pub use self::paginated_scim_source_group_list::PaginatedScimSourceGroupList; +pub mod paginated_scim_source_list; +pub use self::paginated_scim_source_list::PaginatedScimSourceList; +pub mod paginated_scim_source_property_mapping_list; +pub use self::paginated_scim_source_property_mapping_list::PaginatedScimSourcePropertyMappingList; +pub mod paginated_scim_source_user_list; +pub use self::paginated_scim_source_user_list::PaginatedScimSourceUserList; +pub mod paginated_scope_mapping_list; +pub use self::paginated_scope_mapping_list::PaginatedScopeMappingList; +pub mod paginated_service_connection_list; +pub use self::paginated_service_connection_list::PaginatedServiceConnectionList; +pub mod paginated_sms_device_list; +pub use self::paginated_sms_device_list::PaginatedSmsDeviceList; +pub mod paginated_source_list; +pub use self::paginated_source_list::PaginatedSourceList; +pub mod paginated_source_stage_list; +pub use self::paginated_source_stage_list::PaginatedSourceStageList; +pub mod paginated_ssf_provider_list; +pub use self::paginated_ssf_provider_list::PaginatedSsfProviderList; +pub mod paginated_ssf_stream_list; +pub use self::paginated_ssf_stream_list::PaginatedSsfStreamList; +pub mod paginated_stage_list; +pub use self::paginated_stage_list::PaginatedStageList; +pub mod paginated_static_device_list; +pub use self::paginated_static_device_list::PaginatedStaticDeviceList; +pub mod paginated_task_list; +pub use self::paginated_task_list::PaginatedTaskList; +pub mod paginated_telegram_source_list; +pub use self::paginated_telegram_source_list::PaginatedTelegramSourceList; +pub mod paginated_telegram_source_property_mapping_list; +pub use self::paginated_telegram_source_property_mapping_list::PaginatedTelegramSourcePropertyMappingList; +pub mod paginated_tenant_list; +pub use self::paginated_tenant_list::PaginatedTenantList; +pub mod paginated_token_list; +pub use self::paginated_token_list::PaginatedTokenList; +pub mod paginated_token_model_list; +pub use self::paginated_token_model_list::PaginatedTokenModelList; +pub mod paginated_totp_device_list; +pub use self::paginated_totp_device_list::PaginatedTotpDeviceList; +pub mod paginated_unique_password_policy_list; +pub use self::paginated_unique_password_policy_list::PaginatedUniquePasswordPolicyList; +pub mod paginated_user_consent_list; +pub use self::paginated_user_consent_list::PaginatedUserConsentList; +pub mod paginated_user_delete_stage_list; +pub use self::paginated_user_delete_stage_list::PaginatedUserDeleteStageList; +pub mod paginated_user_kerberos_source_connection_list; +pub use self::paginated_user_kerberos_source_connection_list::PaginatedUserKerberosSourceConnectionList; +pub mod paginated_user_ldap_source_connection_list; +pub use self::paginated_user_ldap_source_connection_list::PaginatedUserLdapSourceConnectionList; +pub mod paginated_user_list; +pub use self::paginated_user_list::PaginatedUserList; +pub mod paginated_user_login_stage_list; +pub use self::paginated_user_login_stage_list::PaginatedUserLoginStageList; +pub mod paginated_user_logout_stage_list; +pub use self::paginated_user_logout_stage_list::PaginatedUserLogoutStageList; +pub mod paginated_user_o_auth_source_connection_list; +pub use self::paginated_user_o_auth_source_connection_list::PaginatedUserOAuthSourceConnectionList; +pub mod paginated_user_plex_source_connection_list; +pub use self::paginated_user_plex_source_connection_list::PaginatedUserPlexSourceConnectionList; +pub mod paginated_user_saml_source_connection_list; +pub use self::paginated_user_saml_source_connection_list::PaginatedUserSamlSourceConnectionList; +pub mod paginated_user_source_connection_list; +pub use self::paginated_user_source_connection_list::PaginatedUserSourceConnectionList; +pub mod paginated_user_telegram_source_connection_list; +pub use self::paginated_user_telegram_source_connection_list::PaginatedUserTelegramSourceConnectionList; +pub mod paginated_user_write_stage_list; +pub use self::paginated_user_write_stage_list::PaginatedUserWriteStageList; +pub mod paginated_web_authn_device_list; +pub use self::paginated_web_authn_device_list::PaginatedWebAuthnDeviceList; +pub mod paginated_web_authn_device_type_list; +pub use self::paginated_web_authn_device_type_list::PaginatedWebAuthnDeviceTypeList; +pub mod paginated_ws_federation_provider_list; +pub use self::paginated_ws_federation_provider_list::PaginatedWsFederationProviderList; +pub mod pagination; +pub use self::pagination::Pagination; +pub mod partial_group; +pub use self::partial_group::PartialGroup; +pub mod partial_user; +pub use self::partial_user::PartialUser; +pub mod password_challenge; +pub use self::password_challenge::PasswordChallenge; +pub mod password_challenge_response_request; +pub use self::password_challenge_response_request::PasswordChallengeResponseRequest; +pub mod password_expiry_policy; +pub use self::password_expiry_policy::PasswordExpiryPolicy; +pub mod password_expiry_policy_request; +pub use self::password_expiry_policy_request::PasswordExpiryPolicyRequest; +pub mod password_policy; +pub use self::password_policy::PasswordPolicy; +pub mod password_policy_request; +pub use self::password_policy_request::PasswordPolicyRequest; +pub mod password_stage; +pub use self::password_stage::PasswordStage; +pub mod password_stage_request; +pub use self::password_stage_request::PasswordStageRequest; +pub mod patched_agent_connector_request; +pub use self::patched_agent_connector_request::PatchedAgentConnectorRequest; +pub mod patched_application_entitlement_request; +pub use self::patched_application_entitlement_request::PatchedApplicationEntitlementRequest; +pub mod patched_application_request; +pub use self::patched_application_request::PatchedApplicationRequest; +pub mod patched_authenticator_duo_stage_request; +pub use self::patched_authenticator_duo_stage_request::PatchedAuthenticatorDuoStageRequest; +pub mod patched_authenticator_email_stage_request; +pub use self::patched_authenticator_email_stage_request::PatchedAuthenticatorEmailStageRequest; +pub mod patched_authenticator_endpoint_gdtc_stage_request; +pub use self::patched_authenticator_endpoint_gdtc_stage_request::PatchedAuthenticatorEndpointGdtcStageRequest; +pub mod patched_authenticator_sms_stage_request; +pub use self::patched_authenticator_sms_stage_request::PatchedAuthenticatorSmsStageRequest; +pub mod patched_authenticator_static_stage_request; +pub use self::patched_authenticator_static_stage_request::PatchedAuthenticatorStaticStageRequest; +pub mod patched_authenticator_totp_stage_request; +pub use self::patched_authenticator_totp_stage_request::PatchedAuthenticatorTotpStageRequest; +pub mod patched_authenticator_validate_stage_request; +pub use self::patched_authenticator_validate_stage_request::PatchedAuthenticatorValidateStageRequest; +pub mod patched_authenticator_web_authn_stage_request; +pub use self::patched_authenticator_web_authn_stage_request::PatchedAuthenticatorWebAuthnStageRequest; +pub mod patched_blueprint_instance_request; +pub use self::patched_blueprint_instance_request::PatchedBlueprintInstanceRequest; +pub mod patched_brand_request; +pub use self::patched_brand_request::PatchedBrandRequest; +pub mod patched_captcha_stage_request; +pub use self::patched_captcha_stage_request::PatchedCaptchaStageRequest; +pub mod patched_certificate_key_pair_request; +pub use self::patched_certificate_key_pair_request::PatchedCertificateKeyPairRequest; +pub mod patched_connection_token_request; +pub use self::patched_connection_token_request::PatchedConnectionTokenRequest; +pub mod patched_consent_stage_request; +pub use self::patched_consent_stage_request::PatchedConsentStageRequest; +pub mod patched_deny_stage_request; +pub use self::patched_deny_stage_request::PatchedDenyStageRequest; +pub mod patched_device_access_group_request; +pub use self::patched_device_access_group_request::PatchedDeviceAccessGroupRequest; +pub mod patched_device_user_binding_request; +pub use self::patched_device_user_binding_request::PatchedDeviceUserBindingRequest; +pub mod patched_docker_service_connection_request; +pub use self::patched_docker_service_connection_request::PatchedDockerServiceConnectionRequest; +pub mod patched_domain_request; +pub use self::patched_domain_request::PatchedDomainRequest; +pub mod patched_dummy_policy_request; +pub use self::patched_dummy_policy_request::PatchedDummyPolicyRequest; +pub mod patched_dummy_stage_request; +pub use self::patched_dummy_stage_request::PatchedDummyStageRequest; +pub mod patched_duo_device_request; +pub use self::patched_duo_device_request::PatchedDuoDeviceRequest; +pub mod patched_email_device_request; +pub use self::patched_email_device_request::PatchedEmailDeviceRequest; +pub mod patched_email_stage_request; +pub use self::patched_email_stage_request::PatchedEmailStageRequest; +pub mod patched_endpoint_device_request; +pub use self::patched_endpoint_device_request::PatchedEndpointDeviceRequest; +pub mod patched_endpoint_request; +pub use self::patched_endpoint_request::PatchedEndpointRequest; +pub mod patched_endpoint_stage_request; +pub use self::patched_endpoint_stage_request::PatchedEndpointStageRequest; +pub mod patched_enrollment_token_request; +pub use self::patched_enrollment_token_request::PatchedEnrollmentTokenRequest; +pub mod patched_event_matcher_policy_request; +pub use self::patched_event_matcher_policy_request::PatchedEventMatcherPolicyRequest; +pub mod patched_event_request; +pub use self::patched_event_request::PatchedEventRequest; +pub mod patched_expression_policy_request; +pub use self::patched_expression_policy_request::PatchedExpressionPolicyRequest; +pub mod patched_fleet_connector_request; +pub use self::patched_fleet_connector_request::PatchedFleetConnectorRequest; +pub mod patched_flow_request; +pub use self::patched_flow_request::PatchedFlowRequest; +pub mod patched_flow_stage_binding_request; +pub use self::patched_flow_stage_binding_request::PatchedFlowStageBindingRequest; +pub mod patched_geo_ip_policy_request; +pub use self::patched_geo_ip_policy_request::PatchedGeoIpPolicyRequest; +pub mod patched_google_chrome_connector_request; +pub use self::patched_google_chrome_connector_request::PatchedGoogleChromeConnectorRequest; +pub mod patched_google_endpoint_device_request; +pub use self::patched_google_endpoint_device_request::PatchedGoogleEndpointDeviceRequest; +pub mod patched_google_workspace_provider_mapping_request; +pub use self::patched_google_workspace_provider_mapping_request::PatchedGoogleWorkspaceProviderMappingRequest; +pub mod patched_google_workspace_provider_request; +pub use self::patched_google_workspace_provider_request::PatchedGoogleWorkspaceProviderRequest; +pub mod patched_group_kerberos_source_connection_request; +pub use self::patched_group_kerberos_source_connection_request::PatchedGroupKerberosSourceConnectionRequest; +pub mod patched_group_ldap_source_connection_request; +pub use self::patched_group_ldap_source_connection_request::PatchedGroupLdapSourceConnectionRequest; +pub mod patched_group_o_auth_source_connection_request; +pub use self::patched_group_o_auth_source_connection_request::PatchedGroupOAuthSourceConnectionRequest; +pub mod patched_group_plex_source_connection_request; +pub use self::patched_group_plex_source_connection_request::PatchedGroupPlexSourceConnectionRequest; +pub mod patched_group_request; +pub use self::patched_group_request::PatchedGroupRequest; +pub mod patched_group_saml_source_connection_request; +pub use self::patched_group_saml_source_connection_request::PatchedGroupSamlSourceConnectionRequest; +pub mod patched_group_source_connection_request; +pub use self::patched_group_source_connection_request::PatchedGroupSourceConnectionRequest; +pub mod patched_group_telegram_source_connection_request; +pub use self::patched_group_telegram_source_connection_request::PatchedGroupTelegramSourceConnectionRequest; +pub mod patched_identification_stage_request; +pub use self::patched_identification_stage_request::PatchedIdentificationStageRequest; +pub mod patched_initial_permissions_request; +pub use self::patched_initial_permissions_request::PatchedInitialPermissionsRequest; +pub mod patched_invitation_request; +pub use self::patched_invitation_request::PatchedInvitationRequest; +pub mod patched_invitation_stage_request; +pub use self::patched_invitation_stage_request::PatchedInvitationStageRequest; +pub mod patched_kerberos_source_property_mapping_request; +pub use self::patched_kerberos_source_property_mapping_request::PatchedKerberosSourcePropertyMappingRequest; +pub mod patched_kerberos_source_request; +pub use self::patched_kerberos_source_request::PatchedKerberosSourceRequest; +pub mod patched_kubernetes_service_connection_request; +pub use self::patched_kubernetes_service_connection_request::PatchedKubernetesServiceConnectionRequest; +pub mod patched_ldap_provider_request; +pub use self::patched_ldap_provider_request::PatchedLdapProviderRequest; +pub mod patched_ldap_source_property_mapping_request; +pub use self::patched_ldap_source_property_mapping_request::PatchedLdapSourcePropertyMappingRequest; +pub mod patched_ldap_source_request; +pub use self::patched_ldap_source_request::PatchedLdapSourceRequest; +pub mod patched_license_request; +pub use self::patched_license_request::PatchedLicenseRequest; +pub mod patched_lifecycle_rule_request; +pub use self::patched_lifecycle_rule_request::PatchedLifecycleRuleRequest; +pub mod patched_microsoft_entra_provider_mapping_request; +pub use self::patched_microsoft_entra_provider_mapping_request::PatchedMicrosoftEntraProviderMappingRequest; +pub mod patched_microsoft_entra_provider_request; +pub use self::patched_microsoft_entra_provider_request::PatchedMicrosoftEntraProviderRequest; +pub mod patched_mutual_tls_stage_request; +pub use self::patched_mutual_tls_stage_request::PatchedMutualTlsStageRequest; +pub mod patched_notification_request; +pub use self::patched_notification_request::PatchedNotificationRequest; +pub mod patched_notification_rule_request; +pub use self::patched_notification_rule_request::PatchedNotificationRuleRequest; +pub mod patched_notification_transport_request; +pub use self::patched_notification_transport_request::PatchedNotificationTransportRequest; +pub mod patched_notification_webhook_mapping_request; +pub use self::patched_notification_webhook_mapping_request::PatchedNotificationWebhookMappingRequest; +pub mod patched_o_auth2_provider_request; +pub use self::patched_o_auth2_provider_request::PatchedOAuth2ProviderRequest; +pub mod patched_o_auth_source_property_mapping_request; +pub use self::patched_o_auth_source_property_mapping_request::PatchedOAuthSourcePropertyMappingRequest; +pub mod patched_o_auth_source_request; +pub use self::patched_o_auth_source_request::PatchedOAuthSourceRequest; +pub mod patched_outpost_request; +pub use self::patched_outpost_request::PatchedOutpostRequest; +pub mod patched_password_expiry_policy_request; +pub use self::patched_password_expiry_policy_request::PatchedPasswordExpiryPolicyRequest; +pub mod patched_password_policy_request; +pub use self::patched_password_policy_request::PatchedPasswordPolicyRequest; +pub mod patched_password_stage_request; +pub use self::patched_password_stage_request::PatchedPasswordStageRequest; +pub mod patched_permission_assign_request; +pub use self::patched_permission_assign_request::PatchedPermissionAssignRequest; +pub mod patched_plex_source_property_mapping_request; +pub use self::patched_plex_source_property_mapping_request::PatchedPlexSourcePropertyMappingRequest; +pub mod patched_plex_source_request; +pub use self::patched_plex_source_request::PatchedPlexSourceRequest; +pub mod patched_policy_binding_request; +pub use self::patched_policy_binding_request::PatchedPolicyBindingRequest; +pub mod patched_prompt_request; +pub use self::patched_prompt_request::PatchedPromptRequest; +pub mod patched_prompt_stage_request; +pub use self::patched_prompt_stage_request::PatchedPromptStageRequest; +pub mod patched_proxy_provider_request; +pub use self::patched_proxy_provider_request::PatchedProxyProviderRequest; +pub mod patched_rac_property_mapping_request; +pub use self::patched_rac_property_mapping_request::PatchedRacPropertyMappingRequest; +pub mod patched_rac_provider_request; +pub use self::patched_rac_provider_request::PatchedRacProviderRequest; +pub mod patched_radius_provider_property_mapping_request; +pub use self::patched_radius_provider_property_mapping_request::PatchedRadiusProviderPropertyMappingRequest; +pub mod patched_radius_provider_request; +pub use self::patched_radius_provider_request::PatchedRadiusProviderRequest; +pub mod patched_redirect_stage_request; +pub use self::patched_redirect_stage_request::PatchedRedirectStageRequest; +pub mod patched_reputation_policy_request; +pub use self::patched_reputation_policy_request::PatchedReputationPolicyRequest; +pub mod patched_role_request; +pub use self::patched_role_request::PatchedRoleRequest; +pub mod patched_saml_property_mapping_request; +pub use self::patched_saml_property_mapping_request::PatchedSamlPropertyMappingRequest; +pub mod patched_saml_provider_request; +pub use self::patched_saml_provider_request::PatchedSamlProviderRequest; +pub mod patched_saml_source_property_mapping_request; +pub use self::patched_saml_source_property_mapping_request::PatchedSamlSourcePropertyMappingRequest; +pub mod patched_saml_source_request; +pub use self::patched_saml_source_request::PatchedSamlSourceRequest; +pub mod patched_schedule_request; +pub use self::patched_schedule_request::PatchedScheduleRequest; +pub mod patched_scim_mapping_request; +pub use self::patched_scim_mapping_request::PatchedScimMappingRequest; +pub mod patched_scim_provider_request; +pub use self::patched_scim_provider_request::PatchedScimProviderRequest; +pub mod patched_scim_source_group_request; +pub use self::patched_scim_source_group_request::PatchedScimSourceGroupRequest; +pub mod patched_scim_source_property_mapping_request; +pub use self::patched_scim_source_property_mapping_request::PatchedScimSourcePropertyMappingRequest; +pub mod patched_scim_source_request; +pub use self::patched_scim_source_request::PatchedScimSourceRequest; +pub mod patched_scim_source_user_request; +pub use self::patched_scim_source_user_request::PatchedScimSourceUserRequest; +pub mod patched_scope_mapping_request; +pub use self::patched_scope_mapping_request::PatchedScopeMappingRequest; +pub mod patched_settings_request; +pub use self::patched_settings_request::PatchedSettingsRequest; +pub mod patched_settings_request_flags; +pub use self::patched_settings_request_flags::PatchedSettingsRequestFlags; +pub mod patched_sms_device_request; +pub use self::patched_sms_device_request::PatchedSmsDeviceRequest; +pub mod patched_source_stage_request; +pub use self::patched_source_stage_request::PatchedSourceStageRequest; +pub mod patched_ssf_provider_request; +pub use self::patched_ssf_provider_request::PatchedSsfProviderRequest; +pub mod patched_static_device_request; +pub use self::patched_static_device_request::PatchedStaticDeviceRequest; +pub mod patched_telegram_source_property_mapping_request; +pub use self::patched_telegram_source_property_mapping_request::PatchedTelegramSourcePropertyMappingRequest; +pub mod patched_telegram_source_request; +pub use self::patched_telegram_source_request::PatchedTelegramSourceRequest; +pub mod patched_tenant_request; +pub use self::patched_tenant_request::PatchedTenantRequest; +pub mod patched_token_request; +pub use self::patched_token_request::PatchedTokenRequest; +pub mod patched_totp_device_request; +pub use self::patched_totp_device_request::PatchedTotpDeviceRequest; +pub mod patched_unique_password_policy_request; +pub use self::patched_unique_password_policy_request::PatchedUniquePasswordPolicyRequest; +pub mod patched_user_delete_stage_request; +pub use self::patched_user_delete_stage_request::PatchedUserDeleteStageRequest; +pub mod patched_user_kerberos_source_connection_request; +pub use self::patched_user_kerberos_source_connection_request::PatchedUserKerberosSourceConnectionRequest; +pub mod patched_user_ldap_source_connection_request; +pub use self::patched_user_ldap_source_connection_request::PatchedUserLdapSourceConnectionRequest; +pub mod patched_user_login_stage_request; +pub use self::patched_user_login_stage_request::PatchedUserLoginStageRequest; +pub mod patched_user_logout_stage_request; +pub use self::patched_user_logout_stage_request::PatchedUserLogoutStageRequest; +pub mod patched_user_o_auth_source_connection_request; +pub use self::patched_user_o_auth_source_connection_request::PatchedUserOAuthSourceConnectionRequest; +pub mod patched_user_plex_source_connection_request; +pub use self::patched_user_plex_source_connection_request::PatchedUserPlexSourceConnectionRequest; +pub mod patched_user_request; +pub use self::patched_user_request::PatchedUserRequest; +pub mod patched_user_saml_source_connection_request; +pub use self::patched_user_saml_source_connection_request::PatchedUserSamlSourceConnectionRequest; +pub mod patched_user_source_connection_request; +pub use self::patched_user_source_connection_request::PatchedUserSourceConnectionRequest; +pub mod patched_user_telegram_source_connection_request; +pub use self::patched_user_telegram_source_connection_request::PatchedUserTelegramSourceConnectionRequest; +pub mod patched_user_write_stage_request; +pub use self::patched_user_write_stage_request::PatchedUserWriteStageRequest; +pub mod patched_web_authn_device_request; +pub use self::patched_web_authn_device_request::PatchedWebAuthnDeviceRequest; +pub mod patched_ws_federation_provider_request; +pub use self::patched_ws_federation_provider_request::PatchedWsFederationProviderRequest; +pub mod permission; +pub use self::permission::Permission; +pub mod permission_assign_request; +pub use self::permission_assign_request::PermissionAssignRequest; +pub mod permission_assign_result; +pub use self::permission_assign_result::PermissionAssignResult; +pub mod pkce_method_enum; +pub use self::pkce_method_enum::PkceMethodEnum; +pub mod plex_authentication_challenge; +pub use self::plex_authentication_challenge::PlexAuthenticationChallenge; +pub mod plex_authentication_challenge_response_request; +pub use self::plex_authentication_challenge_response_request::PlexAuthenticationChallengeResponseRequest; +pub mod plex_source; +pub use self::plex_source::PlexSource; +pub mod plex_source_property_mapping; +pub use self::plex_source_property_mapping::PlexSourcePropertyMapping; +pub mod plex_source_property_mapping_request; +pub use self::plex_source_property_mapping_request::PlexSourcePropertyMappingRequest; +pub mod plex_source_request; +pub use self::plex_source_request::PlexSourceRequest; +pub mod plex_token_redeem_request; +pub use self::plex_token_redeem_request::PlexTokenRedeemRequest; +pub mod policy; +pub use self::policy::Policy; +pub mod policy_binding; +pub use self::policy_binding::PolicyBinding; +pub mod policy_binding_request; +pub use self::policy_binding_request::PolicyBindingRequest; +pub mod policy_engine_mode; +pub use self::policy_engine_mode::PolicyEngineMode; +pub mod policy_test_request; +pub use self::policy_test_request::PolicyTestRequest; +pub mod policy_test_result; +pub use self::policy_test_result::PolicyTestResult; +pub mod process; +pub use self::process::Process; +pub mod process_request; +pub use self::process_request::ProcessRequest; +pub mod prompt; +pub use self::prompt::Prompt; +pub mod prompt_challenge; +pub use self::prompt_challenge::PromptChallenge; +pub mod prompt_challenge_response_request; +pub use self::prompt_challenge_response_request::PromptChallengeResponseRequest; +pub mod prompt_choice; +pub use self::prompt_choice::PromptChoice; +pub mod prompt_request; +pub use self::prompt_request::PromptRequest; +pub mod prompt_stage; +pub use self::prompt_stage::PromptStage; +pub mod prompt_stage_request; +pub use self::prompt_stage_request::PromptStageRequest; +pub mod prompt_type_enum; +pub use self::prompt_type_enum::PromptTypeEnum; +pub mod property_mapping; +pub use self::property_mapping::PropertyMapping; +pub mod property_mapping_preview; +pub use self::property_mapping_preview::PropertyMappingPreview; +pub mod property_mapping_test_request; +pub use self::property_mapping_test_request::PropertyMappingTestRequest; +pub mod property_mapping_test_result; +pub use self::property_mapping_test_result::PropertyMappingTestResult; +pub mod protocol_enum; +pub use self::protocol_enum::ProtocolEnum; +pub mod provider; +pub use self::provider::Provider; +pub mod provider_enum; +pub use self::provider_enum::ProviderEnum; +pub mod provider_model_enum; +pub use self::provider_model_enum::ProviderModelEnum; +pub mod provider_type_enum; +pub use self::provider_type_enum::ProviderTypeEnum; +pub mod proxy_mode; +pub use self::proxy_mode::ProxyMode; +pub mod proxy_outpost_config; +pub use self::proxy_outpost_config::ProxyOutpostConfig; +pub mod proxy_provider; +pub use self::proxy_provider::ProxyProvider; +pub mod proxy_provider_request; +pub use self::proxy_provider_request::ProxyProviderRequest; +pub mod rac_property_mapping; +pub use self::rac_property_mapping::RacPropertyMapping; +pub mod rac_property_mapping_request; +pub use self::rac_property_mapping_request::RacPropertyMappingRequest; +pub mod rac_provider; +pub use self::rac_provider::RacProvider; +pub mod rac_provider_request; +pub use self::rac_provider_request::RacProviderRequest; +pub mod radius_check_access; +pub use self::radius_check_access::RadiusCheckAccess; +pub mod radius_outpost_config; +pub use self::radius_outpost_config::RadiusOutpostConfig; +pub mod radius_provider; +pub use self::radius_provider::RadiusProvider; +pub mod radius_provider_property_mapping; +pub use self::radius_provider_property_mapping::RadiusProviderPropertyMapping; +pub mod radius_provider_property_mapping_request; +pub use self::radius_provider_property_mapping_request::RadiusProviderPropertyMappingRequest; +pub mod radius_provider_request; +pub use self::radius_provider_request::RadiusProviderRequest; +pub mod redirect_challenge; +pub use self::redirect_challenge::RedirectChallenge; +pub mod redirect_challenge_response_request; +pub use self::redirect_challenge_response_request::RedirectChallengeResponseRequest; +pub mod redirect_stage; +pub use self::redirect_stage::RedirectStage; +pub mod redirect_stage_mode_enum; +pub use self::redirect_stage_mode_enum::RedirectStageModeEnum; +pub mod redirect_stage_request; +pub use self::redirect_stage_request::RedirectStageRequest; +pub mod redirect_uri; +pub use self::redirect_uri::RedirectUri; +pub mod redirect_uri_request; +pub use self::redirect_uri_request::RedirectUriRequest; +pub mod related_group; +pub use self::related_group::RelatedGroup; +pub mod reputation; +pub use self::reputation::Reputation; +pub mod reputation_policy; +pub use self::reputation_policy::ReputationPolicy; +pub mod reputation_policy_request; +pub use self::reputation_policy_request::ReputationPolicyRequest; +pub mod resident_key_requirement_enum; +pub use self::resident_key_requirement_enum::ResidentKeyRequirementEnum; +pub mod review; +pub use self::review::Review; +pub mod review_request; +pub use self::review_request::ReviewRequest; +pub mod reviewer_group; +pub use self::reviewer_group::ReviewerGroup; +pub mod reviewer_user; +pub use self::reviewer_user::ReviewerUser; +pub mod role; +pub use self::role::Role; +pub mod role_assigned_object_permission; +pub use self::role_assigned_object_permission::RoleAssignedObjectPermission; +pub mod role_model_permission; +pub use self::role_model_permission::RoleModelPermission; +pub mod role_object_permission; +pub use self::role_object_permission::RoleObjectPermission; +pub mod role_request; +pub use self::role_request::RoleRequest; +pub mod saml_bindings_enum; +pub use self::saml_bindings_enum::SamlBindingsEnum; +pub mod saml_logout_methods; +pub use self::saml_logout_methods::SamlLogoutMethods; +pub mod saml_metadata; +pub use self::saml_metadata::SamlMetadata; +pub mod saml_name_id_policy_enum; +pub use self::saml_name_id_policy_enum::SamlNameIdPolicyEnum; +pub mod saml_property_mapping; +pub use self::saml_property_mapping::SamlPropertyMapping; +pub mod saml_property_mapping_request; +pub use self::saml_property_mapping_request::SamlPropertyMappingRequest; +pub mod saml_provider; +pub use self::saml_provider::SamlProvider; +pub mod saml_provider_request; +pub use self::saml_provider_request::SamlProviderRequest; +pub mod saml_source; +pub use self::saml_source::SamlSource; +pub mod saml_source_property_mapping; +pub use self::saml_source_property_mapping::SamlSourcePropertyMapping; +pub mod saml_source_property_mapping_request; +pub use self::saml_source_property_mapping_request::SamlSourcePropertyMappingRequest; +pub mod saml_source_request; +pub use self::saml_source_request::SamlSourceRequest; +pub mod schedule; +pub use self::schedule::Schedule; +pub mod schedule_request; +pub use self::schedule_request::ScheduleRequest; +pub mod scim_authentication_mode_enum; +pub use self::scim_authentication_mode_enum::ScimAuthenticationModeEnum; +pub mod scim_mapping; +pub use self::scim_mapping::ScimMapping; +pub mod scim_mapping_request; +pub use self::scim_mapping_request::ScimMappingRequest; +pub mod scim_provider; +pub use self::scim_provider::ScimProvider; +pub mod scim_provider_group; +pub use self::scim_provider_group::ScimProviderGroup; +pub mod scim_provider_group_request; +pub use self::scim_provider_group_request::ScimProviderGroupRequest; +pub mod scim_provider_request; +pub use self::scim_provider_request::ScimProviderRequest; +pub mod scim_provider_user; +pub use self::scim_provider_user::ScimProviderUser; +pub mod scim_provider_user_request; +pub use self::scim_provider_user_request::ScimProviderUserRequest; +pub mod scim_source; +pub use self::scim_source::ScimSource; +pub mod scim_source_group; +pub use self::scim_source_group::ScimSourceGroup; +pub mod scim_source_group_request; +pub use self::scim_source_group_request::ScimSourceGroupRequest; +pub mod scim_source_property_mapping; +pub use self::scim_source_property_mapping::ScimSourcePropertyMapping; +pub mod scim_source_property_mapping_request; +pub use self::scim_source_property_mapping_request::ScimSourcePropertyMappingRequest; +pub mod scim_source_request; +pub use self::scim_source_request::ScimSourceRequest; +pub mod scim_source_user; +pub use self::scim_source_user::ScimSourceUser; +pub mod scim_source_user_request; +pub use self::scim_source_user_request::ScimSourceUserRequest; +pub mod scope_mapping; +pub use self::scope_mapping::ScopeMapping; +pub mod scope_mapping_request; +pub use self::scope_mapping_request::ScopeMappingRequest; +pub mod selectable_stage; +pub use self::selectable_stage::SelectableStage; +pub mod service_connection; +pub use self::service_connection::ServiceConnection; +pub mod service_connection_state; +pub use self::service_connection_state::ServiceConnectionState; +pub mod session_end_challenge; +pub use self::session_end_challenge::SessionEndChallenge; +pub mod session_user; +pub use self::session_user::SessionUser; +pub mod settings; +pub use self::settings::Settings; +pub mod settings_request; +pub use self::settings_request::SettingsRequest; +pub mod severity_enum; +pub use self::severity_enum::SeverityEnum; +pub mod shell_challenge; +pub use self::shell_challenge::ShellChallenge; +pub mod signature_algorithm_enum; +pub use self::signature_algorithm_enum::SignatureAlgorithmEnum; +pub mod sms_device; +pub use self::sms_device::SmsDevice; +pub mod sms_device_request; +pub use self::sms_device_request::SmsDeviceRequest; +pub mod software; +pub use self::software::Software; +pub mod software_request; +pub use self::software_request::SoftwareRequest; +pub mod source; +pub use self::source::Source; +pub mod source_stage; +pub use self::source_stage::SourceStage; +pub mod source_stage_request; +pub use self::source_stage_request::SourceStageRequest; +pub mod source_type; +pub use self::source_type::SourceType; +pub mod ssf_provider; +pub use self::ssf_provider::SsfProvider; +pub mod ssf_provider_request; +pub use self::ssf_provider_request::SsfProviderRequest; +pub mod ssf_stream; +pub use self::ssf_stream::SsfStream; +pub mod stage; +pub use self::stage::Stage; +pub mod stage_mode_enum; +pub use self::stage_mode_enum::StageModeEnum; +pub mod stage_prompt; +pub use self::stage_prompt::StagePrompt; +pub mod static_device; +pub use self::static_device::StaticDevice; +pub mod static_device_request; +pub use self::static_device_request::StaticDeviceRequest; +pub mod static_device_token; +pub use self::static_device_token::StaticDeviceToken; +pub mod sub_mode_enum; +pub use self::sub_mode_enum::SubModeEnum; +pub mod sync_object_model_enum; +pub use self::sync_object_model_enum::SyncObjectModelEnum; +pub mod sync_object_request; +pub use self::sync_object_request::SyncObjectRequest; +pub mod sync_object_result; +pub use self::sync_object_result::SyncObjectResult; +pub mod sync_outgoing_trigger_mode_enum; +pub use self::sync_outgoing_trigger_mode_enum::SyncOutgoingTriggerModeEnum; +pub mod sync_status; +pub use self::sync_status::SyncStatus; +pub mod system_info; +pub use self::system_info::SystemInfo; +pub mod system_info_runtime; +pub use self::system_info_runtime::SystemInfoRuntime; +pub mod task; +pub use self::task::Task; +pub mod task_aggregated_status_enum; +pub use self::task_aggregated_status_enum::TaskAggregatedStatusEnum; +pub mod task_state_enum; +pub use self::task_state_enum::TaskStateEnum; +pub mod telegram_auth_request; +pub use self::telegram_auth_request::TelegramAuthRequest; +pub mod telegram_challenge_response_request; +pub use self::telegram_challenge_response_request::TelegramChallengeResponseRequest; +pub mod telegram_login_challenge; +pub use self::telegram_login_challenge::TelegramLoginChallenge; +pub mod telegram_source; +pub use self::telegram_source::TelegramSource; +pub mod telegram_source_property_mapping; +pub use self::telegram_source_property_mapping::TelegramSourcePropertyMapping; +pub mod telegram_source_property_mapping_request; +pub use self::telegram_source_property_mapping_request::TelegramSourcePropertyMappingRequest; +pub mod telegram_source_request; +pub use self::telegram_source_request::TelegramSourceRequest; +pub mod tenant; +pub use self::tenant::Tenant; +pub mod tenant_admin_group_request_request; +pub use self::tenant_admin_group_request_request::TenantAdminGroupRequestRequest; +pub mod tenant_recovery_key_request_request; +pub use self::tenant_recovery_key_request_request::TenantRecoveryKeyRequestRequest; +pub mod tenant_recovery_key_response; +pub use self::tenant_recovery_key_response::TenantRecoveryKeyResponse; +pub mod tenant_request; +pub use self::tenant_request::TenantRequest; +pub mod themed_urls; +pub use self::themed_urls::ThemedUrls; +pub mod token; +pub use self::token::Token; +pub mod token_model; +pub use self::token_model::TokenModel; +pub mod token_request; +pub use self::token_request::TokenRequest; +pub mod token_set_key_request; +pub use self::token_set_key_request::TokenSetKeyRequest; +pub mod token_view; +pub use self::token_view::TokenView; +pub mod totp_device; +pub use self::totp_device::TotpDevice; +pub mod totp_device_request; +pub use self::totp_device_request::TotpDeviceRequest; +pub mod transaction_application_request; +pub use self::transaction_application_request::TransactionApplicationRequest; +pub mod transaction_application_response; +pub use self::transaction_application_response::TransactionApplicationResponse; +pub mod transaction_policy_binding_request; +pub use self::transaction_policy_binding_request::TransactionPolicyBindingRequest; +pub mod type_create; +pub use self::type_create::TypeCreate; +pub mod ui_theme_enum; +pub use self::ui_theme_enum::UiThemeEnum; +pub mod unique_password_policy; +pub use self::unique_password_policy::UniquePasswordPolicy; +pub mod unique_password_policy_request; +pub use self::unique_password_policy_request::UniquePasswordPolicyRequest; +pub mod used_by; +pub use self::used_by::UsedBy; +pub mod used_by_action_enum; +pub use self::used_by_action_enum::UsedByActionEnum; +pub mod user; +pub use self::user::User; +pub mod user_account_request; +pub use self::user_account_request::UserAccountRequest; +pub mod user_account_serializer_for_role_request; +pub use self::user_account_serializer_for_role_request::UserAccountSerializerForRoleRequest; +pub mod user_attribute_enum; +pub use self::user_attribute_enum::UserAttributeEnum; +pub mod user_consent; +pub use self::user_consent::UserConsent; +pub mod user_creation_mode_enum; +pub use self::user_creation_mode_enum::UserCreationModeEnum; +pub mod user_delete_stage; +pub use self::user_delete_stage::UserDeleteStage; +pub mod user_delete_stage_request; +pub use self::user_delete_stage_request::UserDeleteStageRequest; +pub mod user_fields_enum; +pub use self::user_fields_enum::UserFieldsEnum; +pub mod user_kerberos_source_connection; +pub use self::user_kerberos_source_connection::UserKerberosSourceConnection; +pub mod user_kerberos_source_connection_request; +pub use self::user_kerberos_source_connection_request::UserKerberosSourceConnectionRequest; +pub mod user_ldap_source_connection; +pub use self::user_ldap_source_connection::UserLdapSourceConnection; +pub mod user_ldap_source_connection_request; +pub use self::user_ldap_source_connection_request::UserLdapSourceConnectionRequest; +pub mod user_login_challenge; +pub use self::user_login_challenge::UserLoginChallenge; +pub mod user_login_challenge_response_request; +pub use self::user_login_challenge_response_request::UserLoginChallengeResponseRequest; +pub mod user_login_stage; +pub use self::user_login_stage::UserLoginStage; +pub mod user_login_stage_request; +pub use self::user_login_stage_request::UserLoginStageRequest; +pub mod user_logout_stage; +pub use self::user_logout_stage::UserLogoutStage; +pub mod user_logout_stage_request; +pub use self::user_logout_stage_request::UserLogoutStageRequest; +pub mod user_matching_mode_enum; +pub use self::user_matching_mode_enum::UserMatchingModeEnum; +pub mod user_o_auth_source_connection; +pub use self::user_o_auth_source_connection::UserOAuthSourceConnection; +pub mod user_o_auth_source_connection_request; +pub use self::user_o_auth_source_connection_request::UserOAuthSourceConnectionRequest; +pub mod user_password_set_request; +pub use self::user_password_set_request::UserPasswordSetRequest; +pub mod user_path; +pub use self::user_path::UserPath; +pub mod user_plex_source_connection; +pub use self::user_plex_source_connection::UserPlexSourceConnection; +pub mod user_plex_source_connection_request; +pub use self::user_plex_source_connection_request::UserPlexSourceConnectionRequest; +pub mod user_recovery_email_request; +pub use self::user_recovery_email_request::UserRecoveryEmailRequest; +pub mod user_recovery_link_request; +pub use self::user_recovery_link_request::UserRecoveryLinkRequest; +pub mod user_request; +pub use self::user_request::UserRequest; +pub mod user_saml_source_connection; +pub use self::user_saml_source_connection::UserSamlSourceConnection; +pub mod user_saml_source_connection_request; +pub use self::user_saml_source_connection_request::UserSamlSourceConnectionRequest; +pub mod user_self; +pub use self::user_self::UserSelf; +pub mod user_self_groups; +pub use self::user_self_groups::UserSelfGroups; +pub mod user_self_roles; +pub use self::user_self_roles::UserSelfRoles; +pub mod user_service_account_request; +pub use self::user_service_account_request::UserServiceAccountRequest; +pub mod user_service_account_response; +pub use self::user_service_account_response::UserServiceAccountResponse; +pub mod user_setting; +pub use self::user_setting::UserSetting; +pub mod user_source_connection; +pub use self::user_source_connection::UserSourceConnection; +pub mod user_source_connection_request; +pub use self::user_source_connection_request::UserSourceConnectionRequest; +pub mod user_telegram_source_connection; +pub use self::user_telegram_source_connection::UserTelegramSourceConnection; +pub mod user_telegram_source_connection_request; +pub use self::user_telegram_source_connection_request::UserTelegramSourceConnectionRequest; +pub mod user_type_enum; +pub use self::user_type_enum::UserTypeEnum; +pub mod user_verification_enum; +pub use self::user_verification_enum::UserVerificationEnum; +pub mod user_write_stage; +pub use self::user_write_stage::UserWriteStage; +pub mod user_write_stage_request; +pub use self::user_write_stage_request::UserWriteStageRequest; +pub mod validation_error; +pub use self::validation_error::ValidationError; +pub mod vendor_enum; +pub use self::vendor_enum::VendorEnum; +pub mod version; +pub use self::version::Version; +pub mod version_history; +pub use self::version_history::VersionHistory; +pub mod web_authn_device; +pub use self::web_authn_device::WebAuthnDevice; +pub mod web_authn_device_request; +pub use self::web_authn_device_request::WebAuthnDeviceRequest; +pub mod web_authn_device_type; +pub use self::web_authn_device_type::WebAuthnDeviceType; +pub mod web_authn_hint_enum; +pub use self::web_authn_hint_enum::WebAuthnHintEnum; +pub mod worker; +pub use self::worker::Worker; +pub mod ws_federation_provider; +pub use self::ws_federation_provider::WsFederationProvider; +pub mod ws_federation_provider_request; +pub use self::ws_federation_provider_request::WsFederationProviderRequest; diff --git a/packages/client-rust/src/models/model_enum.rs b/packages/client-rust/src/models/model_enum.rs new file mode 100644 index 0000000000..ed2a7e2f08 --- /dev/null +++ b/packages/client-rust/src/models/model_enum.rs @@ -0,0 +1,595 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ModelEnum { + #[serde(rename = "authentik_tenants.domain")] + AuthentikTenantsDomain, + #[serde(rename = "authentik_core.group")] + AuthentikCoreGroup, + #[serde(rename = "authentik_core.user")] + AuthentikCoreUser, + #[serde(rename = "authentik_core.application")] + AuthentikCoreApplication, + #[serde(rename = "authentik_core.applicationentitlement")] + AuthentikCoreApplicationentitlement, + #[serde(rename = "authentik_core.token")] + AuthentikCoreToken, + #[serde(rename = "authentik_crypto.certificatekeypair")] + AuthentikCryptoCertificatekeypair, + #[serde(rename = "authentik_endpoints.deviceuserbinding")] + AuthentikEndpointsDeviceuserbinding, + #[serde(rename = "authentik_endpoints.deviceaccessgroup")] + AuthentikEndpointsDeviceaccessgroup, + #[serde(rename = "authentik_endpoints.endpointstage")] + AuthentikEndpointsEndpointstage, + #[serde(rename = "authentik_endpoints_connectors_agent.agentconnector")] + AuthentikEndpointsConnectorsAgentAgentconnector, + #[serde(rename = "authentik_endpoints_connectors_agent.agentdeviceuserbinding")] + AuthentikEndpointsConnectorsAgentAgentdeviceuserbinding, + #[serde(rename = "authentik_endpoints_connectors_agent.enrollmenttoken")] + AuthentikEndpointsConnectorsAgentEnrollmenttoken, + #[serde(rename = "authentik_enterprise.license")] + AuthentikEnterpriseLicense, + #[serde(rename = "authentik_events.event")] + AuthentikEventsEvent, + #[serde(rename = "authentik_events.notificationtransport")] + AuthentikEventsNotificationtransport, + #[serde(rename = "authentik_events.notification")] + AuthentikEventsNotification, + #[serde(rename = "authentik_events.notificationrule")] + AuthentikEventsNotificationrule, + #[serde(rename = "authentik_events.notificationwebhookmapping")] + AuthentikEventsNotificationwebhookmapping, + #[serde(rename = "authentik_flows.flow")] + AuthentikFlowsFlow, + #[serde(rename = "authentik_flows.flowstagebinding")] + AuthentikFlowsFlowstagebinding, + #[serde(rename = "authentik_outposts.dockerserviceconnection")] + AuthentikOutpostsDockerserviceconnection, + #[serde(rename = "authentik_outposts.kubernetesserviceconnection")] + AuthentikOutpostsKubernetesserviceconnection, + #[serde(rename = "authentik_outposts.outpost")] + AuthentikOutpostsOutpost, + #[serde(rename = "authentik_policies_dummy.dummypolicy")] + AuthentikPoliciesDummyDummypolicy, + #[serde(rename = "authentik_policies_event_matcher.eventmatcherpolicy")] + AuthentikPoliciesEventMatcherEventmatcherpolicy, + #[serde(rename = "authentik_policies_expiry.passwordexpirypolicy")] + AuthentikPoliciesExpiryPasswordexpirypolicy, + #[serde(rename = "authentik_policies_expression.expressionpolicy")] + AuthentikPoliciesExpressionExpressionpolicy, + #[serde(rename = "authentik_policies_geoip.geoippolicy")] + AuthentikPoliciesGeoipGeoippolicy, + #[serde(rename = "authentik_policies_password.passwordpolicy")] + AuthentikPoliciesPasswordPasswordpolicy, + #[serde(rename = "authentik_policies_reputation.reputationpolicy")] + AuthentikPoliciesReputationReputationpolicy, + #[serde(rename = "authentik_policies.policybinding")] + AuthentikPoliciesPolicybinding, + #[serde(rename = "authentik_providers_ldap.ldapprovider")] + AuthentikProvidersLdapLdapprovider, + #[serde(rename = "authentik_providers_oauth2.scopemapping")] + AuthentikProvidersOauth2Scopemapping, + #[serde(rename = "authentik_providers_oauth2.oauth2provider")] + AuthentikProvidersOauth2Oauth2provider, + #[serde(rename = "authentik_providers_proxy.proxyprovider")] + AuthentikProvidersProxyProxyprovider, + #[serde(rename = "authentik_providers_rac.racprovider")] + AuthentikProvidersRacRacprovider, + #[serde(rename = "authentik_providers_rac.endpoint")] + AuthentikProvidersRacEndpoint, + #[serde(rename = "authentik_providers_rac.racpropertymapping")] + AuthentikProvidersRacRacpropertymapping, + #[serde(rename = "authentik_providers_radius.radiusprovider")] + AuthentikProvidersRadiusRadiusprovider, + #[serde(rename = "authentik_providers_radius.radiusproviderpropertymapping")] + AuthentikProvidersRadiusRadiusproviderpropertymapping, + #[serde(rename = "authentik_providers_saml.samlprovider")] + AuthentikProvidersSamlSamlprovider, + #[serde(rename = "authentik_providers_saml.samlpropertymapping")] + AuthentikProvidersSamlSamlpropertymapping, + #[serde(rename = "authentik_providers_scim.scimprovider")] + AuthentikProvidersScimScimprovider, + #[serde(rename = "authentik_providers_scim.scimmapping")] + AuthentikProvidersScimScimmapping, + #[serde(rename = "authentik_rbac.role")] + AuthentikRbacRole, + #[serde(rename = "authentik_rbac.initialpermissions")] + AuthentikRbacInitialpermissions, + #[serde(rename = "authentik_sources_kerberos.kerberossource")] + AuthentikSourcesKerberosKerberossource, + #[serde(rename = "authentik_sources_kerberos.kerberossourcepropertymapping")] + AuthentikSourcesKerberosKerberossourcepropertymapping, + #[serde(rename = "authentik_sources_kerberos.userkerberossourceconnection")] + AuthentikSourcesKerberosUserkerberossourceconnection, + #[serde(rename = "authentik_sources_kerberos.groupkerberossourceconnection")] + AuthentikSourcesKerberosGroupkerberossourceconnection, + #[serde(rename = "authentik_sources_ldap.ldapsource")] + AuthentikSourcesLdapLdapsource, + #[serde(rename = "authentik_sources_ldap.ldapsourcepropertymapping")] + AuthentikSourcesLdapLdapsourcepropertymapping, + #[serde(rename = "authentik_sources_ldap.userldapsourceconnection")] + AuthentikSourcesLdapUserldapsourceconnection, + #[serde(rename = "authentik_sources_ldap.groupldapsourceconnection")] + AuthentikSourcesLdapGroupldapsourceconnection, + #[serde(rename = "authentik_sources_oauth.oauthsource")] + AuthentikSourcesOauthOauthsource, + #[serde(rename = "authentik_sources_oauth.oauthsourcepropertymapping")] + AuthentikSourcesOauthOauthsourcepropertymapping, + #[serde(rename = "authentik_sources_oauth.useroauthsourceconnection")] + AuthentikSourcesOauthUseroauthsourceconnection, + #[serde(rename = "authentik_sources_oauth.groupoauthsourceconnection")] + AuthentikSourcesOauthGroupoauthsourceconnection, + #[serde(rename = "authentik_sources_plex.plexsource")] + AuthentikSourcesPlexPlexsource, + #[serde(rename = "authentik_sources_plex.plexsourcepropertymapping")] + AuthentikSourcesPlexPlexsourcepropertymapping, + #[serde(rename = "authentik_sources_plex.userplexsourceconnection")] + AuthentikSourcesPlexUserplexsourceconnection, + #[serde(rename = "authentik_sources_plex.groupplexsourceconnection")] + AuthentikSourcesPlexGroupplexsourceconnection, + #[serde(rename = "authentik_sources_saml.samlsource")] + AuthentikSourcesSamlSamlsource, + #[serde(rename = "authentik_sources_saml.samlsourcepropertymapping")] + AuthentikSourcesSamlSamlsourcepropertymapping, + #[serde(rename = "authentik_sources_saml.usersamlsourceconnection")] + AuthentikSourcesSamlUsersamlsourceconnection, + #[serde(rename = "authentik_sources_saml.groupsamlsourceconnection")] + AuthentikSourcesSamlGroupsamlsourceconnection, + #[serde(rename = "authentik_sources_scim.scimsource")] + AuthentikSourcesScimScimsource, + #[serde(rename = "authentik_sources_scim.scimsourcepropertymapping")] + AuthentikSourcesScimScimsourcepropertymapping, + #[serde(rename = "authentik_sources_telegram.telegramsource")] + AuthentikSourcesTelegramTelegramsource, + #[serde(rename = "authentik_sources_telegram.telegramsourcepropertymapping")] + AuthentikSourcesTelegramTelegramsourcepropertymapping, + #[serde(rename = "authentik_sources_telegram.usertelegramsourceconnection")] + AuthentikSourcesTelegramUsertelegramsourceconnection, + #[serde(rename = "authentik_sources_telegram.grouptelegramsourceconnection")] + AuthentikSourcesTelegramGrouptelegramsourceconnection, + #[serde(rename = "authentik_stages_authenticator_duo.authenticatorduostage")] + AuthentikStagesAuthenticatorDuoAuthenticatorduostage, + #[serde(rename = "authentik_stages_authenticator_duo.duodevice")] + AuthentikStagesAuthenticatorDuoDuodevice, + #[serde(rename = "authentik_stages_authenticator_email.authenticatoremailstage")] + AuthentikStagesAuthenticatorEmailAuthenticatoremailstage, + #[serde(rename = "authentik_stages_authenticator_email.emaildevice")] + AuthentikStagesAuthenticatorEmailEmaildevice, + #[serde(rename = "authentik_stages_authenticator_sms.authenticatorsmsstage")] + AuthentikStagesAuthenticatorSmsAuthenticatorsmsstage, + #[serde(rename = "authentik_stages_authenticator_sms.smsdevice")] + AuthentikStagesAuthenticatorSmsSmsdevice, + #[serde(rename = "authentik_stages_authenticator_static.authenticatorstaticstage")] + AuthentikStagesAuthenticatorStaticAuthenticatorstaticstage, + #[serde(rename = "authentik_stages_authenticator_static.staticdevice")] + AuthentikStagesAuthenticatorStaticStaticdevice, + #[serde(rename = "authentik_stages_authenticator_totp.authenticatortotpstage")] + AuthentikStagesAuthenticatorTotpAuthenticatortotpstage, + #[serde(rename = "authentik_stages_authenticator_totp.totpdevice")] + AuthentikStagesAuthenticatorTotpTotpdevice, + #[serde(rename = "authentik_stages_authenticator_validate.authenticatorvalidatestage")] + AuthentikStagesAuthenticatorValidateAuthenticatorvalidatestage, + #[serde(rename = "authentik_stages_authenticator_webauthn.authenticatorwebauthnstage")] + AuthentikStagesAuthenticatorWebauthnAuthenticatorwebauthnstage, + #[serde(rename = "authentik_stages_authenticator_webauthn.webauthndevice")] + AuthentikStagesAuthenticatorWebauthnWebauthndevice, + #[serde(rename = "authentik_stages_captcha.captchastage")] + AuthentikStagesCaptchaCaptchastage, + #[serde(rename = "authentik_stages_consent.consentstage")] + AuthentikStagesConsentConsentstage, + #[serde(rename = "authentik_stages_deny.denystage")] + AuthentikStagesDenyDenystage, + #[serde(rename = "authentik_stages_dummy.dummystage")] + AuthentikStagesDummyDummystage, + #[serde(rename = "authentik_stages_email.emailstage")] + AuthentikStagesEmailEmailstage, + #[serde(rename = "authentik_stages_identification.identificationstage")] + AuthentikStagesIdentificationIdentificationstage, + #[serde(rename = "authentik_stages_invitation.invitationstage")] + AuthentikStagesInvitationInvitationstage, + #[serde(rename = "authentik_stages_invitation.invitation")] + AuthentikStagesInvitationInvitation, + #[serde(rename = "authentik_stages_password.passwordstage")] + AuthentikStagesPasswordPasswordstage, + #[serde(rename = "authentik_stages_prompt.prompt")] + AuthentikStagesPromptPrompt, + #[serde(rename = "authentik_stages_prompt.promptstage")] + AuthentikStagesPromptPromptstage, + #[serde(rename = "authentik_stages_redirect.redirectstage")] + AuthentikStagesRedirectRedirectstage, + #[serde(rename = "authentik_stages_user_delete.userdeletestage")] + AuthentikStagesUserDeleteUserdeletestage, + #[serde(rename = "authentik_stages_user_login.userloginstage")] + AuthentikStagesUserLoginUserloginstage, + #[serde(rename = "authentik_stages_user_logout.userlogoutstage")] + AuthentikStagesUserLogoutUserlogoutstage, + #[serde(rename = "authentik_stages_user_write.userwritestage")] + AuthentikStagesUserWriteUserwritestage, + #[serde(rename = "authentik_tasks_schedules.schedule")] + AuthentikTasksSchedulesSchedule, + #[serde(rename = "authentik_brands.brand")] + AuthentikBrandsBrand, + #[serde(rename = "authentik_blueprints.blueprintinstance")] + AuthentikBlueprintsBlueprintinstance, + #[serde(rename = "authentik_endpoints_connectors_fleet.fleetconnector")] + AuthentikEndpointsConnectorsFleetFleetconnector, + #[serde(rename = "authentik_endpoints_connectors_google_chrome.googlechromeconnector")] + AuthentikEndpointsConnectorsGoogleChromeGooglechromeconnector, + #[serde(rename = "authentik_lifecycle.lifecyclerule")] + AuthentikLifecycleLifecyclerule, + #[serde(rename = "authentik_lifecycle.lifecycleiteration")] + AuthentikLifecycleLifecycleiteration, + #[serde(rename = "authentik_lifecycle.review")] + AuthentikLifecycleReview, + #[serde(rename = "authentik_policies_unique_password.uniquepasswordpolicy")] + AuthentikPoliciesUniquePasswordUniquepasswordpolicy, + #[serde(rename = "authentik_providers_google_workspace.googleworkspaceprovider")] + AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovider, + #[serde(rename = "authentik_providers_google_workspace.googleworkspaceprovidermapping")] + AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovidermapping, + #[serde(rename = "authentik_providers_microsoft_entra.microsoftentraprovider")] + AuthentikProvidersMicrosoftEntraMicrosoftentraprovider, + #[serde(rename = "authentik_providers_microsoft_entra.microsoftentraprovidermapping")] + AuthentikProvidersMicrosoftEntraMicrosoftentraprovidermapping, + #[serde(rename = "authentik_providers_ssf.ssfprovider")] + AuthentikProvidersSsfSsfprovider, + #[serde(rename = "authentik_providers_ws_federation.wsfederationprovider")] + AuthentikProvidersWsFederationWsfederationprovider, + #[serde(rename = "authentik_reports.dataexport")] + AuthentikReportsDataexport, + #[serde(rename = "authentik_stages_authenticator_endpoint_gdtc.authenticatorendpointgdtcstage")] + AuthentikStagesAuthenticatorEndpointGdtcAuthenticatorendpointgdtcstage, + #[serde(rename = "authentik_stages_mtls.mutualtlsstage")] + AuthentikStagesMtlsMutualtlsstage, + #[serde(rename = "authentik_stages_source.sourcestage")] + AuthentikStagesSourceSourcestage, +} + +impl std::fmt::Display for ModelEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::AuthentikTenantsDomain => write!(f, "authentik_tenants.domain"), + Self::AuthentikCoreGroup => write!(f, "authentik_core.group"), + Self::AuthentikCoreUser => write!(f, "authentik_core.user"), + Self::AuthentikCoreApplication => write!(f, "authentik_core.application"), + Self::AuthentikCoreApplicationentitlement => { + write!(f, "authentik_core.applicationentitlement") + } + Self::AuthentikCoreToken => write!(f, "authentik_core.token"), + Self::AuthentikCryptoCertificatekeypair => { + write!(f, "authentik_crypto.certificatekeypair") + } + Self::AuthentikEndpointsDeviceuserbinding => { + write!(f, "authentik_endpoints.deviceuserbinding") + } + Self::AuthentikEndpointsDeviceaccessgroup => { + write!(f, "authentik_endpoints.deviceaccessgroup") + } + Self::AuthentikEndpointsEndpointstage => write!(f, "authentik_endpoints.endpointstage"), + Self::AuthentikEndpointsConnectorsAgentAgentconnector => { + write!(f, "authentik_endpoints_connectors_agent.agentconnector") + } + Self::AuthentikEndpointsConnectorsAgentAgentdeviceuserbinding => write!( + f, + "authentik_endpoints_connectors_agent.agentdeviceuserbinding" + ), + Self::AuthentikEndpointsConnectorsAgentEnrollmenttoken => { + write!(f, "authentik_endpoints_connectors_agent.enrollmenttoken") + } + Self::AuthentikEnterpriseLicense => write!(f, "authentik_enterprise.license"), + Self::AuthentikEventsEvent => write!(f, "authentik_events.event"), + Self::AuthentikEventsNotificationtransport => { + write!(f, "authentik_events.notificationtransport") + } + Self::AuthentikEventsNotification => write!(f, "authentik_events.notification"), + Self::AuthentikEventsNotificationrule => write!(f, "authentik_events.notificationrule"), + Self::AuthentikEventsNotificationwebhookmapping => { + write!(f, "authentik_events.notificationwebhookmapping") + } + Self::AuthentikFlowsFlow => write!(f, "authentik_flows.flow"), + Self::AuthentikFlowsFlowstagebinding => write!(f, "authentik_flows.flowstagebinding"), + Self::AuthentikOutpostsDockerserviceconnection => { + write!(f, "authentik_outposts.dockerserviceconnection") + } + Self::AuthentikOutpostsKubernetesserviceconnection => { + write!(f, "authentik_outposts.kubernetesserviceconnection") + } + Self::AuthentikOutpostsOutpost => write!(f, "authentik_outposts.outpost"), + Self::AuthentikPoliciesDummyDummypolicy => { + write!(f, "authentik_policies_dummy.dummypolicy") + } + Self::AuthentikPoliciesEventMatcherEventmatcherpolicy => { + write!(f, "authentik_policies_event_matcher.eventmatcherpolicy") + } + Self::AuthentikPoliciesExpiryPasswordexpirypolicy => { + write!(f, "authentik_policies_expiry.passwordexpirypolicy") + } + Self::AuthentikPoliciesExpressionExpressionpolicy => { + write!(f, "authentik_policies_expression.expressionpolicy") + } + Self::AuthentikPoliciesGeoipGeoippolicy => { + write!(f, "authentik_policies_geoip.geoippolicy") + } + Self::AuthentikPoliciesPasswordPasswordpolicy => { + write!(f, "authentik_policies_password.passwordpolicy") + } + Self::AuthentikPoliciesReputationReputationpolicy => { + write!(f, "authentik_policies_reputation.reputationpolicy") + } + Self::AuthentikPoliciesPolicybinding => write!(f, "authentik_policies.policybinding"), + Self::AuthentikProvidersLdapLdapprovider => { + write!(f, "authentik_providers_ldap.ldapprovider") + } + Self::AuthentikProvidersOauth2Scopemapping => { + write!(f, "authentik_providers_oauth2.scopemapping") + } + Self::AuthentikProvidersOauth2Oauth2provider => { + write!(f, "authentik_providers_oauth2.oauth2provider") + } + Self::AuthentikProvidersProxyProxyprovider => { + write!(f, "authentik_providers_proxy.proxyprovider") + } + Self::AuthentikProvidersRacRacprovider => { + write!(f, "authentik_providers_rac.racprovider") + } + Self::AuthentikProvidersRacEndpoint => write!(f, "authentik_providers_rac.endpoint"), + Self::AuthentikProvidersRacRacpropertymapping => { + write!(f, "authentik_providers_rac.racpropertymapping") + } + Self::AuthentikProvidersRadiusRadiusprovider => { + write!(f, "authentik_providers_radius.radiusprovider") + } + Self::AuthentikProvidersRadiusRadiusproviderpropertymapping => write!( + f, + "authentik_providers_radius.radiusproviderpropertymapping" + ), + Self::AuthentikProvidersSamlSamlprovider => { + write!(f, "authentik_providers_saml.samlprovider") + } + Self::AuthentikProvidersSamlSamlpropertymapping => { + write!(f, "authentik_providers_saml.samlpropertymapping") + } + Self::AuthentikProvidersScimScimprovider => { + write!(f, "authentik_providers_scim.scimprovider") + } + Self::AuthentikProvidersScimScimmapping => { + write!(f, "authentik_providers_scim.scimmapping") + } + Self::AuthentikRbacRole => write!(f, "authentik_rbac.role"), + Self::AuthentikRbacInitialpermissions => write!(f, "authentik_rbac.initialpermissions"), + Self::AuthentikSourcesKerberosKerberossource => { + write!(f, "authentik_sources_kerberos.kerberossource") + } + Self::AuthentikSourcesKerberosKerberossourcepropertymapping => write!( + f, + "authentik_sources_kerberos.kerberossourcepropertymapping" + ), + Self::AuthentikSourcesKerberosUserkerberossourceconnection => { + write!(f, "authentik_sources_kerberos.userkerberossourceconnection") + } + Self::AuthentikSourcesKerberosGroupkerberossourceconnection => write!( + f, + "authentik_sources_kerberos.groupkerberossourceconnection" + ), + Self::AuthentikSourcesLdapLdapsource => write!(f, "authentik_sources_ldap.ldapsource"), + Self::AuthentikSourcesLdapLdapsourcepropertymapping => { + write!(f, "authentik_sources_ldap.ldapsourcepropertymapping") + } + Self::AuthentikSourcesLdapUserldapsourceconnection => { + write!(f, "authentik_sources_ldap.userldapsourceconnection") + } + Self::AuthentikSourcesLdapGroupldapsourceconnection => { + write!(f, "authentik_sources_ldap.groupldapsourceconnection") + } + Self::AuthentikSourcesOauthOauthsource => { + write!(f, "authentik_sources_oauth.oauthsource") + } + Self::AuthentikSourcesOauthOauthsourcepropertymapping => { + write!(f, "authentik_sources_oauth.oauthsourcepropertymapping") + } + Self::AuthentikSourcesOauthUseroauthsourceconnection => { + write!(f, "authentik_sources_oauth.useroauthsourceconnection") + } + Self::AuthentikSourcesOauthGroupoauthsourceconnection => { + write!(f, "authentik_sources_oauth.groupoauthsourceconnection") + } + Self::AuthentikSourcesPlexPlexsource => write!(f, "authentik_sources_plex.plexsource"), + Self::AuthentikSourcesPlexPlexsourcepropertymapping => { + write!(f, "authentik_sources_plex.plexsourcepropertymapping") + } + Self::AuthentikSourcesPlexUserplexsourceconnection => { + write!(f, "authentik_sources_plex.userplexsourceconnection") + } + Self::AuthentikSourcesPlexGroupplexsourceconnection => { + write!(f, "authentik_sources_plex.groupplexsourceconnection") + } + Self::AuthentikSourcesSamlSamlsource => write!(f, "authentik_sources_saml.samlsource"), + Self::AuthentikSourcesSamlSamlsourcepropertymapping => { + write!(f, "authentik_sources_saml.samlsourcepropertymapping") + } + Self::AuthentikSourcesSamlUsersamlsourceconnection => { + write!(f, "authentik_sources_saml.usersamlsourceconnection") + } + Self::AuthentikSourcesSamlGroupsamlsourceconnection => { + write!(f, "authentik_sources_saml.groupsamlsourceconnection") + } + Self::AuthentikSourcesScimScimsource => write!(f, "authentik_sources_scim.scimsource"), + Self::AuthentikSourcesScimScimsourcepropertymapping => { + write!(f, "authentik_sources_scim.scimsourcepropertymapping") + } + Self::AuthentikSourcesTelegramTelegramsource => { + write!(f, "authentik_sources_telegram.telegramsource") + } + Self::AuthentikSourcesTelegramTelegramsourcepropertymapping => write!( + f, + "authentik_sources_telegram.telegramsourcepropertymapping" + ), + Self::AuthentikSourcesTelegramUsertelegramsourceconnection => { + write!(f, "authentik_sources_telegram.usertelegramsourceconnection") + } + Self::AuthentikSourcesTelegramGrouptelegramsourceconnection => write!( + f, + "authentik_sources_telegram.grouptelegramsourceconnection" + ), + Self::AuthentikStagesAuthenticatorDuoAuthenticatorduostage => write!( + f, + "authentik_stages_authenticator_duo.authenticatorduostage" + ), + Self::AuthentikStagesAuthenticatorDuoDuodevice => { + write!(f, "authentik_stages_authenticator_duo.duodevice") + } + Self::AuthentikStagesAuthenticatorEmailAuthenticatoremailstage => write!( + f, + "authentik_stages_authenticator_email.authenticatoremailstage" + ), + Self::AuthentikStagesAuthenticatorEmailEmaildevice => { + write!(f, "authentik_stages_authenticator_email.emaildevice") + } + Self::AuthentikStagesAuthenticatorSmsAuthenticatorsmsstage => write!( + f, + "authentik_stages_authenticator_sms.authenticatorsmsstage" + ), + Self::AuthentikStagesAuthenticatorSmsSmsdevice => { + write!(f, "authentik_stages_authenticator_sms.smsdevice") + } + Self::AuthentikStagesAuthenticatorStaticAuthenticatorstaticstage => write!( + f, + "authentik_stages_authenticator_static.authenticatorstaticstage" + ), + Self::AuthentikStagesAuthenticatorStaticStaticdevice => { + write!(f, "authentik_stages_authenticator_static.staticdevice") + } + Self::AuthentikStagesAuthenticatorTotpAuthenticatortotpstage => write!( + f, + "authentik_stages_authenticator_totp.authenticatortotpstage" + ), + Self::AuthentikStagesAuthenticatorTotpTotpdevice => { + write!(f, "authentik_stages_authenticator_totp.totpdevice") + } + Self::AuthentikStagesAuthenticatorValidateAuthenticatorvalidatestage => write!( + f, + "authentik_stages_authenticator_validate.authenticatorvalidatestage" + ), + Self::AuthentikStagesAuthenticatorWebauthnAuthenticatorwebauthnstage => write!( + f, + "authentik_stages_authenticator_webauthn.authenticatorwebauthnstage" + ), + Self::AuthentikStagesAuthenticatorWebauthnWebauthndevice => { + write!(f, "authentik_stages_authenticator_webauthn.webauthndevice") + } + Self::AuthentikStagesCaptchaCaptchastage => { + write!(f, "authentik_stages_captcha.captchastage") + } + Self::AuthentikStagesConsentConsentstage => { + write!(f, "authentik_stages_consent.consentstage") + } + Self::AuthentikStagesDenyDenystage => write!(f, "authentik_stages_deny.denystage"), + Self::AuthentikStagesDummyDummystage => write!(f, "authentik_stages_dummy.dummystage"), + Self::AuthentikStagesEmailEmailstage => write!(f, "authentik_stages_email.emailstage"), + Self::AuthentikStagesIdentificationIdentificationstage => { + write!(f, "authentik_stages_identification.identificationstage") + } + Self::AuthentikStagesInvitationInvitationstage => { + write!(f, "authentik_stages_invitation.invitationstage") + } + Self::AuthentikStagesInvitationInvitation => { + write!(f, "authentik_stages_invitation.invitation") + } + Self::AuthentikStagesPasswordPasswordstage => { + write!(f, "authentik_stages_password.passwordstage") + } + Self::AuthentikStagesPromptPrompt => write!(f, "authentik_stages_prompt.prompt"), + Self::AuthentikStagesPromptPromptstage => { + write!(f, "authentik_stages_prompt.promptstage") + } + Self::AuthentikStagesRedirectRedirectstage => { + write!(f, "authentik_stages_redirect.redirectstage") + } + Self::AuthentikStagesUserDeleteUserdeletestage => { + write!(f, "authentik_stages_user_delete.userdeletestage") + } + Self::AuthentikStagesUserLoginUserloginstage => { + write!(f, "authentik_stages_user_login.userloginstage") + } + Self::AuthentikStagesUserLogoutUserlogoutstage => { + write!(f, "authentik_stages_user_logout.userlogoutstage") + } + Self::AuthentikStagesUserWriteUserwritestage => { + write!(f, "authentik_stages_user_write.userwritestage") + } + Self::AuthentikTasksSchedulesSchedule => { + write!(f, "authentik_tasks_schedules.schedule") + } + Self::AuthentikBrandsBrand => write!(f, "authentik_brands.brand"), + Self::AuthentikBlueprintsBlueprintinstance => { + write!(f, "authentik_blueprints.blueprintinstance") + } + Self::AuthentikEndpointsConnectorsFleetFleetconnector => { + write!(f, "authentik_endpoints_connectors_fleet.fleetconnector") + } + Self::AuthentikEndpointsConnectorsGoogleChromeGooglechromeconnector => write!( + f, + "authentik_endpoints_connectors_google_chrome.googlechromeconnector" + ), + Self::AuthentikLifecycleLifecyclerule => write!(f, "authentik_lifecycle.lifecyclerule"), + Self::AuthentikLifecycleLifecycleiteration => { + write!(f, "authentik_lifecycle.lifecycleiteration") + } + Self::AuthentikLifecycleReview => write!(f, "authentik_lifecycle.review"), + Self::AuthentikPoliciesUniquePasswordUniquepasswordpolicy => { + write!(f, "authentik_policies_unique_password.uniquepasswordpolicy") + } + Self::AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovider => write!( + f, + "authentik_providers_google_workspace.googleworkspaceprovider" + ), + Self::AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovidermapping => write!( + f, + "authentik_providers_google_workspace.googleworkspaceprovidermapping" + ), + Self::AuthentikProvidersMicrosoftEntraMicrosoftentraprovider => write!( + f, + "authentik_providers_microsoft_entra.microsoftentraprovider" + ), + Self::AuthentikProvidersMicrosoftEntraMicrosoftentraprovidermapping => write!( + f, + "authentik_providers_microsoft_entra.microsoftentraprovidermapping" + ), + Self::AuthentikProvidersSsfSsfprovider => { + write!(f, "authentik_providers_ssf.ssfprovider") + } + Self::AuthentikProvidersWsFederationWsfederationprovider => { + write!(f, "authentik_providers_ws_federation.wsfederationprovider") + } + Self::AuthentikReportsDataexport => write!(f, "authentik_reports.dataexport"), + Self::AuthentikStagesAuthenticatorEndpointGdtcAuthenticatorendpointgdtcstage => write!( + f, + "authentik_stages_authenticator_endpoint_gdtc.authenticatorendpointgdtcstage" + ), + Self::AuthentikStagesMtlsMutualtlsstage => { + write!(f, "authentik_stages_mtls.mutualtlsstage") + } + Self::AuthentikStagesSourceSourcestage => { + write!(f, "authentik_stages_source.sourcestage") + } + } + } +} + +impl Default for ModelEnum { + fn default() -> ModelEnum { + Self::AuthentikTenantsDomain + } +} diff --git a/packages/client-rust/src/models/model_request.rs b/packages/client-rust/src/models/model_request.rs new file mode 100644 index 0000000000..d1a004cd9f --- /dev/null +++ b/packages/client-rust/src/models/model_request.rs @@ -0,0 +1,46 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(tag = "provider_model")] +pub enum ModelRequest { + #[serde(rename = "authentik_providers_google_workspace.googleworkspaceprovider")] + AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovider( + models::GoogleWorkspaceProviderRequest, + ), + #[serde(rename = "authentik_providers_ldap.ldapprovider")] + AuthentikProvidersLdapLdapprovider(models::LdapProviderRequest), + #[serde(rename = "authentik_providers_microsoft_entra.microsoftentraprovider")] + AuthentikProvidersMicrosoftEntraMicrosoftentraprovider(models::MicrosoftEntraProviderRequest), + #[serde(rename = "authentik_providers_oauth2.oauth2provider")] + AuthentikProvidersOauth2Oauth2provider(models::OAuth2ProviderRequest), + #[serde(rename = "authentik_providers_proxy.proxyprovider")] + AuthentikProvidersProxyProxyprovider(models::ProxyProviderRequest), + #[serde(rename = "authentik_providers_rac.racprovider")] + AuthentikProvidersRacRacprovider(models::RacProviderRequest), + #[serde(rename = "authentik_providers_radius.radiusprovider")] + AuthentikProvidersRadiusRadiusprovider(models::RadiusProviderRequest), + #[serde(rename = "authentik_providers_saml.samlprovider")] + AuthentikProvidersSamlSamlprovider(models::SamlProviderRequest), + #[serde(rename = "authentik_providers_scim.scimprovider")] + AuthentikProvidersScimScimprovider(models::ScimProviderRequest), + #[serde(rename = "authentik_providers_ssf.ssfprovider")] + AuthentikProvidersSsfSsfprovider(models::SsfProviderRequest), + #[serde(rename = "authentik_providers_ws_federation.wsfederationprovider")] + AuthentikProvidersWsFederationWsfederationprovider(models::WsFederationProviderRequest), +} + +impl Default for ModelRequest { + fn default() -> Self { + Self::AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovider(Default::default()) + } +} diff --git a/packages/client-rust/src/models/mutual_tls_stage.rs b/packages/client-rust/src/models/mutual_tls_stage.rs new file mode 100644 index 0000000000..f291f6ec12 --- /dev/null +++ b/packages/client-rust/src/models/mutual_tls_stage.rs @@ -0,0 +1,77 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// MutualTlsStage : MutualTLSStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MutualTlsStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + #[serde(rename = "mode")] + pub mode: models::StageModeEnum, + /// Configure certificate authorities to validate the certificate against. This option has a + /// higher priority than the `client_certificate` option on `Brand`. + #[serde( + rename = "certificate_authorities", + skip_serializing_if = "Option::is_none" + )] + pub certificate_authorities: Option>, + #[serde(rename = "cert_attribute")] + pub cert_attribute: models::CertAttributeEnum, + #[serde(rename = "user_attribute")] + pub user_attribute: models::UserAttributeEnum, +} + +impl MutualTlsStage { + /// MutualTLSStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + mode: models::StageModeEnum, + cert_attribute: models::CertAttributeEnum, + user_attribute: models::UserAttributeEnum, + ) -> MutualTlsStage { + MutualTlsStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + mode, + certificate_authorities: None, + cert_attribute, + user_attribute, + } + } +} diff --git a/packages/client-rust/src/models/mutual_tls_stage_request.rs b/packages/client-rust/src/models/mutual_tls_stage_request.rs new file mode 100644 index 0000000000..44be8f7fef --- /dev/null +++ b/packages/client-rust/src/models/mutual_tls_stage_request.rs @@ -0,0 +1,49 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// MutualTlsStageRequest : MutualTLSStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct MutualTlsStageRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "mode")] + pub mode: models::StageModeEnum, + /// Configure certificate authorities to validate the certificate against. This option has a + /// higher priority than the `client_certificate` option on `Brand`. + #[serde( + rename = "certificate_authorities", + skip_serializing_if = "Option::is_none" + )] + pub certificate_authorities: Option>, + #[serde(rename = "cert_attribute")] + pub cert_attribute: models::CertAttributeEnum, + #[serde(rename = "user_attribute")] + pub user_attribute: models::UserAttributeEnum, +} + +impl MutualTlsStageRequest { + /// MutualTLSStage Serializer + pub fn new( + name: String, + mode: models::StageModeEnum, + cert_attribute: models::CertAttributeEnum, + user_attribute: models::UserAttributeEnum, + ) -> MutualTlsStageRequest { + MutualTlsStageRequest { + name, + mode, + certificate_authorities: None, + cert_attribute, + user_attribute, + } + } +} diff --git a/packages/client-rust/src/models/native_logout_challenge.rs b/packages/client-rust/src/models/native_logout_challenge.rs new file mode 100644 index 0000000000..a17b242b96 --- /dev/null +++ b/packages/client-rust/src/models/native_logout_challenge.rs @@ -0,0 +1,57 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// NativeLogoutChallenge : Challenge for native browser logout +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NativeLogoutChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "provider_name", skip_serializing_if = "Option::is_none")] + pub provider_name: Option, + #[serde(rename = "is_complete", skip_serializing_if = "Option::is_none")] + pub is_complete: Option, + #[serde(rename = "post_url", skip_serializing_if = "Option::is_none")] + pub post_url: Option, + #[serde(rename = "redirect_url", skip_serializing_if = "Option::is_none")] + pub redirect_url: Option, + #[serde(rename = "saml_binding", skip_serializing_if = "Option::is_none")] + pub saml_binding: Option, + #[serde(rename = "saml_request", skip_serializing_if = "Option::is_none")] + pub saml_request: Option, + #[serde(rename = "saml_response", skip_serializing_if = "Option::is_none")] + pub saml_response: Option, + #[serde(rename = "saml_relay_state", skip_serializing_if = "Option::is_none")] + pub saml_relay_state: Option, +} + +impl NativeLogoutChallenge { + /// Challenge for native browser logout + pub fn new() -> NativeLogoutChallenge { + NativeLogoutChallenge { + flow_info: None, + component: None, + response_errors: None, + provider_name: None, + is_complete: None, + post_url: None, + redirect_url: None, + saml_binding: None, + saml_request: None, + saml_response: None, + saml_relay_state: None, + } + } +} diff --git a/packages/client-rust/src/models/native_logout_challenge_response_request.rs b/packages/client-rust/src/models/native_logout_challenge_response_request.rs new file mode 100644 index 0000000000..86e9436c3e --- /dev/null +++ b/packages/client-rust/src/models/native_logout_challenge_response_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// NativeLogoutChallengeResponseRequest : Response for native browser logout +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NativeLogoutChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, +} + +impl NativeLogoutChallengeResponseRequest { + /// Response for native browser logout + pub fn new() -> NativeLogoutChallengeResponseRequest { + NativeLogoutChallengeResponseRequest { component: None } + } +} diff --git a/packages/client-rust/src/models/network.rs b/packages/client-rust/src/models/network.rs new file mode 100644 index 0000000000..cde8548df8 --- /dev/null +++ b/packages/client-rust/src/models/network.rs @@ -0,0 +1,34 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Network { + #[serde(rename = "hostname")] + pub hostname: String, + #[serde(rename = "firewall_enabled", skip_serializing_if = "Option::is_none")] + pub firewall_enabled: Option, + #[serde(rename = "interfaces")] + pub interfaces: Vec, + #[serde(rename = "gateway", skip_serializing_if = "Option::is_none")] + pub gateway: Option, +} + +impl Network { + pub fn new(hostname: String, interfaces: Vec) -> Network { + Network { + hostname, + firewall_enabled: None, + interfaces, + gateway: None, + } + } +} diff --git a/packages/client-rust/src/models/network_binding_enum.rs b/packages/client-rust/src/models/network_binding_enum.rs new file mode 100644 index 0000000000..8a781f4eeb --- /dev/null +++ b/packages/client-rust/src/models/network_binding_enum.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum NetworkBindingEnum { + #[serde(rename = "no_binding")] + NoBinding, + #[serde(rename = "bind_asn")] + BindAsn, + #[serde(rename = "bind_asn_network")] + BindAsnNetwork, + #[serde(rename = "bind_asn_network_ip")] + BindAsnNetworkIp, +} + +impl std::fmt::Display for NetworkBindingEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::NoBinding => write!(f, "no_binding"), + Self::BindAsn => write!(f, "bind_asn"), + Self::BindAsnNetwork => write!(f, "bind_asn_network"), + Self::BindAsnNetworkIp => write!(f, "bind_asn_network_ip"), + } + } +} + +impl Default for NetworkBindingEnum { + fn default() -> NetworkBindingEnum { + Self::NoBinding + } +} diff --git a/packages/client-rust/src/models/network_interface.rs b/packages/client-rust/src/models/network_interface.rs new file mode 100644 index 0000000000..fe3815e330 --- /dev/null +++ b/packages/client-rust/src/models/network_interface.rs @@ -0,0 +1,34 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NetworkInterface { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "hardware_address")] + pub hardware_address: String, + #[serde(rename = "ip_addresses", skip_serializing_if = "Option::is_none")] + pub ip_addresses: Option>, + #[serde(rename = "dns_servers", skip_serializing_if = "Option::is_none")] + pub dns_servers: Option>, +} + +impl NetworkInterface { + pub fn new(name: String, hardware_address: String) -> NetworkInterface { + NetworkInterface { + name, + hardware_address, + ip_addresses: None, + dns_servers: None, + } + } +} diff --git a/packages/client-rust/src/models/network_interface_request.rs b/packages/client-rust/src/models/network_interface_request.rs new file mode 100644 index 0000000000..2614aa934b --- /dev/null +++ b/packages/client-rust/src/models/network_interface_request.rs @@ -0,0 +1,34 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NetworkInterfaceRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "hardware_address")] + pub hardware_address: String, + #[serde(rename = "ip_addresses", skip_serializing_if = "Option::is_none")] + pub ip_addresses: Option>, + #[serde(rename = "dns_servers", skip_serializing_if = "Option::is_none")] + pub dns_servers: Option>, +} + +impl NetworkInterfaceRequest { + pub fn new(name: String, hardware_address: String) -> NetworkInterfaceRequest { + NetworkInterfaceRequest { + name, + hardware_address, + ip_addresses: None, + dns_servers: None, + } + } +} diff --git a/packages/client-rust/src/models/network_request.rs b/packages/client-rust/src/models/network_request.rs new file mode 100644 index 0000000000..d5b52e93e7 --- /dev/null +++ b/packages/client-rust/src/models/network_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NetworkRequest { + #[serde(rename = "hostname")] + pub hostname: String, + #[serde(rename = "firewall_enabled", skip_serializing_if = "Option::is_none")] + pub firewall_enabled: Option, + #[serde(rename = "interfaces")] + pub interfaces: Vec, + #[serde(rename = "gateway", skip_serializing_if = "Option::is_none")] + pub gateway: Option, +} + +impl NetworkRequest { + pub fn new( + hostname: String, + interfaces: Vec, + ) -> NetworkRequest { + NetworkRequest { + hostname, + firewall_enabled: None, + interfaces, + gateway: None, + } + } +} diff --git a/packages/client-rust/src/models/not_configured_action_enum.rs b/packages/client-rust/src/models/not_configured_action_enum.rs new file mode 100644 index 0000000000..664b9b2520 --- /dev/null +++ b/packages/client-rust/src/models/not_configured_action_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum NotConfiguredActionEnum { + #[serde(rename = "skip")] + Skip, + #[serde(rename = "deny")] + Deny, + #[serde(rename = "configure")] + Configure, +} + +impl std::fmt::Display for NotConfiguredActionEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Skip => write!(f, "skip"), + Self::Deny => write!(f, "deny"), + Self::Configure => write!(f, "configure"), + } + } +} + +impl Default for NotConfiguredActionEnum { + fn default() -> NotConfiguredActionEnum { + Self::Skip + } +} diff --git a/packages/client-rust/src/models/notification.rs b/packages/client-rust/src/models/notification.rs new file mode 100644 index 0000000000..579c503412 --- /dev/null +++ b/packages/client-rust/src/models/notification.rs @@ -0,0 +1,63 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Notification : Notification Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Notification { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "severity")] + pub severity: models::SeverityEnum, + #[serde(rename = "body")] + pub body: String, + #[serde( + rename = "hyperlink", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub hyperlink: Option>, + #[serde( + rename = "hyperlink_label", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub hyperlink_label: Option>, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "event", skip_serializing_if = "Option::is_none")] + pub event: Option, + #[serde(rename = "seen", skip_serializing_if = "Option::is_none")] + pub seen: Option, +} + +impl Notification { + /// Notification Serializer + pub fn new( + pk: uuid::Uuid, + severity: models::SeverityEnum, + body: String, + created: String, + ) -> Notification { + Notification { + pk, + severity, + body, + hyperlink: None, + hyperlink_label: None, + created, + event: None, + seen: None, + } + } +} diff --git a/packages/client-rust/src/models/notification_request.rs b/packages/client-rust/src/models/notification_request.rs new file mode 100644 index 0000000000..d8839c301d --- /dev/null +++ b/packages/client-rust/src/models/notification_request.rs @@ -0,0 +1,46 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// NotificationRequest : Notification Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NotificationRequest { + #[serde( + rename = "hyperlink", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub hyperlink: Option>, + #[serde( + rename = "hyperlink_label", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub hyperlink_label: Option>, + #[serde(rename = "event", skip_serializing_if = "Option::is_none")] + pub event: Option, + #[serde(rename = "seen", skip_serializing_if = "Option::is_none")] + pub seen: Option, +} + +impl NotificationRequest { + /// Notification Serializer + pub fn new() -> NotificationRequest { + NotificationRequest { + hyperlink: None, + hyperlink_label: None, + event: None, + seen: None, + } + } +} diff --git a/packages/client-rust/src/models/notification_rule.rs b/packages/client-rust/src/models/notification_rule.rs new file mode 100644 index 0000000000..4dc31e9856 --- /dev/null +++ b/packages/client-rust/src/models/notification_rule.rs @@ -0,0 +1,64 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// NotificationRule : NotificationRule Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NotificationRule { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Select which transports should be used to notify the user. If none are selected, the + /// notification will only be shown in the authentik UI. + #[serde(rename = "transports", skip_serializing_if = "Option::is_none")] + pub transports: Option>, + /// Controls which severity level the created notifications will have. + #[serde(rename = "severity", skip_serializing_if = "Option::is_none")] + pub severity: Option, + /// Define which group of users this notification should be sent and shown to. If left empty, + /// Notification won't ben sent. + #[serde( + rename = "destination_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub destination_group: Option>, + #[serde(rename = "destination_group_obj")] + pub destination_group_obj: models::Group, + /// When enabled, notification will be sent to user the user that triggered the event.When + /// destination_group is configured, notification is sent to both. + #[serde( + rename = "destination_event_user", + skip_serializing_if = "Option::is_none" + )] + pub destination_event_user: Option, +} + +impl NotificationRule { + /// NotificationRule Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + destination_group_obj: models::Group, + ) -> NotificationRule { + NotificationRule { + pk, + name, + transports: None, + severity: None, + destination_group: None, + destination_group_obj, + destination_event_user: None, + } + } +} diff --git a/packages/client-rust/src/models/notification_rule_request.rs b/packages/client-rust/src/models/notification_rule_request.rs new file mode 100644 index 0000000000..2d5551ce87 --- /dev/null +++ b/packages/client-rust/src/models/notification_rule_request.rs @@ -0,0 +1,54 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// NotificationRuleRequest : NotificationRule Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NotificationRuleRequest { + #[serde(rename = "name")] + pub name: String, + /// Select which transports should be used to notify the user. If none are selected, the + /// notification will only be shown in the authentik UI. + #[serde(rename = "transports", skip_serializing_if = "Option::is_none")] + pub transports: Option>, + /// Controls which severity level the created notifications will have. + #[serde(rename = "severity", skip_serializing_if = "Option::is_none")] + pub severity: Option, + /// Define which group of users this notification should be sent and shown to. If left empty, + /// Notification won't ben sent. + #[serde( + rename = "destination_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub destination_group: Option>, + /// When enabled, notification will be sent to user the user that triggered the event.When + /// destination_group is configured, notification is sent to both. + #[serde( + rename = "destination_event_user", + skip_serializing_if = "Option::is_none" + )] + pub destination_event_user: Option, +} + +impl NotificationRuleRequest { + /// NotificationRule Serializer + pub fn new(name: String) -> NotificationRuleRequest { + NotificationRuleRequest { + name, + transports: None, + severity: None, + destination_group: None, + destination_event_user: None, + } + } +} diff --git a/packages/client-rust/src/models/notification_transport.rs b/packages/client-rust/src/models/notification_transport.rs new file mode 100644 index 0000000000..b0a06446f1 --- /dev/null +++ b/packages/client-rust/src/models/notification_transport.rs @@ -0,0 +1,82 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// NotificationTransport : NotificationTransport Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NotificationTransport { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// Return selected mode with a UI Label + #[serde(rename = "mode_verbose")] + pub mode_verbose: String, + #[serde(rename = "webhook_url", skip_serializing_if = "Option::is_none")] + pub webhook_url: Option, + /// When set, the selected ceritifcate is used to validate the certificate of the webhook + /// server. + #[serde( + rename = "webhook_ca", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub webhook_ca: Option>, + /// Customize the body of the request. Mapping should return data that is JSON-serializable. + #[serde( + rename = "webhook_mapping_body", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub webhook_mapping_body: Option>, + /// Configure additional headers to be sent. Mapping should return a dictionary of key-value + /// pairs + #[serde( + rename = "webhook_mapping_headers", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub webhook_mapping_headers: Option>, + #[serde( + rename = "email_subject_prefix", + skip_serializing_if = "Option::is_none" + )] + pub email_subject_prefix: Option, + #[serde(rename = "email_template", skip_serializing_if = "Option::is_none")] + pub email_template: Option, + /// Only send notification once, for example when sending a webhook into a chat channel. + #[serde(rename = "send_once", skip_serializing_if = "Option::is_none")] + pub send_once: Option, +} + +impl NotificationTransport { + /// NotificationTransport Serializer + pub fn new(pk: uuid::Uuid, name: String, mode_verbose: String) -> NotificationTransport { + NotificationTransport { + pk, + name, + mode: None, + mode_verbose, + webhook_url: None, + webhook_ca: None, + webhook_mapping_body: None, + webhook_mapping_headers: None, + email_subject_prefix: None, + email_template: None, + send_once: None, + } + } +} diff --git a/packages/client-rust/src/models/notification_transport_mode_enum.rs b/packages/client-rust/src/models/notification_transport_mode_enum.rs new file mode 100644 index 0000000000..b6850c52ee --- /dev/null +++ b/packages/client-rust/src/models/notification_transport_mode_enum.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum NotificationTransportModeEnum { + #[serde(rename = "local")] + Local, + #[serde(rename = "webhook")] + Webhook, + #[serde(rename = "webhook_slack")] + WebhookSlack, + #[serde(rename = "email")] + Email, +} + +impl std::fmt::Display for NotificationTransportModeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Local => write!(f, "local"), + Self::Webhook => write!(f, "webhook"), + Self::WebhookSlack => write!(f, "webhook_slack"), + Self::Email => write!(f, "email"), + } + } +} + +impl Default for NotificationTransportModeEnum { + fn default() -> NotificationTransportModeEnum { + Self::Local + } +} diff --git a/packages/client-rust/src/models/notification_transport_request.rs b/packages/client-rust/src/models/notification_transport_request.rs new file mode 100644 index 0000000000..d9b80005d8 --- /dev/null +++ b/packages/client-rust/src/models/notification_transport_request.rs @@ -0,0 +1,75 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// NotificationTransportRequest : NotificationTransport Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NotificationTransportRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, + #[serde(rename = "webhook_url", skip_serializing_if = "Option::is_none")] + pub webhook_url: Option, + /// When set, the selected ceritifcate is used to validate the certificate of the webhook + /// server. + #[serde( + rename = "webhook_ca", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub webhook_ca: Option>, + /// Customize the body of the request. Mapping should return data that is JSON-serializable. + #[serde( + rename = "webhook_mapping_body", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub webhook_mapping_body: Option>, + /// Configure additional headers to be sent. Mapping should return a dictionary of key-value + /// pairs + #[serde( + rename = "webhook_mapping_headers", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub webhook_mapping_headers: Option>, + #[serde( + rename = "email_subject_prefix", + skip_serializing_if = "Option::is_none" + )] + pub email_subject_prefix: Option, + #[serde(rename = "email_template", skip_serializing_if = "Option::is_none")] + pub email_template: Option, + /// Only send notification once, for example when sending a webhook into a chat channel. + #[serde(rename = "send_once", skip_serializing_if = "Option::is_none")] + pub send_once: Option, +} + +impl NotificationTransportRequest { + /// NotificationTransport Serializer + pub fn new(name: String) -> NotificationTransportRequest { + NotificationTransportRequest { + name, + mode: None, + webhook_url: None, + webhook_ca: None, + webhook_mapping_body: None, + webhook_mapping_headers: None, + email_subject_prefix: None, + email_template: None, + send_once: None, + } + } +} diff --git a/packages/client-rust/src/models/notification_transport_test.rs b/packages/client-rust/src/models/notification_transport_test.rs new file mode 100644 index 0000000000..e702e4848d --- /dev/null +++ b/packages/client-rust/src/models/notification_transport_test.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// NotificationTransportTest : Notification test serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NotificationTransportTest { + #[serde(rename = "messages")] + pub messages: Vec, +} + +impl NotificationTransportTest { + /// Notification test serializer + pub fn new(messages: Vec) -> NotificationTransportTest { + NotificationTransportTest { messages } + } +} diff --git a/packages/client-rust/src/models/notification_webhook_mapping.rs b/packages/client-rust/src/models/notification_webhook_mapping.rs new file mode 100644 index 0000000000..ce26868439 --- /dev/null +++ b/packages/client-rust/src/models/notification_webhook_mapping.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// NotificationWebhookMapping : NotificationWebhookMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NotificationWebhookMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, +} + +impl NotificationWebhookMapping { + /// NotificationWebhookMapping Serializer + pub fn new(pk: uuid::Uuid, name: String, expression: String) -> NotificationWebhookMapping { + NotificationWebhookMapping { + pk, + name, + expression, + } + } +} diff --git a/packages/client-rust/src/models/notification_webhook_mapping_request.rs b/packages/client-rust/src/models/notification_webhook_mapping_request.rs new file mode 100644 index 0000000000..171f40d017 --- /dev/null +++ b/packages/client-rust/src/models/notification_webhook_mapping_request.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// NotificationWebhookMappingRequest : NotificationWebhookMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct NotificationWebhookMappingRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, +} + +impl NotificationWebhookMappingRequest { + /// NotificationWebhookMapping Serializer + pub fn new(name: String, expression: String) -> NotificationWebhookMappingRequest { + NotificationWebhookMappingRequest { name, expression } + } +} diff --git a/packages/client-rust/src/models/o_auth2_provider.rs b/packages/client-rust/src/models/o_auth2_provider.rs new file mode 100644 index 0000000000..2b82f2e635 --- /dev/null +++ b/packages/client-rust/src/models/o_auth2_provider.rs @@ -0,0 +1,210 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OAuth2Provider : OAuth2Provider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OAuth2Provider { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow")] + pub authorization_flow: uuid::Uuid, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow")] + pub invalidation_flow: uuid::Uuid, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_name: Option, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_backchannel_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_backchannel_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_name: Option, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Confidential clients are capable of maintaining the confidentiality of their credentials. + /// Public clients are incapable + #[serde(rename = "client_type", skip_serializing_if = "Option::is_none")] + pub client_type: Option, + #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] + pub client_id: Option, + #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")] + pub client_secret: Option, + /// Access codes not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "access_code_validity", + skip_serializing_if = "Option::is_none" + )] + pub access_code_validity: Option, + /// Tokens not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "access_token_validity", + skip_serializing_if = "Option::is_none" + )] + pub access_token_validity: Option, + /// Tokens not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "refresh_token_validity", + skip_serializing_if = "Option::is_none" + )] + pub refresh_token_validity: Option, + /// When refreshing a token, if the refresh token is valid for less than this duration, it will + /// be renewed. When set to seconds=0, token will always be renewed. (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "refresh_token_threshold", + skip_serializing_if = "Option::is_none" + )] + pub refresh_token_threshold: Option, + /// Include User claims from scopes in the id_token, for applications that don't access the + /// userinfo endpoint. + #[serde( + rename = "include_claims_in_id_token", + skip_serializing_if = "Option::is_none" + )] + pub include_claims_in_id_token: Option, + /// Key used to sign the tokens. + #[serde( + rename = "signing_key", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub signing_key: Option>, + /// Key used to encrypt the tokens. When set, tokens will be encrypted and returned as JWEs. + #[serde( + rename = "encryption_key", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub encryption_key: Option>, + #[serde(rename = "redirect_uris")] + pub redirect_uris: Vec, + #[serde(rename = "logout_uri", skip_serializing_if = "Option::is_none")] + pub logout_uri: Option, + /// Backchannel logs out with server to server calls. Frontchannel uses iframes in your browser + #[serde(rename = "logout_method", skip_serializing_if = "Option::is_none")] + pub logout_method: Option, + /// Configure what data should be used as unique User Identifier. For most cases, the default + /// should be fine. + #[serde(rename = "sub_mode", skip_serializing_if = "Option::is_none")] + pub sub_mode: Option, + /// Configure how the issuer field of the ID Token should be filled. + #[serde(rename = "issuer_mode", skip_serializing_if = "Option::is_none")] + pub issuer_mode: Option, + #[serde( + rename = "jwt_federation_sources", + skip_serializing_if = "Option::is_none" + )] + pub jwt_federation_sources: Option>, + #[serde( + rename = "jwt_federation_providers", + skip_serializing_if = "Option::is_none" + )] + pub jwt_federation_providers: Option>, +} + +impl OAuth2Provider { + /// OAuth2Provider Serializer + pub fn new( + pk: i32, + name: String, + authorization_flow: uuid::Uuid, + invalidation_flow: uuid::Uuid, + component: String, + assigned_application_slug: Option, + assigned_application_name: Option, + assigned_backchannel_application_slug: Option, + assigned_backchannel_application_name: Option, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + redirect_uris: Vec, + ) -> OAuth2Provider { + OAuth2Provider { + pk, + name, + authentication_flow: None, + authorization_flow, + invalidation_flow, + property_mappings: None, + component, + assigned_application_slug, + assigned_application_name, + assigned_backchannel_application_slug, + assigned_backchannel_application_name, + verbose_name, + verbose_name_plural, + meta_model_name, + client_type: None, + client_id: None, + client_secret: None, + access_code_validity: None, + access_token_validity: None, + refresh_token_validity: None, + refresh_token_threshold: None, + include_claims_in_id_token: None, + signing_key: None, + encryption_key: None, + redirect_uris, + logout_uri: None, + logout_method: None, + sub_mode: None, + issuer_mode: None, + jwt_federation_sources: None, + jwt_federation_providers: None, + } + } +} diff --git a/packages/client-rust/src/models/o_auth2_provider_logout_method_enum.rs b/packages/client-rust/src/models/o_auth2_provider_logout_method_enum.rs new file mode 100644 index 0000000000..af23e93150 --- /dev/null +++ b/packages/client-rust/src/models/o_auth2_provider_logout_method_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum OAuth2ProviderLogoutMethodEnum { + #[serde(rename = "backchannel")] + Backchannel, + #[serde(rename = "frontchannel")] + Frontchannel, +} + +impl std::fmt::Display for OAuth2ProviderLogoutMethodEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Backchannel => write!(f, "backchannel"), + Self::Frontchannel => write!(f, "frontchannel"), + } + } +} + +impl Default for OAuth2ProviderLogoutMethodEnum { + fn default() -> OAuth2ProviderLogoutMethodEnum { + Self::Backchannel + } +} diff --git a/packages/client-rust/src/models/o_auth2_provider_request.rs b/packages/client-rust/src/models/o_auth2_provider_request.rs new file mode 100644 index 0000000000..f44486dc24 --- /dev/null +++ b/packages/client-rust/src/models/o_auth2_provider_request.rs @@ -0,0 +1,154 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OAuth2ProviderRequest : OAuth2Provider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OAuth2ProviderRequest { + #[serde(rename = "name")] + pub name: String, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow")] + pub authorization_flow: uuid::Uuid, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow")] + pub invalidation_flow: uuid::Uuid, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Confidential clients are capable of maintaining the confidentiality of their credentials. + /// Public clients are incapable + #[serde(rename = "client_type", skip_serializing_if = "Option::is_none")] + pub client_type: Option, + #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] + pub client_id: Option, + #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")] + pub client_secret: Option, + /// Access codes not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "access_code_validity", + skip_serializing_if = "Option::is_none" + )] + pub access_code_validity: Option, + /// Tokens not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "access_token_validity", + skip_serializing_if = "Option::is_none" + )] + pub access_token_validity: Option, + /// Tokens not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "refresh_token_validity", + skip_serializing_if = "Option::is_none" + )] + pub refresh_token_validity: Option, + /// When refreshing a token, if the refresh token is valid for less than this duration, it will + /// be renewed. When set to seconds=0, token will always be renewed. (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "refresh_token_threshold", + skip_serializing_if = "Option::is_none" + )] + pub refresh_token_threshold: Option, + /// Include User claims from scopes in the id_token, for applications that don't access the + /// userinfo endpoint. + #[serde( + rename = "include_claims_in_id_token", + skip_serializing_if = "Option::is_none" + )] + pub include_claims_in_id_token: Option, + /// Key used to sign the tokens. + #[serde( + rename = "signing_key", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub signing_key: Option>, + /// Key used to encrypt the tokens. When set, tokens will be encrypted and returned as JWEs. + #[serde( + rename = "encryption_key", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub encryption_key: Option>, + #[serde(rename = "redirect_uris")] + pub redirect_uris: Vec, + #[serde(rename = "logout_uri", skip_serializing_if = "Option::is_none")] + pub logout_uri: Option, + /// Backchannel logs out with server to server calls. Frontchannel uses iframes in your browser + #[serde(rename = "logout_method", skip_serializing_if = "Option::is_none")] + pub logout_method: Option, + /// Configure what data should be used as unique User Identifier. For most cases, the default + /// should be fine. + #[serde(rename = "sub_mode", skip_serializing_if = "Option::is_none")] + pub sub_mode: Option, + /// Configure how the issuer field of the ID Token should be filled. + #[serde(rename = "issuer_mode", skip_serializing_if = "Option::is_none")] + pub issuer_mode: Option, + #[serde( + rename = "jwt_federation_sources", + skip_serializing_if = "Option::is_none" + )] + pub jwt_federation_sources: Option>, + #[serde( + rename = "jwt_federation_providers", + skip_serializing_if = "Option::is_none" + )] + pub jwt_federation_providers: Option>, +} + +impl OAuth2ProviderRequest { + /// OAuth2Provider Serializer + pub fn new( + name: String, + authorization_flow: uuid::Uuid, + invalidation_flow: uuid::Uuid, + redirect_uris: Vec, + ) -> OAuth2ProviderRequest { + OAuth2ProviderRequest { + name, + authentication_flow: None, + authorization_flow, + invalidation_flow, + property_mappings: None, + client_type: None, + client_id: None, + client_secret: None, + access_code_validity: None, + access_token_validity: None, + refresh_token_validity: None, + refresh_token_threshold: None, + include_claims_in_id_token: None, + signing_key: None, + encryption_key: None, + redirect_uris, + logout_uri: None, + logout_method: None, + sub_mode: None, + issuer_mode: None, + jwt_federation_sources: None, + jwt_federation_providers: None, + } + } +} diff --git a/packages/client-rust/src/models/o_auth2_provider_setup_urls.rs b/packages/client-rust/src/models/o_auth2_provider_setup_urls.rs new file mode 100644 index 0000000000..8292e20934 --- /dev/null +++ b/packages/client-rust/src/models/o_auth2_provider_setup_urls.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OAuth2ProviderSetupUrls : OAuth2 Provider Metadata serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OAuth2ProviderSetupUrls { + #[serde(rename = "issuer")] + pub issuer: String, + #[serde(rename = "authorize")] + pub authorize: String, + #[serde(rename = "token")] + pub token: String, + #[serde(rename = "user_info")] + pub user_info: String, + #[serde(rename = "provider_info")] + pub provider_info: String, + #[serde(rename = "logout")] + pub logout: String, + #[serde(rename = "jwks")] + pub jwks: String, +} + +impl OAuth2ProviderSetupUrls { + /// OAuth2 Provider Metadata serializer + pub fn new( + issuer: String, + authorize: String, + token: String, + user_info: String, + provider_info: String, + logout: String, + jwks: String, + ) -> OAuth2ProviderSetupUrls { + OAuth2ProviderSetupUrls { + issuer, + authorize, + token, + user_info, + provider_info, + logout, + jwks, + } + } +} diff --git a/packages/client-rust/src/models/o_auth_device_code_challenge.rs b/packages/client-rust/src/models/o_auth_device_code_challenge.rs new file mode 100644 index 0000000000..fd40504e4e --- /dev/null +++ b/packages/client-rust/src/models/o_auth_device_code_challenge.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OAuthDeviceCodeChallenge : OAuth Device code challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OAuthDeviceCodeChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, +} + +impl OAuthDeviceCodeChallenge { + /// OAuth Device code challenge + pub fn new() -> OAuthDeviceCodeChallenge { + OAuthDeviceCodeChallenge { + flow_info: None, + component: None, + response_errors: None, + } + } +} diff --git a/packages/client-rust/src/models/o_auth_device_code_challenge_response_request.rs b/packages/client-rust/src/models/o_auth_device_code_challenge_response_request.rs new file mode 100644 index 0000000000..0bfa8fa3b2 --- /dev/null +++ b/packages/client-rust/src/models/o_auth_device_code_challenge_response_request.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OAuthDeviceCodeChallengeResponseRequest : Response that includes the user-entered device code +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OAuthDeviceCodeChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "code")] + pub code: String, +} + +impl OAuthDeviceCodeChallengeResponseRequest { + /// Response that includes the user-entered device code + pub fn new(code: String) -> OAuthDeviceCodeChallengeResponseRequest { + OAuthDeviceCodeChallengeResponseRequest { + component: None, + code, + } + } +} diff --git a/packages/client-rust/src/models/o_auth_device_code_finish_challenge.rs b/packages/client-rust/src/models/o_auth_device_code_finish_challenge.rs new file mode 100644 index 0000000000..563bbc97da --- /dev/null +++ b/packages/client-rust/src/models/o_auth_device_code_finish_challenge.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OAuthDeviceCodeFinishChallenge : Final challenge after user enters their code +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OAuthDeviceCodeFinishChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, +} + +impl OAuthDeviceCodeFinishChallenge { + /// Final challenge after user enters their code + pub fn new() -> OAuthDeviceCodeFinishChallenge { + OAuthDeviceCodeFinishChallenge { + flow_info: None, + component: None, + response_errors: None, + } + } +} diff --git a/packages/client-rust/src/models/o_auth_device_code_finish_challenge_response_request.rs b/packages/client-rust/src/models/o_auth_device_code_finish_challenge_response_request.rs new file mode 100644 index 0000000000..1521c5ea4c --- /dev/null +++ b/packages/client-rust/src/models/o_auth_device_code_finish_challenge_response_request.rs @@ -0,0 +1,26 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OAuthDeviceCodeFinishChallengeResponseRequest : Response that device has been authenticated and +/// tab can be closed +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OAuthDeviceCodeFinishChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, +} + +impl OAuthDeviceCodeFinishChallengeResponseRequest { + /// Response that device has been authenticated and tab can be closed + pub fn new() -> OAuthDeviceCodeFinishChallengeResponseRequest { + OAuthDeviceCodeFinishChallengeResponseRequest { component: None } + } +} diff --git a/packages/client-rust/src/models/o_auth_source.rs b/packages/client-rust/src/models/o_auth_source.rs new file mode 100644 index 0000000000..a6f270255d --- /dev/null +++ b/packages/client-rust/src/models/o_auth_source.rs @@ -0,0 +1,211 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OAuthSource : OAuth Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OAuthSource { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Source's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal source name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde(rename = "managed", deserialize_with = "Option::deserialize")] + pub managed: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + #[serde(rename = "icon_url", deserialize_with = "Option::deserialize")] + pub icon_url: Option, + #[serde(rename = "icon_themed_urls", deserialize_with = "Option::deserialize")] + pub icon_themed_urls: Option, + /// How the source determines if an existing group should be used or a new group created. + #[serde( + rename = "group_matching_mode", + skip_serializing_if = "Option::is_none" + )] + pub group_matching_mode: Option, + #[serde(rename = "provider_type")] + pub provider_type: models::ProviderTypeEnum, + /// URL used to request the initial token. This URL is only required for OAuth 1. + #[serde( + rename = "request_token_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub request_token_url: Option>, + /// URL the user is redirect to to conest the flow. + #[serde( + rename = "authorization_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authorization_url: Option>, + /// URL used by authentik to retrieve tokens. + #[serde( + rename = "access_token_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub access_token_url: Option>, + /// URL used by authentik to get user information. + #[serde( + rename = "profile_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option>, + #[serde(rename = "pkce", skip_serializing_if = "Option::is_none")] + pub pkce: Option, + #[serde(rename = "consumer_key")] + pub consumer_key: String, + /// Get OAuth Callback URL + #[serde(rename = "callback_url")] + pub callback_url: String, + #[serde(rename = "additional_scopes", skip_serializing_if = "Option::is_none")] + pub additional_scopes: Option, + #[serde(rename = "type")] + pub r#type: models::SourceType, + #[serde( + rename = "oidc_well_known_url", + skip_serializing_if = "Option::is_none" + )] + pub oidc_well_known_url: Option, + #[serde(rename = "oidc_jwks_url", skip_serializing_if = "Option::is_none")] + pub oidc_jwks_url: Option, + #[serde(rename = "oidc_jwks", skip_serializing_if = "Option::is_none")] + pub oidc_jwks: Option>, + /// How to perform authentication during an authorization_code token request flow + #[serde( + rename = "authorization_code_auth_method", + skip_serializing_if = "Option::is_none" + )] + pub authorization_code_auth_method: Option, +} + +impl OAuthSource { + /// OAuth Source Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + slug: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + managed: Option, + icon_url: Option, + icon_themed_urls: Option, + provider_type: models::ProviderTypeEnum, + consumer_key: String, + callback_url: String, + r#type: models::SourceType, + ) -> OAuthSource { + OAuthSource { + pk, + name, + slug, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + policy_engine_mode: None, + user_matching_mode: None, + managed, + user_path_template: None, + icon: None, + icon_url, + icon_themed_urls, + group_matching_mode: None, + provider_type, + request_token_url: None, + authorization_url: None, + access_token_url: None, + profile_url: None, + pkce: None, + consumer_key, + callback_url, + additional_scopes: None, + r#type, + oidc_well_known_url: None, + oidc_jwks_url: None, + oidc_jwks: None, + authorization_code_auth_method: None, + } + } +} diff --git a/packages/client-rust/src/models/o_auth_source_property_mapping.rs b/packages/client-rust/src/models/o_auth_source_property_mapping.rs new file mode 100644 index 0000000000..360f84e084 --- /dev/null +++ b/packages/client-rust/src/models/o_auth_source_property_mapping.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OAuthSourcePropertyMapping : OAuthSourcePropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OAuthSourcePropertyMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + /// Get object's component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl OAuthSourcePropertyMapping { + /// OAuthSourcePropertyMapping Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + expression: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> OAuthSourcePropertyMapping { + OAuthSourcePropertyMapping { + pk, + managed: None, + name, + expression, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/o_auth_source_property_mapping_request.rs b/packages/client-rust/src/models/o_auth_source_property_mapping_request.rs new file mode 100644 index 0000000000..39ca4aa663 --- /dev/null +++ b/packages/client-rust/src/models/o_auth_source_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OAuthSourcePropertyMappingRequest : OAuthSourcePropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OAuthSourcePropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, +} + +impl OAuthSourcePropertyMappingRequest { + /// OAuthSourcePropertyMapping Serializer + pub fn new(name: String, expression: String) -> OAuthSourcePropertyMappingRequest { + OAuthSourcePropertyMappingRequest { + managed: None, + name, + expression, + } + } +} diff --git a/packages/client-rust/src/models/o_auth_source_request.rs b/packages/client-rust/src/models/o_auth_source_request.rs new file mode 100644 index 0000000000..19077eae56 --- /dev/null +++ b/packages/client-rust/src/models/o_auth_source_request.rs @@ -0,0 +1,167 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OAuthSourceRequest : OAuth Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OAuthSourceRequest { + /// Source's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal source name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + /// How the source determines if an existing group should be used or a new group created. + #[serde( + rename = "group_matching_mode", + skip_serializing_if = "Option::is_none" + )] + pub group_matching_mode: Option, + #[serde(rename = "provider_type")] + pub provider_type: models::ProviderTypeEnum, + /// URL used to request the initial token. This URL is only required for OAuth 1. + #[serde( + rename = "request_token_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub request_token_url: Option>, + /// URL the user is redirect to to conest the flow. + #[serde( + rename = "authorization_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authorization_url: Option>, + /// URL used by authentik to retrieve tokens. + #[serde( + rename = "access_token_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub access_token_url: Option>, + /// URL used by authentik to get user information. + #[serde( + rename = "profile_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option>, + #[serde(rename = "pkce", skip_serializing_if = "Option::is_none")] + pub pkce: Option, + #[serde(rename = "consumer_key")] + pub consumer_key: String, + #[serde(rename = "consumer_secret")] + pub consumer_secret: String, + #[serde(rename = "additional_scopes", skip_serializing_if = "Option::is_none")] + pub additional_scopes: Option, + #[serde( + rename = "oidc_well_known_url", + skip_serializing_if = "Option::is_none" + )] + pub oidc_well_known_url: Option, + #[serde(rename = "oidc_jwks_url", skip_serializing_if = "Option::is_none")] + pub oidc_jwks_url: Option, + #[serde(rename = "oidc_jwks", skip_serializing_if = "Option::is_none")] + pub oidc_jwks: Option>, + /// How to perform authentication during an authorization_code token request flow + #[serde( + rename = "authorization_code_auth_method", + skip_serializing_if = "Option::is_none" + )] + pub authorization_code_auth_method: Option, +} + +impl OAuthSourceRequest { + /// OAuth Source Serializer + pub fn new( + name: String, + slug: String, + provider_type: models::ProviderTypeEnum, + consumer_key: String, + consumer_secret: String, + ) -> OAuthSourceRequest { + OAuthSourceRequest { + name, + slug, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + policy_engine_mode: None, + user_matching_mode: None, + user_path_template: None, + icon: None, + group_matching_mode: None, + provider_type, + request_token_url: None, + authorization_url: None, + access_token_url: None, + profile_url: None, + pkce: None, + consumer_key, + consumer_secret, + additional_scopes: None, + oidc_well_known_url: None, + oidc_jwks_url: None, + oidc_jwks: None, + authorization_code_auth_method: None, + } + } +} diff --git a/packages/client-rust/src/models/open_id_connect_configuration.rs b/packages/client-rust/src/models/open_id_connect_configuration.rs new file mode 100644 index 0000000000..9ea2e266f0 --- /dev/null +++ b/packages/client-rust/src/models/open_id_connect_configuration.rs @@ -0,0 +1,69 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OpenIdConnectConfiguration : rest_framework Serializer for OIDC Configuration +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OpenIdConnectConfiguration { + #[serde(rename = "issuer")] + pub issuer: String, + #[serde(rename = "authorization_endpoint")] + pub authorization_endpoint: String, + #[serde(rename = "token_endpoint")] + pub token_endpoint: String, + #[serde(rename = "userinfo_endpoint")] + pub userinfo_endpoint: String, + #[serde(rename = "end_session_endpoint")] + pub end_session_endpoint: String, + #[serde(rename = "introspection_endpoint")] + pub introspection_endpoint: String, + #[serde(rename = "jwks_uri")] + pub jwks_uri: String, + #[serde(rename = "response_types_supported")] + pub response_types_supported: Vec, + #[serde(rename = "id_token_signing_alg_values_supported")] + pub id_token_signing_alg_values_supported: Vec, + #[serde(rename = "subject_types_supported")] + pub subject_types_supported: Vec, + #[serde(rename = "token_endpoint_auth_methods_supported")] + pub token_endpoint_auth_methods_supported: Vec, +} + +impl OpenIdConnectConfiguration { + /// rest_framework Serializer for OIDC Configuration + pub fn new( + issuer: String, + authorization_endpoint: String, + token_endpoint: String, + userinfo_endpoint: String, + end_session_endpoint: String, + introspection_endpoint: String, + jwks_uri: String, + response_types_supported: Vec, + id_token_signing_alg_values_supported: Vec, + subject_types_supported: Vec, + token_endpoint_auth_methods_supported: Vec, + ) -> OpenIdConnectConfiguration { + OpenIdConnectConfiguration { + issuer, + authorization_endpoint, + token_endpoint, + userinfo_endpoint, + end_session_endpoint, + introspection_endpoint, + jwks_uri, + response_types_supported, + id_token_signing_alg_values_supported, + subject_types_supported, + token_endpoint_auth_methods_supported, + } + } +} diff --git a/packages/client-rust/src/models/operating_system.rs b/packages/client-rust/src/models/operating_system.rs new file mode 100644 index 0000000000..efdd3a8615 --- /dev/null +++ b/packages/client-rust/src/models/operating_system.rs @@ -0,0 +1,48 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OperatingSystem : For example: {\"family\":\"linux\",\"name\":\"Ubuntu\",\"version\":\"24.04.3 +/// LTS (Noble Numbat)\",\"arch\":\"amd64\"} {\"family\": \"windows\",\"name\":\"Server 2022 +/// Datacenter\",\"version\":\"10.0.20348.4405\",\"arch\":\"amd64\"} {\"family\": +/// \"windows\",\"name\":\"Server 2022 +/// Datacenter\",\"version\":\"10.0.20348.4405\",\"arch\":\"amd64\"} {\"family\": \"mac_os\", +/// \"name\": \"\", \"version\": \"26.2\", \"arch\": \"arm64\"} +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OperatingSystem { + #[serde(rename = "family")] + pub family: models::DeviceFactsOsFamily, + /// Operating System name, such as 'Server 2022' or 'Ubuntu' + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Operating System version, must always be the version number but may contain build name + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + #[serde(rename = "arch", skip_serializing_if = "Option::is_none")] + pub arch: Option, +} + +impl OperatingSystem { + /// For example: {\"family\":\"linux\",\"name\":\"Ubuntu\",\"version\":\"24.04.3 LTS (Noble + /// Numbat)\",\"arch\":\"amd64\"} {\"family\": \"windows\",\"name\":\"Server 2022 + /// Datacenter\",\"version\":\"10.0.20348.4405\",\"arch\":\"amd64\"} {\"family\": + /// \"windows\",\"name\":\"Server 2022 + /// Datacenter\",\"version\":\"10.0.20348.4405\",\"arch\":\"amd64\"} {\"family\": \"mac_os\", + /// \"name\": \"\", \"version\": \"26.2\", \"arch\": \"arm64\"} + pub fn new(family: models::DeviceFactsOsFamily) -> OperatingSystem { + OperatingSystem { + family, + name: None, + version: None, + arch: None, + } + } +} diff --git a/packages/client-rust/src/models/operating_system_request.rs b/packages/client-rust/src/models/operating_system_request.rs new file mode 100644 index 0000000000..45202a2776 --- /dev/null +++ b/packages/client-rust/src/models/operating_system_request.rs @@ -0,0 +1,49 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OperatingSystemRequest : For example: +/// {\"family\":\"linux\",\"name\":\"Ubuntu\",\"version\":\"24.04.3 LTS (Noble +/// Numbat)\",\"arch\":\"amd64\"} {\"family\": \"windows\",\"name\":\"Server 2022 +/// Datacenter\",\"version\":\"10.0.20348.4405\",\"arch\":\"amd64\"} {\"family\": +/// \"windows\",\"name\":\"Server 2022 +/// Datacenter\",\"version\":\"10.0.20348.4405\",\"arch\":\"amd64\"} {\"family\": \"mac_os\", +/// \"name\": \"\", \"version\": \"26.2\", \"arch\": \"arm64\"} +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OperatingSystemRequest { + #[serde(rename = "family")] + pub family: models::DeviceFactsOsFamily, + /// Operating System name, such as 'Server 2022' or 'Ubuntu' + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Operating System version, must always be the version number but may contain build name + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + #[serde(rename = "arch", skip_serializing_if = "Option::is_none")] + pub arch: Option, +} + +impl OperatingSystemRequest { + /// For example: {\"family\":\"linux\",\"name\":\"Ubuntu\",\"version\":\"24.04.3 LTS (Noble + /// Numbat)\",\"arch\":\"amd64\"} {\"family\": \"windows\",\"name\":\"Server 2022 + /// Datacenter\",\"version\":\"10.0.20348.4405\",\"arch\":\"amd64\"} {\"family\": + /// \"windows\",\"name\":\"Server 2022 + /// Datacenter\",\"version\":\"10.0.20348.4405\",\"arch\":\"amd64\"} {\"family\": \"mac_os\", + /// \"name\": \"\", \"version\": \"26.2\", \"arch\": \"arm64\"} + pub fn new(family: models::DeviceFactsOsFamily) -> OperatingSystemRequest { + OperatingSystemRequest { + family, + name: None, + version: None, + arch: None, + } + } +} diff --git a/packages/client-rust/src/models/outgoing_sync_delete_action.rs b/packages/client-rust/src/models/outgoing_sync_delete_action.rs new file mode 100644 index 0000000000..6ac24059e8 --- /dev/null +++ b/packages/client-rust/src/models/outgoing_sync_delete_action.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum OutgoingSyncDeleteAction { + #[serde(rename = "do_nothing")] + DoNothing, + #[serde(rename = "delete")] + Delete, + #[serde(rename = "suspend")] + Suspend, +} + +impl std::fmt::Display for OutgoingSyncDeleteAction { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::DoNothing => write!(f, "do_nothing"), + Self::Delete => write!(f, "delete"), + Self::Suspend => write!(f, "suspend"), + } + } +} + +impl Default for OutgoingSyncDeleteAction { + fn default() -> OutgoingSyncDeleteAction { + Self::DoNothing + } +} diff --git a/packages/client-rust/src/models/outpost.rs b/packages/client-rust/src/models/outpost.rs new file mode 100644 index 0000000000..3a48946245 --- /dev/null +++ b/packages/client-rust/src/models/outpost.rs @@ -0,0 +1,86 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Outpost : Outpost Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Outpost { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "type")] + pub r#type: models::OutpostTypeEnum, + #[serde(rename = "providers")] + pub providers: Vec, + #[serde(rename = "providers_obj")] + pub providers_obj: Vec, + /// Select Service-Connection authentik should use to manage this outpost. Leave empty if + /// authentik should not handle the deployment. + #[serde( + rename = "service_connection", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub service_connection: Option>, + #[serde( + rename = "service_connection_obj", + deserialize_with = "Option::deserialize" + )] + pub service_connection_obj: Option, + #[serde(rename = "refresh_interval_s")] + pub refresh_interval_s: i32, + /// Get Token identifier + #[serde(rename = "token_identifier")] + pub token_identifier: String, + #[serde(rename = "config")] + pub config: std::collections::HashMap, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, +} + +impl Outpost { + /// Outpost Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + r#type: models::OutpostTypeEnum, + providers: Vec, + providers_obj: Vec, + service_connection_obj: Option, + refresh_interval_s: i32, + token_identifier: String, + config: std::collections::HashMap, + ) -> Outpost { + Outpost { + pk, + name, + r#type, + providers, + providers_obj, + service_connection: None, + service_connection_obj, + refresh_interval_s, + token_identifier, + config, + managed: None, + } + } +} diff --git a/packages/client-rust/src/models/outpost_default_config.rs b/packages/client-rust/src/models/outpost_default_config.rs new file mode 100644 index 0000000000..e3b0e16586 --- /dev/null +++ b/packages/client-rust/src/models/outpost_default_config.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OutpostDefaultConfig : Global default outpost config +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OutpostDefaultConfig { + #[serde(rename = "config")] + pub config: std::collections::HashMap, +} + +impl OutpostDefaultConfig { + /// Global default outpost config + pub fn new( + config: std::collections::HashMap, + ) -> OutpostDefaultConfig { + OutpostDefaultConfig { config } + } +} diff --git a/packages/client-rust/src/models/outpost_health.rs b/packages/client-rust/src/models/outpost_health.rs new file mode 100644 index 0000000000..7a12c92f2d --- /dev/null +++ b/packages/client-rust/src/models/outpost_health.rs @@ -0,0 +1,74 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OutpostHealth : Outpost health status +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OutpostHealth { + #[serde(rename = "uid")] + pub uid: String, + #[serde(rename = "last_seen")] + pub last_seen: String, + #[serde(rename = "version")] + pub version: String, + #[serde(rename = "golang_version")] + pub golang_version: String, + #[serde(rename = "openssl_enabled")] + pub openssl_enabled: bool, + #[serde(rename = "openssl_version")] + pub openssl_version: String, + /// Get FIPS enabled + #[serde(rename = "fips_enabled", deserialize_with = "Option::deserialize")] + pub fips_enabled: Option, + #[serde(rename = "version_should")] + pub version_should: String, + #[serde(rename = "version_outdated")] + pub version_outdated: bool, + #[serde(rename = "build_hash")] + pub build_hash: String, + #[serde(rename = "build_hash_should")] + pub build_hash_should: String, + #[serde(rename = "hostname")] + pub hostname: String, +} + +impl OutpostHealth { + /// Outpost health status + pub fn new( + uid: String, + last_seen: String, + version: String, + golang_version: String, + openssl_enabled: bool, + openssl_version: String, + fips_enabled: Option, + version_should: String, + version_outdated: bool, + build_hash: String, + build_hash_should: String, + hostname: String, + ) -> OutpostHealth { + OutpostHealth { + uid, + last_seen, + version, + golang_version, + openssl_enabled, + openssl_version, + fips_enabled, + version_should, + version_outdated, + build_hash, + build_hash_should, + hostname, + } + } +} diff --git a/packages/client-rust/src/models/outpost_request.rs b/packages/client-rust/src/models/outpost_request.rs new file mode 100644 index 0000000000..263e40ea0e --- /dev/null +++ b/packages/client-rust/src/models/outpost_request.rs @@ -0,0 +1,62 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// OutpostRequest : Outpost Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OutpostRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "type")] + pub r#type: models::OutpostTypeEnum, + #[serde(rename = "providers")] + pub providers: Vec, + /// Select Service-Connection authentik should use to manage this outpost. Leave empty if + /// authentik should not handle the deployment. + #[serde( + rename = "service_connection", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub service_connection: Option>, + #[serde(rename = "config")] + pub config: std::collections::HashMap, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, +} + +impl OutpostRequest { + /// Outpost Serializer + pub fn new( + name: String, + r#type: models::OutpostTypeEnum, + providers: Vec, + config: std::collections::HashMap, + ) -> OutpostRequest { + OutpostRequest { + name, + r#type, + providers, + service_connection: None, + config, + managed: None, + } + } +} diff --git a/packages/client-rust/src/models/outpost_type_enum.rs b/packages/client-rust/src/models/outpost_type_enum.rs new file mode 100644 index 0000000000..e1e59afd92 --- /dev/null +++ b/packages/client-rust/src/models/outpost_type_enum.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum OutpostTypeEnum { + #[serde(rename = "proxy")] + Proxy, + #[serde(rename = "ldap")] + Ldap, + #[serde(rename = "radius")] + Radius, + #[serde(rename = "rac")] + Rac, +} + +impl std::fmt::Display for OutpostTypeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Proxy => write!(f, "proxy"), + Self::Ldap => write!(f, "ldap"), + Self::Radius => write!(f, "radius"), + Self::Rac => write!(f, "rac"), + } + } +} + +impl Default for OutpostTypeEnum { + fn default() -> OutpostTypeEnum { + Self::Proxy + } +} diff --git a/packages/client-rust/src/models/paginated_agent_connector_list.rs b/packages/client-rust/src/models/paginated_agent_connector_list.rs new file mode 100644 index 0000000000..e698358bbe --- /dev/null +++ b/packages/client-rust/src/models/paginated_agent_connector_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedAgentConnectorList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedAgentConnectorList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedAgentConnectorList { + PaginatedAgentConnectorList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_application_entitlement_list.rs b/packages/client-rust/src/models/paginated_application_entitlement_list.rs new file mode 100644 index 0000000000..e94fda99a3 --- /dev/null +++ b/packages/client-rust/src/models/paginated_application_entitlement_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedApplicationEntitlementList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedApplicationEntitlementList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedApplicationEntitlementList { + PaginatedApplicationEntitlementList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_application_list.rs b/packages/client-rust/src/models/paginated_application_list.rs new file mode 100644 index 0000000000..eb446a1dff --- /dev/null +++ b/packages/client-rust/src/models/paginated_application_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedApplicationList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedApplicationList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedApplicationList { + PaginatedApplicationList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_authenticated_session_list.rs b/packages/client-rust/src/models/paginated_authenticated_session_list.rs new file mode 100644 index 0000000000..cf0dda0381 --- /dev/null +++ b/packages/client-rust/src/models/paginated_authenticated_session_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedAuthenticatedSessionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedAuthenticatedSessionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedAuthenticatedSessionList { + PaginatedAuthenticatedSessionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_authenticator_duo_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_duo_stage_list.rs new file mode 100644 index 0000000000..7bf476a996 --- /dev/null +++ b/packages/client-rust/src/models/paginated_authenticator_duo_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedAuthenticatorDuoStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedAuthenticatorDuoStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedAuthenticatorDuoStageList { + PaginatedAuthenticatorDuoStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_authenticator_email_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_email_stage_list.rs new file mode 100644 index 0000000000..1096a708ba --- /dev/null +++ b/packages/client-rust/src/models/paginated_authenticator_email_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedAuthenticatorEmailStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedAuthenticatorEmailStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedAuthenticatorEmailStageList { + PaginatedAuthenticatorEmailStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_authenticator_endpoint_gdtc_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_endpoint_gdtc_stage_list.rs new file mode 100644 index 0000000000..886f6883a9 --- /dev/null +++ b/packages/client-rust/src/models/paginated_authenticator_endpoint_gdtc_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedAuthenticatorEndpointGdtcStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedAuthenticatorEndpointGdtcStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedAuthenticatorEndpointGdtcStageList { + PaginatedAuthenticatorEndpointGdtcStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_authenticator_sms_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_sms_stage_list.rs new file mode 100644 index 0000000000..8dcd294c53 --- /dev/null +++ b/packages/client-rust/src/models/paginated_authenticator_sms_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedAuthenticatorSmsStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedAuthenticatorSmsStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedAuthenticatorSmsStageList { + PaginatedAuthenticatorSmsStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_authenticator_static_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_static_stage_list.rs new file mode 100644 index 0000000000..7444e9a592 --- /dev/null +++ b/packages/client-rust/src/models/paginated_authenticator_static_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedAuthenticatorStaticStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedAuthenticatorStaticStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedAuthenticatorStaticStageList { + PaginatedAuthenticatorStaticStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_authenticator_totp_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_totp_stage_list.rs new file mode 100644 index 0000000000..dea07a0812 --- /dev/null +++ b/packages/client-rust/src/models/paginated_authenticator_totp_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedAuthenticatorTotpStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedAuthenticatorTotpStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedAuthenticatorTotpStageList { + PaginatedAuthenticatorTotpStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_authenticator_validate_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_validate_stage_list.rs new file mode 100644 index 0000000000..1691c59d2a --- /dev/null +++ b/packages/client-rust/src/models/paginated_authenticator_validate_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedAuthenticatorValidateStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedAuthenticatorValidateStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedAuthenticatorValidateStageList { + PaginatedAuthenticatorValidateStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_authenticator_web_authn_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_web_authn_stage_list.rs new file mode 100644 index 0000000000..dd6abb87bc --- /dev/null +++ b/packages/client-rust/src/models/paginated_authenticator_web_authn_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedAuthenticatorWebAuthnStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedAuthenticatorWebAuthnStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedAuthenticatorWebAuthnStageList { + PaginatedAuthenticatorWebAuthnStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_blueprint_instance_list.rs b/packages/client-rust/src/models/paginated_blueprint_instance_list.rs new file mode 100644 index 0000000000..3b4ab6c96e --- /dev/null +++ b/packages/client-rust/src/models/paginated_blueprint_instance_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedBlueprintInstanceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedBlueprintInstanceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedBlueprintInstanceList { + PaginatedBlueprintInstanceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_brand_list.rs b/packages/client-rust/src/models/paginated_brand_list.rs new file mode 100644 index 0000000000..abcf81cdb1 --- /dev/null +++ b/packages/client-rust/src/models/paginated_brand_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedBrandList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedBrandList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedBrandList { + PaginatedBrandList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_captcha_stage_list.rs b/packages/client-rust/src/models/paginated_captcha_stage_list.rs new file mode 100644 index 0000000000..91dd769a15 --- /dev/null +++ b/packages/client-rust/src/models/paginated_captcha_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedCaptchaStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedCaptchaStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedCaptchaStageList { + PaginatedCaptchaStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_certificate_key_pair_list.rs b/packages/client-rust/src/models/paginated_certificate_key_pair_list.rs new file mode 100644 index 0000000000..fa4c9a2ba6 --- /dev/null +++ b/packages/client-rust/src/models/paginated_certificate_key_pair_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedCertificateKeyPairList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedCertificateKeyPairList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedCertificateKeyPairList { + PaginatedCertificateKeyPairList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_connection_token_list.rs b/packages/client-rust/src/models/paginated_connection_token_list.rs new file mode 100644 index 0000000000..1594ea3cac --- /dev/null +++ b/packages/client-rust/src/models/paginated_connection_token_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedConnectionTokenList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedConnectionTokenList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedConnectionTokenList { + PaginatedConnectionTokenList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_connector_list.rs b/packages/client-rust/src/models/paginated_connector_list.rs new file mode 100644 index 0000000000..78e92279f9 --- /dev/null +++ b/packages/client-rust/src/models/paginated_connector_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedConnectorList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedConnectorList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedConnectorList { + PaginatedConnectorList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_consent_stage_list.rs b/packages/client-rust/src/models/paginated_consent_stage_list.rs new file mode 100644 index 0000000000..6c7084481d --- /dev/null +++ b/packages/client-rust/src/models/paginated_consent_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedConsentStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedConsentStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedConsentStageList { + PaginatedConsentStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_data_export_list.rs b/packages/client-rust/src/models/paginated_data_export_list.rs new file mode 100644 index 0000000000..1b2b99f692 --- /dev/null +++ b/packages/client-rust/src/models/paginated_data_export_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedDataExportList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedDataExportList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedDataExportList { + PaginatedDataExportList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_deny_stage_list.rs b/packages/client-rust/src/models/paginated_deny_stage_list.rs new file mode 100644 index 0000000000..7435489f75 --- /dev/null +++ b/packages/client-rust/src/models/paginated_deny_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedDenyStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedDenyStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedDenyStageList { + PaginatedDenyStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_device_access_group_list.rs b/packages/client-rust/src/models/paginated_device_access_group_list.rs new file mode 100644 index 0000000000..ad5592f2a5 --- /dev/null +++ b/packages/client-rust/src/models/paginated_device_access_group_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedDeviceAccessGroupList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedDeviceAccessGroupList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedDeviceAccessGroupList { + PaginatedDeviceAccessGroupList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_device_user_binding_list.rs b/packages/client-rust/src/models/paginated_device_user_binding_list.rs new file mode 100644 index 0000000000..f2ef4252e7 --- /dev/null +++ b/packages/client-rust/src/models/paginated_device_user_binding_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedDeviceUserBindingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedDeviceUserBindingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedDeviceUserBindingList { + PaginatedDeviceUserBindingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_docker_service_connection_list.rs b/packages/client-rust/src/models/paginated_docker_service_connection_list.rs new file mode 100644 index 0000000000..7f99f5d8d6 --- /dev/null +++ b/packages/client-rust/src/models/paginated_docker_service_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedDockerServiceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedDockerServiceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedDockerServiceConnectionList { + PaginatedDockerServiceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_domain_list.rs b/packages/client-rust/src/models/paginated_domain_list.rs new file mode 100644 index 0000000000..a8f5a5ec99 --- /dev/null +++ b/packages/client-rust/src/models/paginated_domain_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedDomainList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedDomainList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedDomainList { + PaginatedDomainList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_dummy_policy_list.rs b/packages/client-rust/src/models/paginated_dummy_policy_list.rs new file mode 100644 index 0000000000..487eecd1bb --- /dev/null +++ b/packages/client-rust/src/models/paginated_dummy_policy_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedDummyPolicyList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedDummyPolicyList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedDummyPolicyList { + PaginatedDummyPolicyList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_dummy_stage_list.rs b/packages/client-rust/src/models/paginated_dummy_stage_list.rs new file mode 100644 index 0000000000..4ed5585605 --- /dev/null +++ b/packages/client-rust/src/models/paginated_dummy_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedDummyStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedDummyStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedDummyStageList { + PaginatedDummyStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_duo_device_list.rs b/packages/client-rust/src/models/paginated_duo_device_list.rs new file mode 100644 index 0000000000..2f08450eea --- /dev/null +++ b/packages/client-rust/src/models/paginated_duo_device_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedDuoDeviceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedDuoDeviceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedDuoDeviceList { + PaginatedDuoDeviceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_email_device_list.rs b/packages/client-rust/src/models/paginated_email_device_list.rs new file mode 100644 index 0000000000..ac91841e8b --- /dev/null +++ b/packages/client-rust/src/models/paginated_email_device_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedEmailDeviceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedEmailDeviceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedEmailDeviceList { + PaginatedEmailDeviceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_email_stage_list.rs b/packages/client-rust/src/models/paginated_email_stage_list.rs new file mode 100644 index 0000000000..a2c442c158 --- /dev/null +++ b/packages/client-rust/src/models/paginated_email_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedEmailStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedEmailStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedEmailStageList { + PaginatedEmailStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_endpoint_device_list.rs b/packages/client-rust/src/models/paginated_endpoint_device_list.rs new file mode 100644 index 0000000000..6fdb34ce8e --- /dev/null +++ b/packages/client-rust/src/models/paginated_endpoint_device_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedEndpointDeviceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedEndpointDeviceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedEndpointDeviceList { + PaginatedEndpointDeviceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_endpoint_list.rs b/packages/client-rust/src/models/paginated_endpoint_list.rs new file mode 100644 index 0000000000..f4b153ecb1 --- /dev/null +++ b/packages/client-rust/src/models/paginated_endpoint_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedEndpointList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedEndpointList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedEndpointList { + PaginatedEndpointList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_endpoint_stage_list.rs b/packages/client-rust/src/models/paginated_endpoint_stage_list.rs new file mode 100644 index 0000000000..6e338d9c9f --- /dev/null +++ b/packages/client-rust/src/models/paginated_endpoint_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedEndpointStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedEndpointStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedEndpointStageList { + PaginatedEndpointStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_enrollment_token_list.rs b/packages/client-rust/src/models/paginated_enrollment_token_list.rs new file mode 100644 index 0000000000..a6a39431dd --- /dev/null +++ b/packages/client-rust/src/models/paginated_enrollment_token_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedEnrollmentTokenList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedEnrollmentTokenList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedEnrollmentTokenList { + PaginatedEnrollmentTokenList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_event_list.rs b/packages/client-rust/src/models/paginated_event_list.rs new file mode 100644 index 0000000000..f2a8f422f2 --- /dev/null +++ b/packages/client-rust/src/models/paginated_event_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedEventList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedEventList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedEventList { + PaginatedEventList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_event_matcher_policy_list.rs b/packages/client-rust/src/models/paginated_event_matcher_policy_list.rs new file mode 100644 index 0000000000..fd9a196060 --- /dev/null +++ b/packages/client-rust/src/models/paginated_event_matcher_policy_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedEventMatcherPolicyList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedEventMatcherPolicyList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedEventMatcherPolicyList { + PaginatedEventMatcherPolicyList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_expiring_base_grant_model_list.rs b/packages/client-rust/src/models/paginated_expiring_base_grant_model_list.rs new file mode 100644 index 0000000000..9885f3a053 --- /dev/null +++ b/packages/client-rust/src/models/paginated_expiring_base_grant_model_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedExpiringBaseGrantModelList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedExpiringBaseGrantModelList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedExpiringBaseGrantModelList { + PaginatedExpiringBaseGrantModelList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_expression_policy_list.rs b/packages/client-rust/src/models/paginated_expression_policy_list.rs new file mode 100644 index 0000000000..8b36897915 --- /dev/null +++ b/packages/client-rust/src/models/paginated_expression_policy_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedExpressionPolicyList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedExpressionPolicyList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedExpressionPolicyList { + PaginatedExpressionPolicyList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_extra_role_object_permission_list.rs b/packages/client-rust/src/models/paginated_extra_role_object_permission_list.rs new file mode 100644 index 0000000000..5074945357 --- /dev/null +++ b/packages/client-rust/src/models/paginated_extra_role_object_permission_list.rs @@ -0,0 +1,31 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedExtraRoleObjectPermissionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, +} + +impl PaginatedExtraRoleObjectPermissionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + ) -> PaginatedExtraRoleObjectPermissionList { + PaginatedExtraRoleObjectPermissionList { + pagination, + results, + } + } +} diff --git a/packages/client-rust/src/models/paginated_fleet_connector_list.rs b/packages/client-rust/src/models/paginated_fleet_connector_list.rs new file mode 100644 index 0000000000..de0fa98374 --- /dev/null +++ b/packages/client-rust/src/models/paginated_fleet_connector_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedFleetConnectorList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedFleetConnectorList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedFleetConnectorList { + PaginatedFleetConnectorList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_flow_list.rs b/packages/client-rust/src/models/paginated_flow_list.rs new file mode 100644 index 0000000000..312f0394b6 --- /dev/null +++ b/packages/client-rust/src/models/paginated_flow_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedFlowList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedFlowList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedFlowList { + PaginatedFlowList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_flow_stage_binding_list.rs b/packages/client-rust/src/models/paginated_flow_stage_binding_list.rs new file mode 100644 index 0000000000..8d2420744d --- /dev/null +++ b/packages/client-rust/src/models/paginated_flow_stage_binding_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedFlowStageBindingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedFlowStageBindingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedFlowStageBindingList { + PaginatedFlowStageBindingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_geo_ip_policy_list.rs b/packages/client-rust/src/models/paginated_geo_ip_policy_list.rs new file mode 100644 index 0000000000..d7a9a70234 --- /dev/null +++ b/packages/client-rust/src/models/paginated_geo_ip_policy_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedGeoIpPolicyList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedGeoIpPolicyList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedGeoIpPolicyList { + PaginatedGeoIpPolicyList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_google_chrome_connector_list.rs b/packages/client-rust/src/models/paginated_google_chrome_connector_list.rs new file mode 100644 index 0000000000..190e2aeb93 --- /dev/null +++ b/packages/client-rust/src/models/paginated_google_chrome_connector_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedGoogleChromeConnectorList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedGoogleChromeConnectorList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedGoogleChromeConnectorList { + PaginatedGoogleChromeConnectorList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_google_endpoint_device_list.rs b/packages/client-rust/src/models/paginated_google_endpoint_device_list.rs new file mode 100644 index 0000000000..fc4c354fd0 --- /dev/null +++ b/packages/client-rust/src/models/paginated_google_endpoint_device_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedGoogleEndpointDeviceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedGoogleEndpointDeviceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedGoogleEndpointDeviceList { + PaginatedGoogleEndpointDeviceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_google_workspace_provider_group_list.rs b/packages/client-rust/src/models/paginated_google_workspace_provider_group_list.rs new file mode 100644 index 0000000000..4d9a177065 --- /dev/null +++ b/packages/client-rust/src/models/paginated_google_workspace_provider_group_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedGoogleWorkspaceProviderGroupList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedGoogleWorkspaceProviderGroupList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedGoogleWorkspaceProviderGroupList { + PaginatedGoogleWorkspaceProviderGroupList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_google_workspace_provider_list.rs b/packages/client-rust/src/models/paginated_google_workspace_provider_list.rs new file mode 100644 index 0000000000..ce0e65331f --- /dev/null +++ b/packages/client-rust/src/models/paginated_google_workspace_provider_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedGoogleWorkspaceProviderList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedGoogleWorkspaceProviderList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedGoogleWorkspaceProviderList { + PaginatedGoogleWorkspaceProviderList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_google_workspace_provider_mapping_list.rs b/packages/client-rust/src/models/paginated_google_workspace_provider_mapping_list.rs new file mode 100644 index 0000000000..1afa06dc2a --- /dev/null +++ b/packages/client-rust/src/models/paginated_google_workspace_provider_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedGoogleWorkspaceProviderMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedGoogleWorkspaceProviderMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedGoogleWorkspaceProviderMappingList { + PaginatedGoogleWorkspaceProviderMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_google_workspace_provider_user_list.rs b/packages/client-rust/src/models/paginated_google_workspace_provider_user_list.rs new file mode 100644 index 0000000000..7c044e9e43 --- /dev/null +++ b/packages/client-rust/src/models/paginated_google_workspace_provider_user_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedGoogleWorkspaceProviderUserList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedGoogleWorkspaceProviderUserList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedGoogleWorkspaceProviderUserList { + PaginatedGoogleWorkspaceProviderUserList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_group_kerberos_source_connection_list.rs b/packages/client-rust/src/models/paginated_group_kerberos_source_connection_list.rs new file mode 100644 index 0000000000..fc48c3eea0 --- /dev/null +++ b/packages/client-rust/src/models/paginated_group_kerberos_source_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedGroupKerberosSourceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedGroupKerberosSourceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedGroupKerberosSourceConnectionList { + PaginatedGroupKerberosSourceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_group_ldap_source_connection_list.rs b/packages/client-rust/src/models/paginated_group_ldap_source_connection_list.rs new file mode 100644 index 0000000000..ea9bb85aec --- /dev/null +++ b/packages/client-rust/src/models/paginated_group_ldap_source_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedGroupLdapSourceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedGroupLdapSourceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedGroupLdapSourceConnectionList { + PaginatedGroupLdapSourceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_group_list.rs b/packages/client-rust/src/models/paginated_group_list.rs new file mode 100644 index 0000000000..36987a712a --- /dev/null +++ b/packages/client-rust/src/models/paginated_group_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedGroupList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedGroupList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedGroupList { + PaginatedGroupList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_group_o_auth_source_connection_list.rs b/packages/client-rust/src/models/paginated_group_o_auth_source_connection_list.rs new file mode 100644 index 0000000000..ed7b0a4869 --- /dev/null +++ b/packages/client-rust/src/models/paginated_group_o_auth_source_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedGroupOAuthSourceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedGroupOAuthSourceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedGroupOAuthSourceConnectionList { + PaginatedGroupOAuthSourceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_group_plex_source_connection_list.rs b/packages/client-rust/src/models/paginated_group_plex_source_connection_list.rs new file mode 100644 index 0000000000..7576cced4d --- /dev/null +++ b/packages/client-rust/src/models/paginated_group_plex_source_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedGroupPlexSourceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedGroupPlexSourceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedGroupPlexSourceConnectionList { + PaginatedGroupPlexSourceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_group_saml_source_connection_list.rs b/packages/client-rust/src/models/paginated_group_saml_source_connection_list.rs new file mode 100644 index 0000000000..08679736a8 --- /dev/null +++ b/packages/client-rust/src/models/paginated_group_saml_source_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedGroupSamlSourceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedGroupSamlSourceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedGroupSamlSourceConnectionList { + PaginatedGroupSamlSourceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_group_source_connection_list.rs b/packages/client-rust/src/models/paginated_group_source_connection_list.rs new file mode 100644 index 0000000000..b3ea38109a --- /dev/null +++ b/packages/client-rust/src/models/paginated_group_source_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedGroupSourceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedGroupSourceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedGroupSourceConnectionList { + PaginatedGroupSourceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_group_telegram_source_connection_list.rs b/packages/client-rust/src/models/paginated_group_telegram_source_connection_list.rs new file mode 100644 index 0000000000..e60d431375 --- /dev/null +++ b/packages/client-rust/src/models/paginated_group_telegram_source_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedGroupTelegramSourceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedGroupTelegramSourceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedGroupTelegramSourceConnectionList { + PaginatedGroupTelegramSourceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_identification_stage_list.rs b/packages/client-rust/src/models/paginated_identification_stage_list.rs new file mode 100644 index 0000000000..1c7ee259aa --- /dev/null +++ b/packages/client-rust/src/models/paginated_identification_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedIdentificationStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedIdentificationStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedIdentificationStageList { + PaginatedIdentificationStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_initial_permissions_list.rs b/packages/client-rust/src/models/paginated_initial_permissions_list.rs new file mode 100644 index 0000000000..bdde85ec44 --- /dev/null +++ b/packages/client-rust/src/models/paginated_initial_permissions_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedInitialPermissionsList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedInitialPermissionsList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedInitialPermissionsList { + PaginatedInitialPermissionsList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_invitation_list.rs b/packages/client-rust/src/models/paginated_invitation_list.rs new file mode 100644 index 0000000000..4eab3088bd --- /dev/null +++ b/packages/client-rust/src/models/paginated_invitation_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedInvitationList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedInvitationList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedInvitationList { + PaginatedInvitationList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_invitation_stage_list.rs b/packages/client-rust/src/models/paginated_invitation_stage_list.rs new file mode 100644 index 0000000000..2095b02332 --- /dev/null +++ b/packages/client-rust/src/models/paginated_invitation_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedInvitationStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedInvitationStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedInvitationStageList { + PaginatedInvitationStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_kerberos_source_list.rs b/packages/client-rust/src/models/paginated_kerberos_source_list.rs new file mode 100644 index 0000000000..a939b66b45 --- /dev/null +++ b/packages/client-rust/src/models/paginated_kerberos_source_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedKerberosSourceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedKerberosSourceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedKerberosSourceList { + PaginatedKerberosSourceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_kerberos_source_property_mapping_list.rs b/packages/client-rust/src/models/paginated_kerberos_source_property_mapping_list.rs new file mode 100644 index 0000000000..98632b6c2f --- /dev/null +++ b/packages/client-rust/src/models/paginated_kerberos_source_property_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedKerberosSourcePropertyMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedKerberosSourcePropertyMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedKerberosSourcePropertyMappingList { + PaginatedKerberosSourcePropertyMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_kubernetes_service_connection_list.rs b/packages/client-rust/src/models/paginated_kubernetes_service_connection_list.rs new file mode 100644 index 0000000000..856caead0f --- /dev/null +++ b/packages/client-rust/src/models/paginated_kubernetes_service_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedKubernetesServiceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedKubernetesServiceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedKubernetesServiceConnectionList { + PaginatedKubernetesServiceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_ldap_outpost_config_list.rs b/packages/client-rust/src/models/paginated_ldap_outpost_config_list.rs new file mode 100644 index 0000000000..261c3dc505 --- /dev/null +++ b/packages/client-rust/src/models/paginated_ldap_outpost_config_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedLdapOutpostConfigList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedLdapOutpostConfigList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedLdapOutpostConfigList { + PaginatedLdapOutpostConfigList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_ldap_provider_list.rs b/packages/client-rust/src/models/paginated_ldap_provider_list.rs new file mode 100644 index 0000000000..3df22548b2 --- /dev/null +++ b/packages/client-rust/src/models/paginated_ldap_provider_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedLdapProviderList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedLdapProviderList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedLdapProviderList { + PaginatedLdapProviderList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_ldap_source_list.rs b/packages/client-rust/src/models/paginated_ldap_source_list.rs new file mode 100644 index 0000000000..42625fcff1 --- /dev/null +++ b/packages/client-rust/src/models/paginated_ldap_source_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedLdapSourceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedLdapSourceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedLdapSourceList { + PaginatedLdapSourceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_ldap_source_property_mapping_list.rs b/packages/client-rust/src/models/paginated_ldap_source_property_mapping_list.rs new file mode 100644 index 0000000000..bc831b4c86 --- /dev/null +++ b/packages/client-rust/src/models/paginated_ldap_source_property_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedLdapSourcePropertyMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedLdapSourcePropertyMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedLdapSourcePropertyMappingList { + PaginatedLdapSourcePropertyMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_license_list.rs b/packages/client-rust/src/models/paginated_license_list.rs new file mode 100644 index 0000000000..5e9a7e92f6 --- /dev/null +++ b/packages/client-rust/src/models/paginated_license_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedLicenseList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedLicenseList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedLicenseList { + PaginatedLicenseList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_lifecycle_iteration_list.rs b/packages/client-rust/src/models/paginated_lifecycle_iteration_list.rs new file mode 100644 index 0000000000..e475dcf7c0 --- /dev/null +++ b/packages/client-rust/src/models/paginated_lifecycle_iteration_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedLifecycleIterationList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedLifecycleIterationList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedLifecycleIterationList { + PaginatedLifecycleIterationList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_lifecycle_rule_list.rs b/packages/client-rust/src/models/paginated_lifecycle_rule_list.rs new file mode 100644 index 0000000000..001d3e2ab9 --- /dev/null +++ b/packages/client-rust/src/models/paginated_lifecycle_rule_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedLifecycleRuleList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedLifecycleRuleList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedLifecycleRuleList { + PaginatedLifecycleRuleList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_microsoft_entra_provider_group_list.rs b/packages/client-rust/src/models/paginated_microsoft_entra_provider_group_list.rs new file mode 100644 index 0000000000..3b01efceba --- /dev/null +++ b/packages/client-rust/src/models/paginated_microsoft_entra_provider_group_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedMicrosoftEntraProviderGroupList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedMicrosoftEntraProviderGroupList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedMicrosoftEntraProviderGroupList { + PaginatedMicrosoftEntraProviderGroupList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_microsoft_entra_provider_list.rs b/packages/client-rust/src/models/paginated_microsoft_entra_provider_list.rs new file mode 100644 index 0000000000..4a8cd1f866 --- /dev/null +++ b/packages/client-rust/src/models/paginated_microsoft_entra_provider_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedMicrosoftEntraProviderList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedMicrosoftEntraProviderList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedMicrosoftEntraProviderList { + PaginatedMicrosoftEntraProviderList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_microsoft_entra_provider_mapping_list.rs b/packages/client-rust/src/models/paginated_microsoft_entra_provider_mapping_list.rs new file mode 100644 index 0000000000..59c7b48e1b --- /dev/null +++ b/packages/client-rust/src/models/paginated_microsoft_entra_provider_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedMicrosoftEntraProviderMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedMicrosoftEntraProviderMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedMicrosoftEntraProviderMappingList { + PaginatedMicrosoftEntraProviderMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_microsoft_entra_provider_user_list.rs b/packages/client-rust/src/models/paginated_microsoft_entra_provider_user_list.rs new file mode 100644 index 0000000000..cb3d200717 --- /dev/null +++ b/packages/client-rust/src/models/paginated_microsoft_entra_provider_user_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedMicrosoftEntraProviderUserList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedMicrosoftEntraProviderUserList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedMicrosoftEntraProviderUserList { + PaginatedMicrosoftEntraProviderUserList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_mutual_tls_stage_list.rs b/packages/client-rust/src/models/paginated_mutual_tls_stage_list.rs new file mode 100644 index 0000000000..25d6182225 --- /dev/null +++ b/packages/client-rust/src/models/paginated_mutual_tls_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedMutualTlsStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedMutualTlsStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedMutualTlsStageList { + PaginatedMutualTlsStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_notification_list.rs b/packages/client-rust/src/models/paginated_notification_list.rs new file mode 100644 index 0000000000..f8bf2cb2e4 --- /dev/null +++ b/packages/client-rust/src/models/paginated_notification_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedNotificationList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedNotificationList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedNotificationList { + PaginatedNotificationList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_notification_rule_list.rs b/packages/client-rust/src/models/paginated_notification_rule_list.rs new file mode 100644 index 0000000000..b72929086e --- /dev/null +++ b/packages/client-rust/src/models/paginated_notification_rule_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedNotificationRuleList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedNotificationRuleList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedNotificationRuleList { + PaginatedNotificationRuleList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_notification_transport_list.rs b/packages/client-rust/src/models/paginated_notification_transport_list.rs new file mode 100644 index 0000000000..2d6788e935 --- /dev/null +++ b/packages/client-rust/src/models/paginated_notification_transport_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedNotificationTransportList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedNotificationTransportList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedNotificationTransportList { + PaginatedNotificationTransportList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_notification_webhook_mapping_list.rs b/packages/client-rust/src/models/paginated_notification_webhook_mapping_list.rs new file mode 100644 index 0000000000..350d1775ce --- /dev/null +++ b/packages/client-rust/src/models/paginated_notification_webhook_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedNotificationWebhookMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedNotificationWebhookMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedNotificationWebhookMappingList { + PaginatedNotificationWebhookMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_o_auth2_provider_list.rs b/packages/client-rust/src/models/paginated_o_auth2_provider_list.rs new file mode 100644 index 0000000000..3acf92d3ad --- /dev/null +++ b/packages/client-rust/src/models/paginated_o_auth2_provider_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedOAuth2ProviderList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedOAuth2ProviderList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedOAuth2ProviderList { + PaginatedOAuth2ProviderList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_o_auth_source_list.rs b/packages/client-rust/src/models/paginated_o_auth_source_list.rs new file mode 100644 index 0000000000..a38a919fed --- /dev/null +++ b/packages/client-rust/src/models/paginated_o_auth_source_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedOAuthSourceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedOAuthSourceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedOAuthSourceList { + PaginatedOAuthSourceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_o_auth_source_property_mapping_list.rs b/packages/client-rust/src/models/paginated_o_auth_source_property_mapping_list.rs new file mode 100644 index 0000000000..7a10601f09 --- /dev/null +++ b/packages/client-rust/src/models/paginated_o_auth_source_property_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedOAuthSourcePropertyMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedOAuthSourcePropertyMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedOAuthSourcePropertyMappingList { + PaginatedOAuthSourcePropertyMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_outpost_list.rs b/packages/client-rust/src/models/paginated_outpost_list.rs new file mode 100644 index 0000000000..dae9723ecf --- /dev/null +++ b/packages/client-rust/src/models/paginated_outpost_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedOutpostList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedOutpostList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedOutpostList { + PaginatedOutpostList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_password_expiry_policy_list.rs b/packages/client-rust/src/models/paginated_password_expiry_policy_list.rs new file mode 100644 index 0000000000..6e95debef6 --- /dev/null +++ b/packages/client-rust/src/models/paginated_password_expiry_policy_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedPasswordExpiryPolicyList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedPasswordExpiryPolicyList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedPasswordExpiryPolicyList { + PaginatedPasswordExpiryPolicyList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_password_policy_list.rs b/packages/client-rust/src/models/paginated_password_policy_list.rs new file mode 100644 index 0000000000..648253d7b2 --- /dev/null +++ b/packages/client-rust/src/models/paginated_password_policy_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedPasswordPolicyList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedPasswordPolicyList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedPasswordPolicyList { + PaginatedPasswordPolicyList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_password_stage_list.rs b/packages/client-rust/src/models/paginated_password_stage_list.rs new file mode 100644 index 0000000000..fb09914000 --- /dev/null +++ b/packages/client-rust/src/models/paginated_password_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedPasswordStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedPasswordStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedPasswordStageList { + PaginatedPasswordStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_permission_list.rs b/packages/client-rust/src/models/paginated_permission_list.rs new file mode 100644 index 0000000000..fbc6115fdc --- /dev/null +++ b/packages/client-rust/src/models/paginated_permission_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedPermissionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedPermissionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedPermissionList { + PaginatedPermissionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_plex_source_list.rs b/packages/client-rust/src/models/paginated_plex_source_list.rs new file mode 100644 index 0000000000..e583150216 --- /dev/null +++ b/packages/client-rust/src/models/paginated_plex_source_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedPlexSourceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedPlexSourceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedPlexSourceList { + PaginatedPlexSourceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_plex_source_property_mapping_list.rs b/packages/client-rust/src/models/paginated_plex_source_property_mapping_list.rs new file mode 100644 index 0000000000..c04f90ce2c --- /dev/null +++ b/packages/client-rust/src/models/paginated_plex_source_property_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedPlexSourcePropertyMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedPlexSourcePropertyMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedPlexSourcePropertyMappingList { + PaginatedPlexSourcePropertyMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_policy_binding_list.rs b/packages/client-rust/src/models/paginated_policy_binding_list.rs new file mode 100644 index 0000000000..5a60a385db --- /dev/null +++ b/packages/client-rust/src/models/paginated_policy_binding_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedPolicyBindingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedPolicyBindingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedPolicyBindingList { + PaginatedPolicyBindingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_policy_list.rs b/packages/client-rust/src/models/paginated_policy_list.rs new file mode 100644 index 0000000000..6ffb6fafd0 --- /dev/null +++ b/packages/client-rust/src/models/paginated_policy_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedPolicyList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedPolicyList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedPolicyList { + PaginatedPolicyList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_prompt_list.rs b/packages/client-rust/src/models/paginated_prompt_list.rs new file mode 100644 index 0000000000..74e21bbbc9 --- /dev/null +++ b/packages/client-rust/src/models/paginated_prompt_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedPromptList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedPromptList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedPromptList { + PaginatedPromptList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_prompt_stage_list.rs b/packages/client-rust/src/models/paginated_prompt_stage_list.rs new file mode 100644 index 0000000000..c3fa999eb0 --- /dev/null +++ b/packages/client-rust/src/models/paginated_prompt_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedPromptStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedPromptStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedPromptStageList { + PaginatedPromptStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_property_mapping_list.rs b/packages/client-rust/src/models/paginated_property_mapping_list.rs new file mode 100644 index 0000000000..2728152f88 --- /dev/null +++ b/packages/client-rust/src/models/paginated_property_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedPropertyMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedPropertyMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedPropertyMappingList { + PaginatedPropertyMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_provider_list.rs b/packages/client-rust/src/models/paginated_provider_list.rs new file mode 100644 index 0000000000..aa3ff363b3 --- /dev/null +++ b/packages/client-rust/src/models/paginated_provider_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedProviderList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedProviderList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedProviderList { + PaginatedProviderList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_proxy_outpost_config_list.rs b/packages/client-rust/src/models/paginated_proxy_outpost_config_list.rs new file mode 100644 index 0000000000..18c94887c5 --- /dev/null +++ b/packages/client-rust/src/models/paginated_proxy_outpost_config_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedProxyOutpostConfigList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedProxyOutpostConfigList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedProxyOutpostConfigList { + PaginatedProxyOutpostConfigList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_proxy_provider_list.rs b/packages/client-rust/src/models/paginated_proxy_provider_list.rs new file mode 100644 index 0000000000..7f371a743f --- /dev/null +++ b/packages/client-rust/src/models/paginated_proxy_provider_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedProxyProviderList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedProxyProviderList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedProxyProviderList { + PaginatedProxyProviderList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_rac_property_mapping_list.rs b/packages/client-rust/src/models/paginated_rac_property_mapping_list.rs new file mode 100644 index 0000000000..acd4ae9a12 --- /dev/null +++ b/packages/client-rust/src/models/paginated_rac_property_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedRacPropertyMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedRacPropertyMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedRacPropertyMappingList { + PaginatedRacPropertyMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_rac_provider_list.rs b/packages/client-rust/src/models/paginated_rac_provider_list.rs new file mode 100644 index 0000000000..0802d02095 --- /dev/null +++ b/packages/client-rust/src/models/paginated_rac_provider_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedRacProviderList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedRacProviderList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedRacProviderList { + PaginatedRacProviderList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_radius_outpost_config_list.rs b/packages/client-rust/src/models/paginated_radius_outpost_config_list.rs new file mode 100644 index 0000000000..848b6791c8 --- /dev/null +++ b/packages/client-rust/src/models/paginated_radius_outpost_config_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedRadiusOutpostConfigList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedRadiusOutpostConfigList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedRadiusOutpostConfigList { + PaginatedRadiusOutpostConfigList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_radius_provider_list.rs b/packages/client-rust/src/models/paginated_radius_provider_list.rs new file mode 100644 index 0000000000..cb7c7b8f5e --- /dev/null +++ b/packages/client-rust/src/models/paginated_radius_provider_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedRadiusProviderList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedRadiusProviderList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedRadiusProviderList { + PaginatedRadiusProviderList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_radius_provider_property_mapping_list.rs b/packages/client-rust/src/models/paginated_radius_provider_property_mapping_list.rs new file mode 100644 index 0000000000..41e73eff42 --- /dev/null +++ b/packages/client-rust/src/models/paginated_radius_provider_property_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedRadiusProviderPropertyMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedRadiusProviderPropertyMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedRadiusProviderPropertyMappingList { + PaginatedRadiusProviderPropertyMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_redirect_stage_list.rs b/packages/client-rust/src/models/paginated_redirect_stage_list.rs new file mode 100644 index 0000000000..d64ec93501 --- /dev/null +++ b/packages/client-rust/src/models/paginated_redirect_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedRedirectStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedRedirectStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedRedirectStageList { + PaginatedRedirectStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_reputation_list.rs b/packages/client-rust/src/models/paginated_reputation_list.rs new file mode 100644 index 0000000000..85778a6200 --- /dev/null +++ b/packages/client-rust/src/models/paginated_reputation_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedReputationList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedReputationList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedReputationList { + PaginatedReputationList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_reputation_policy_list.rs b/packages/client-rust/src/models/paginated_reputation_policy_list.rs new file mode 100644 index 0000000000..8544a9bf34 --- /dev/null +++ b/packages/client-rust/src/models/paginated_reputation_policy_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedReputationPolicyList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedReputationPolicyList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedReputationPolicyList { + PaginatedReputationPolicyList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_role_assigned_object_permission_list.rs b/packages/client-rust/src/models/paginated_role_assigned_object_permission_list.rs new file mode 100644 index 0000000000..117b12d09a --- /dev/null +++ b/packages/client-rust/src/models/paginated_role_assigned_object_permission_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedRoleAssignedObjectPermissionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedRoleAssignedObjectPermissionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedRoleAssignedObjectPermissionList { + PaginatedRoleAssignedObjectPermissionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_role_list.rs b/packages/client-rust/src/models/paginated_role_list.rs new file mode 100644 index 0000000000..9faf04a42d --- /dev/null +++ b/packages/client-rust/src/models/paginated_role_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedRoleList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedRoleList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedRoleList { + PaginatedRoleList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_saml_property_mapping_list.rs b/packages/client-rust/src/models/paginated_saml_property_mapping_list.rs new file mode 100644 index 0000000000..c4694b1b4c --- /dev/null +++ b/packages/client-rust/src/models/paginated_saml_property_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedSamlPropertyMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedSamlPropertyMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedSamlPropertyMappingList { + PaginatedSamlPropertyMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_saml_provider_list.rs b/packages/client-rust/src/models/paginated_saml_provider_list.rs new file mode 100644 index 0000000000..1ab50f9366 --- /dev/null +++ b/packages/client-rust/src/models/paginated_saml_provider_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedSamlProviderList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedSamlProviderList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedSamlProviderList { + PaginatedSamlProviderList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_saml_source_list.rs b/packages/client-rust/src/models/paginated_saml_source_list.rs new file mode 100644 index 0000000000..17e7ec5697 --- /dev/null +++ b/packages/client-rust/src/models/paginated_saml_source_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedSamlSourceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedSamlSourceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedSamlSourceList { + PaginatedSamlSourceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_saml_source_property_mapping_list.rs b/packages/client-rust/src/models/paginated_saml_source_property_mapping_list.rs new file mode 100644 index 0000000000..70e01d7ccf --- /dev/null +++ b/packages/client-rust/src/models/paginated_saml_source_property_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedSamlSourcePropertyMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedSamlSourcePropertyMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedSamlSourcePropertyMappingList { + PaginatedSamlSourcePropertyMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_schedule_list.rs b/packages/client-rust/src/models/paginated_schedule_list.rs new file mode 100644 index 0000000000..f42be51ca7 --- /dev/null +++ b/packages/client-rust/src/models/paginated_schedule_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedScheduleList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedScheduleList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedScheduleList { + PaginatedScheduleList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_scim_mapping_list.rs b/packages/client-rust/src/models/paginated_scim_mapping_list.rs new file mode 100644 index 0000000000..196270e2ad --- /dev/null +++ b/packages/client-rust/src/models/paginated_scim_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedScimMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedScimMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedScimMappingList { + PaginatedScimMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_scim_provider_group_list.rs b/packages/client-rust/src/models/paginated_scim_provider_group_list.rs new file mode 100644 index 0000000000..2477cac4a3 --- /dev/null +++ b/packages/client-rust/src/models/paginated_scim_provider_group_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedScimProviderGroupList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedScimProviderGroupList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedScimProviderGroupList { + PaginatedScimProviderGroupList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_scim_provider_list.rs b/packages/client-rust/src/models/paginated_scim_provider_list.rs new file mode 100644 index 0000000000..97b7d1cee5 --- /dev/null +++ b/packages/client-rust/src/models/paginated_scim_provider_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedScimProviderList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedScimProviderList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedScimProviderList { + PaginatedScimProviderList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_scim_provider_user_list.rs b/packages/client-rust/src/models/paginated_scim_provider_user_list.rs new file mode 100644 index 0000000000..8bcd6450af --- /dev/null +++ b/packages/client-rust/src/models/paginated_scim_provider_user_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedScimProviderUserList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedScimProviderUserList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedScimProviderUserList { + PaginatedScimProviderUserList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_scim_source_group_list.rs b/packages/client-rust/src/models/paginated_scim_source_group_list.rs new file mode 100644 index 0000000000..9c66c12818 --- /dev/null +++ b/packages/client-rust/src/models/paginated_scim_source_group_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedScimSourceGroupList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedScimSourceGroupList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedScimSourceGroupList { + PaginatedScimSourceGroupList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_scim_source_list.rs b/packages/client-rust/src/models/paginated_scim_source_list.rs new file mode 100644 index 0000000000..f3d5ce027b --- /dev/null +++ b/packages/client-rust/src/models/paginated_scim_source_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedScimSourceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedScimSourceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedScimSourceList { + PaginatedScimSourceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_scim_source_property_mapping_list.rs b/packages/client-rust/src/models/paginated_scim_source_property_mapping_list.rs new file mode 100644 index 0000000000..2bdddb5da6 --- /dev/null +++ b/packages/client-rust/src/models/paginated_scim_source_property_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedScimSourcePropertyMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedScimSourcePropertyMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedScimSourcePropertyMappingList { + PaginatedScimSourcePropertyMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_scim_source_user_list.rs b/packages/client-rust/src/models/paginated_scim_source_user_list.rs new file mode 100644 index 0000000000..e9e06252cc --- /dev/null +++ b/packages/client-rust/src/models/paginated_scim_source_user_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedScimSourceUserList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedScimSourceUserList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedScimSourceUserList { + PaginatedScimSourceUserList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_scope_mapping_list.rs b/packages/client-rust/src/models/paginated_scope_mapping_list.rs new file mode 100644 index 0000000000..9a2830f79e --- /dev/null +++ b/packages/client-rust/src/models/paginated_scope_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedScopeMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedScopeMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedScopeMappingList { + PaginatedScopeMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_service_connection_list.rs b/packages/client-rust/src/models/paginated_service_connection_list.rs new file mode 100644 index 0000000000..391ed38ca9 --- /dev/null +++ b/packages/client-rust/src/models/paginated_service_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedServiceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedServiceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedServiceConnectionList { + PaginatedServiceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_sms_device_list.rs b/packages/client-rust/src/models/paginated_sms_device_list.rs new file mode 100644 index 0000000000..7fb08ced4f --- /dev/null +++ b/packages/client-rust/src/models/paginated_sms_device_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedSmsDeviceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedSmsDeviceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedSmsDeviceList { + PaginatedSmsDeviceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_source_list.rs b/packages/client-rust/src/models/paginated_source_list.rs new file mode 100644 index 0000000000..a282dad882 --- /dev/null +++ b/packages/client-rust/src/models/paginated_source_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedSourceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedSourceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedSourceList { + PaginatedSourceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_source_stage_list.rs b/packages/client-rust/src/models/paginated_source_stage_list.rs new file mode 100644 index 0000000000..65a6cdd457 --- /dev/null +++ b/packages/client-rust/src/models/paginated_source_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedSourceStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedSourceStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedSourceStageList { + PaginatedSourceStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_ssf_provider_list.rs b/packages/client-rust/src/models/paginated_ssf_provider_list.rs new file mode 100644 index 0000000000..d56ed8e87e --- /dev/null +++ b/packages/client-rust/src/models/paginated_ssf_provider_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedSsfProviderList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedSsfProviderList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedSsfProviderList { + PaginatedSsfProviderList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_ssf_stream_list.rs b/packages/client-rust/src/models/paginated_ssf_stream_list.rs new file mode 100644 index 0000000000..31b988ea22 --- /dev/null +++ b/packages/client-rust/src/models/paginated_ssf_stream_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedSsfStreamList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedSsfStreamList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedSsfStreamList { + PaginatedSsfStreamList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_stage_list.rs b/packages/client-rust/src/models/paginated_stage_list.rs new file mode 100644 index 0000000000..92b124847c --- /dev/null +++ b/packages/client-rust/src/models/paginated_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedStageList { + PaginatedStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_static_device_list.rs b/packages/client-rust/src/models/paginated_static_device_list.rs new file mode 100644 index 0000000000..480eb615e5 --- /dev/null +++ b/packages/client-rust/src/models/paginated_static_device_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedStaticDeviceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedStaticDeviceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedStaticDeviceList { + PaginatedStaticDeviceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_task_list.rs b/packages/client-rust/src/models/paginated_task_list.rs new file mode 100644 index 0000000000..30a14456dd --- /dev/null +++ b/packages/client-rust/src/models/paginated_task_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedTaskList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedTaskList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedTaskList { + PaginatedTaskList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_telegram_source_list.rs b/packages/client-rust/src/models/paginated_telegram_source_list.rs new file mode 100644 index 0000000000..ca57a95661 --- /dev/null +++ b/packages/client-rust/src/models/paginated_telegram_source_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedTelegramSourceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedTelegramSourceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedTelegramSourceList { + PaginatedTelegramSourceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_telegram_source_property_mapping_list.rs b/packages/client-rust/src/models/paginated_telegram_source_property_mapping_list.rs new file mode 100644 index 0000000000..6506182f0b --- /dev/null +++ b/packages/client-rust/src/models/paginated_telegram_source_property_mapping_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedTelegramSourcePropertyMappingList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedTelegramSourcePropertyMappingList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedTelegramSourcePropertyMappingList { + PaginatedTelegramSourcePropertyMappingList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_tenant_list.rs b/packages/client-rust/src/models/paginated_tenant_list.rs new file mode 100644 index 0000000000..5da81ea218 --- /dev/null +++ b/packages/client-rust/src/models/paginated_tenant_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedTenantList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedTenantList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedTenantList { + PaginatedTenantList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_token_list.rs b/packages/client-rust/src/models/paginated_token_list.rs new file mode 100644 index 0000000000..b2b065e25b --- /dev/null +++ b/packages/client-rust/src/models/paginated_token_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedTokenList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedTokenList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedTokenList { + PaginatedTokenList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_token_model_list.rs b/packages/client-rust/src/models/paginated_token_model_list.rs new file mode 100644 index 0000000000..26385653db --- /dev/null +++ b/packages/client-rust/src/models/paginated_token_model_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedTokenModelList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedTokenModelList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedTokenModelList { + PaginatedTokenModelList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_totp_device_list.rs b/packages/client-rust/src/models/paginated_totp_device_list.rs new file mode 100644 index 0000000000..3bdcc1444c --- /dev/null +++ b/packages/client-rust/src/models/paginated_totp_device_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedTotpDeviceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedTotpDeviceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedTotpDeviceList { + PaginatedTotpDeviceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_unique_password_policy_list.rs b/packages/client-rust/src/models/paginated_unique_password_policy_list.rs new file mode 100644 index 0000000000..c83b90b9a4 --- /dev/null +++ b/packages/client-rust/src/models/paginated_unique_password_policy_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedUniquePasswordPolicyList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedUniquePasswordPolicyList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedUniquePasswordPolicyList { + PaginatedUniquePasswordPolicyList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_user_consent_list.rs b/packages/client-rust/src/models/paginated_user_consent_list.rs new file mode 100644 index 0000000000..994a9ef869 --- /dev/null +++ b/packages/client-rust/src/models/paginated_user_consent_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedUserConsentList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedUserConsentList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedUserConsentList { + PaginatedUserConsentList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_user_delete_stage_list.rs b/packages/client-rust/src/models/paginated_user_delete_stage_list.rs new file mode 100644 index 0000000000..2675e0d7e0 --- /dev/null +++ b/packages/client-rust/src/models/paginated_user_delete_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedUserDeleteStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedUserDeleteStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedUserDeleteStageList { + PaginatedUserDeleteStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_user_kerberos_source_connection_list.rs b/packages/client-rust/src/models/paginated_user_kerberos_source_connection_list.rs new file mode 100644 index 0000000000..5c4e2eb54a --- /dev/null +++ b/packages/client-rust/src/models/paginated_user_kerberos_source_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedUserKerberosSourceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedUserKerberosSourceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedUserKerberosSourceConnectionList { + PaginatedUserKerberosSourceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_user_ldap_source_connection_list.rs b/packages/client-rust/src/models/paginated_user_ldap_source_connection_list.rs new file mode 100644 index 0000000000..be1d8be5ac --- /dev/null +++ b/packages/client-rust/src/models/paginated_user_ldap_source_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedUserLdapSourceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedUserLdapSourceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedUserLdapSourceConnectionList { + PaginatedUserLdapSourceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_user_list.rs b/packages/client-rust/src/models/paginated_user_list.rs new file mode 100644 index 0000000000..d2323f6734 --- /dev/null +++ b/packages/client-rust/src/models/paginated_user_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedUserList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedUserList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedUserList { + PaginatedUserList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_user_login_stage_list.rs b/packages/client-rust/src/models/paginated_user_login_stage_list.rs new file mode 100644 index 0000000000..66ebc68007 --- /dev/null +++ b/packages/client-rust/src/models/paginated_user_login_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedUserLoginStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedUserLoginStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedUserLoginStageList { + PaginatedUserLoginStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_user_logout_stage_list.rs b/packages/client-rust/src/models/paginated_user_logout_stage_list.rs new file mode 100644 index 0000000000..5812c88c84 --- /dev/null +++ b/packages/client-rust/src/models/paginated_user_logout_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedUserLogoutStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedUserLogoutStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedUserLogoutStageList { + PaginatedUserLogoutStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_user_o_auth_source_connection_list.rs b/packages/client-rust/src/models/paginated_user_o_auth_source_connection_list.rs new file mode 100644 index 0000000000..e747af3edc --- /dev/null +++ b/packages/client-rust/src/models/paginated_user_o_auth_source_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedUserOAuthSourceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedUserOAuthSourceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedUserOAuthSourceConnectionList { + PaginatedUserOAuthSourceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_user_plex_source_connection_list.rs b/packages/client-rust/src/models/paginated_user_plex_source_connection_list.rs new file mode 100644 index 0000000000..adb3d62ab4 --- /dev/null +++ b/packages/client-rust/src/models/paginated_user_plex_source_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedUserPlexSourceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedUserPlexSourceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedUserPlexSourceConnectionList { + PaginatedUserPlexSourceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_user_saml_source_connection_list.rs b/packages/client-rust/src/models/paginated_user_saml_source_connection_list.rs new file mode 100644 index 0000000000..4496792aab --- /dev/null +++ b/packages/client-rust/src/models/paginated_user_saml_source_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedUserSamlSourceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedUserSamlSourceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedUserSamlSourceConnectionList { + PaginatedUserSamlSourceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_user_source_connection_list.rs b/packages/client-rust/src/models/paginated_user_source_connection_list.rs new file mode 100644 index 0000000000..6784fbcb7c --- /dev/null +++ b/packages/client-rust/src/models/paginated_user_source_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedUserSourceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedUserSourceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedUserSourceConnectionList { + PaginatedUserSourceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_user_telegram_source_connection_list.rs b/packages/client-rust/src/models/paginated_user_telegram_source_connection_list.rs new file mode 100644 index 0000000000..3eb9ceb34c --- /dev/null +++ b/packages/client-rust/src/models/paginated_user_telegram_source_connection_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedUserTelegramSourceConnectionList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedUserTelegramSourceConnectionList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedUserTelegramSourceConnectionList { + PaginatedUserTelegramSourceConnectionList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_user_write_stage_list.rs b/packages/client-rust/src/models/paginated_user_write_stage_list.rs new file mode 100644 index 0000000000..eb09c88deb --- /dev/null +++ b/packages/client-rust/src/models/paginated_user_write_stage_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedUserWriteStageList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedUserWriteStageList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedUserWriteStageList { + PaginatedUserWriteStageList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_web_authn_device_list.rs b/packages/client-rust/src/models/paginated_web_authn_device_list.rs new file mode 100644 index 0000000000..118244f29f --- /dev/null +++ b/packages/client-rust/src/models/paginated_web_authn_device_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedWebAuthnDeviceList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedWebAuthnDeviceList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedWebAuthnDeviceList { + PaginatedWebAuthnDeviceList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_web_authn_device_type_list.rs b/packages/client-rust/src/models/paginated_web_authn_device_type_list.rs new file mode 100644 index 0000000000..4075461506 --- /dev/null +++ b/packages/client-rust/src/models/paginated_web_authn_device_type_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedWebAuthnDeviceTypeList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedWebAuthnDeviceTypeList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedWebAuthnDeviceTypeList { + PaginatedWebAuthnDeviceTypeList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/paginated_ws_federation_provider_list.rs b/packages/client-rust/src/models/paginated_ws_federation_provider_list.rs new file mode 100644 index 0000000000..5c9dc3f209 --- /dev/null +++ b/packages/client-rust/src/models/paginated_ws_federation_provider_list.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginatedWsFederationProviderList { + #[serde(rename = "pagination")] + pub pagination: models::Pagination, + #[serde(rename = "results")] + pub results: Vec, + #[serde(rename = "autocomplete")] + pub autocomplete: std::collections::HashMap, +} + +impl PaginatedWsFederationProviderList { + pub fn new( + pagination: models::Pagination, + results: Vec, + autocomplete: std::collections::HashMap, + ) -> PaginatedWsFederationProviderList { + PaginatedWsFederationProviderList { + pagination, + results, + autocomplete, + } + } +} diff --git a/packages/client-rust/src/models/pagination.rs b/packages/client-rust/src/models/pagination.rs new file mode 100644 index 0000000000..cf9f29f5fb --- /dev/null +++ b/packages/client-rust/src/models/pagination.rs @@ -0,0 +1,51 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Pagination { + #[serde(rename = "next")] + pub next: f64, + #[serde(rename = "previous")] + pub previous: f64, + #[serde(rename = "count")] + pub count: f64, + #[serde(rename = "current")] + pub current: f64, + #[serde(rename = "total_pages")] + pub total_pages: f64, + #[serde(rename = "start_index")] + pub start_index: f64, + #[serde(rename = "end_index")] + pub end_index: f64, +} + +impl Pagination { + pub fn new( + next: f64, + previous: f64, + count: f64, + current: f64, + total_pages: f64, + start_index: f64, + end_index: f64, + ) -> Pagination { + Pagination { + next, + previous, + count, + current, + total_pages, + start_index, + end_index, + } + } +} diff --git a/packages/client-rust/src/models/partial_group.rs b/packages/client-rust/src/models/partial_group.rs new file mode 100644 index 0000000000..d938bdd38e --- /dev/null +++ b/packages/client-rust/src/models/partial_group.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PartialGroup : Partial Group Serializer, does not include child relations. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PartialGroup { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Get a numerical, int32 ID for the group + #[serde(rename = "num_pk")] + pub num_pk: i32, + #[serde(rename = "name")] + pub name: String, + /// Users added to this group will be superusers. + #[serde(rename = "is_superuser", skip_serializing_if = "Option::is_none")] + pub is_superuser: Option, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl PartialGroup { + /// Partial Group Serializer, does not include child relations. + pub fn new(pk: uuid::Uuid, num_pk: i32, name: String) -> PartialGroup { + PartialGroup { + pk, + num_pk, + name, + is_superuser: None, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/partial_user.rs b/packages/client-rust/src/models/partial_user.rs new file mode 100644 index 0000000000..bfc7d3b974 --- /dev/null +++ b/packages/client-rust/src/models/partial_user.rs @@ -0,0 +1,57 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PartialUser : Partial User Serializer, does not include child relations. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PartialUser { + #[serde(rename = "pk")] + pub pk: i32, + /// Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + #[serde(rename = "username")] + pub username: String, + /// User's display name. + #[serde(rename = "name")] + pub name: String, + /// Designates whether this user should be treated as active. Unselect this instead of deleting + /// accounts. + #[serde(rename = "is_active", skip_serializing_if = "Option::is_none")] + pub is_active: Option, + #[serde( + rename = "last_login", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub last_login: Option>, + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, + #[serde(rename = "uid")] + pub uid: String, +} + +impl PartialUser { + /// Partial User Serializer, does not include child relations. + pub fn new(pk: i32, username: String, name: String, uid: String) -> PartialUser { + PartialUser { + pk, + username, + name, + is_active: None, + last_login: None, + email: None, + attributes: None, + uid, + } + } +} diff --git a/packages/client-rust/src/models/password_challenge.rs b/packages/client-rust/src/models/password_challenge.rs new file mode 100644 index 0000000000..6f74674a8a --- /dev/null +++ b/packages/client-rust/src/models/password_challenge.rs @@ -0,0 +1,48 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PasswordChallenge : Password challenge UI fields +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PasswordChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "pending_user")] + pub pending_user: String, + #[serde(rename = "pending_user_avatar")] + pub pending_user_avatar: String, + #[serde(rename = "recovery_url", skip_serializing_if = "Option::is_none")] + pub recovery_url: Option, + #[serde( + rename = "allow_show_password", + skip_serializing_if = "Option::is_none" + )] + pub allow_show_password: Option, +} + +impl PasswordChallenge { + /// Password challenge UI fields + pub fn new(pending_user: String, pending_user_avatar: String) -> PasswordChallenge { + PasswordChallenge { + flow_info: None, + component: None, + response_errors: None, + pending_user, + pending_user_avatar, + recovery_url: None, + allow_show_password: None, + } + } +} diff --git a/packages/client-rust/src/models/password_challenge_response_request.rs b/packages/client-rust/src/models/password_challenge_response_request.rs new file mode 100644 index 0000000000..811a8b8618 --- /dev/null +++ b/packages/client-rust/src/models/password_challenge_response_request.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PasswordChallengeResponseRequest : Password challenge response +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PasswordChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "password")] + pub password: String, +} + +impl PasswordChallengeResponseRequest { + /// Password challenge response + pub fn new(password: String) -> PasswordChallengeResponseRequest { + PasswordChallengeResponseRequest { + component: None, + password, + } + } +} diff --git a/packages/client-rust/src/models/password_expiry_policy.rs b/packages/client-rust/src/models/password_expiry_policy.rs new file mode 100644 index 0000000000..f56c01b43b --- /dev/null +++ b/packages/client-rust/src/models/password_expiry_policy.rs @@ -0,0 +1,70 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PasswordExpiryPolicy : Password Expiry Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PasswordExpiryPolicy { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Return objects policy is bound to + #[serde(rename = "bound_to")] + pub bound_to: i32, + #[serde(rename = "days")] + pub days: i32, + #[serde(rename = "deny_only", skip_serializing_if = "Option::is_none")] + pub deny_only: Option, +} + +impl PasswordExpiryPolicy { + /// Password Expiry Policy Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + bound_to: i32, + days: i32, + ) -> PasswordExpiryPolicy { + PasswordExpiryPolicy { + pk, + name, + execution_logging: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + bound_to, + days, + deny_only: None, + } + } +} diff --git a/packages/client-rust/src/models/password_expiry_policy_request.rs b/packages/client-rust/src/models/password_expiry_policy_request.rs new file mode 100644 index 0000000000..a00871f906 --- /dev/null +++ b/packages/client-rust/src/models/password_expiry_policy_request.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PasswordExpiryPolicyRequest : Password Expiry Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PasswordExpiryPolicyRequest { + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + #[serde(rename = "days")] + pub days: i32, + #[serde(rename = "deny_only", skip_serializing_if = "Option::is_none")] + pub deny_only: Option, +} + +impl PasswordExpiryPolicyRequest { + /// Password Expiry Policy Serializer + pub fn new(name: String, days: i32) -> PasswordExpiryPolicyRequest { + PasswordExpiryPolicyRequest { + name, + execution_logging: None, + days, + deny_only: None, + } + } +} diff --git a/packages/client-rust/src/models/password_policy.rs b/packages/client-rust/src/models/password_policy.rs new file mode 100644 index 0000000000..53d7e57baf --- /dev/null +++ b/packages/client-rust/src/models/password_policy.rs @@ -0,0 +1,111 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PasswordPolicy : Password Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PasswordPolicy { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Return objects policy is bound to + #[serde(rename = "bound_to")] + pub bound_to: i32, + /// Field key to check, field keys defined in Prompt stages are available. + #[serde(rename = "password_field", skip_serializing_if = "Option::is_none")] + pub password_field: Option, + #[serde(rename = "amount_digits", skip_serializing_if = "Option::is_none")] + pub amount_digits: Option, + #[serde(rename = "amount_uppercase", skip_serializing_if = "Option::is_none")] + pub amount_uppercase: Option, + #[serde(rename = "amount_lowercase", skip_serializing_if = "Option::is_none")] + pub amount_lowercase: Option, + #[serde(rename = "amount_symbols", skip_serializing_if = "Option::is_none")] + pub amount_symbols: Option, + #[serde(rename = "length_min", skip_serializing_if = "Option::is_none")] + pub length_min: Option, + #[serde(rename = "symbol_charset", skip_serializing_if = "Option::is_none")] + pub symbol_charset: Option, + #[serde(rename = "error_message", skip_serializing_if = "Option::is_none")] + pub error_message: Option, + #[serde(rename = "check_static_rules", skip_serializing_if = "Option::is_none")] + pub check_static_rules: Option, + #[serde( + rename = "check_have_i_been_pwned", + skip_serializing_if = "Option::is_none" + )] + pub check_have_i_been_pwned: Option, + #[serde(rename = "check_zxcvbn", skip_serializing_if = "Option::is_none")] + pub check_zxcvbn: Option, + /// How many times the password hash is allowed to be on haveibeenpwned + #[serde(rename = "hibp_allowed_count", skip_serializing_if = "Option::is_none")] + pub hibp_allowed_count: Option, + /// If the zxcvbn score is equal or less than this value, the policy will fail. + #[serde( + rename = "zxcvbn_score_threshold", + skip_serializing_if = "Option::is_none" + )] + pub zxcvbn_score_threshold: Option, +} + +impl PasswordPolicy { + /// Password Policy Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + bound_to: i32, + ) -> PasswordPolicy { + PasswordPolicy { + pk, + name, + execution_logging: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + bound_to, + password_field: None, + amount_digits: None, + amount_uppercase: None, + amount_lowercase: None, + amount_symbols: None, + length_min: None, + symbol_charset: None, + error_message: None, + check_static_rules: None, + check_have_i_been_pwned: None, + check_zxcvbn: None, + hibp_allowed_count: None, + zxcvbn_score_threshold: None, + } + } +} diff --git a/packages/client-rust/src/models/password_policy_request.rs b/packages/client-rust/src/models/password_policy_request.rs new file mode 100644 index 0000000000..38874efb98 --- /dev/null +++ b/packages/client-rust/src/models/password_policy_request.rs @@ -0,0 +1,80 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PasswordPolicyRequest : Password Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PasswordPolicyRequest { + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + /// Field key to check, field keys defined in Prompt stages are available. + #[serde(rename = "password_field", skip_serializing_if = "Option::is_none")] + pub password_field: Option, + #[serde(rename = "amount_digits", skip_serializing_if = "Option::is_none")] + pub amount_digits: Option, + #[serde(rename = "amount_uppercase", skip_serializing_if = "Option::is_none")] + pub amount_uppercase: Option, + #[serde(rename = "amount_lowercase", skip_serializing_if = "Option::is_none")] + pub amount_lowercase: Option, + #[serde(rename = "amount_symbols", skip_serializing_if = "Option::is_none")] + pub amount_symbols: Option, + #[serde(rename = "length_min", skip_serializing_if = "Option::is_none")] + pub length_min: Option, + #[serde(rename = "symbol_charset", skip_serializing_if = "Option::is_none")] + pub symbol_charset: Option, + #[serde(rename = "error_message", skip_serializing_if = "Option::is_none")] + pub error_message: Option, + #[serde(rename = "check_static_rules", skip_serializing_if = "Option::is_none")] + pub check_static_rules: Option, + #[serde( + rename = "check_have_i_been_pwned", + skip_serializing_if = "Option::is_none" + )] + pub check_have_i_been_pwned: Option, + #[serde(rename = "check_zxcvbn", skip_serializing_if = "Option::is_none")] + pub check_zxcvbn: Option, + /// How many times the password hash is allowed to be on haveibeenpwned + #[serde(rename = "hibp_allowed_count", skip_serializing_if = "Option::is_none")] + pub hibp_allowed_count: Option, + /// If the zxcvbn score is equal or less than this value, the policy will fail. + #[serde( + rename = "zxcvbn_score_threshold", + skip_serializing_if = "Option::is_none" + )] + pub zxcvbn_score_threshold: Option, +} + +impl PasswordPolicyRequest { + /// Password Policy Serializer + pub fn new(name: String) -> PasswordPolicyRequest { + PasswordPolicyRequest { + name, + execution_logging: None, + password_field: None, + amount_digits: None, + amount_uppercase: None, + amount_lowercase: None, + amount_symbols: None, + length_min: None, + symbol_charset: None, + error_message: None, + check_static_rules: None, + check_have_i_been_pwned: None, + check_zxcvbn: None, + hibp_allowed_count: None, + zxcvbn_score_threshold: None, + } + } +} diff --git a/packages/client-rust/src/models/password_stage.rs b/packages/client-rust/src/models/password_stage.rs new file mode 100644 index 0000000000..acd4f1d4f2 --- /dev/null +++ b/packages/client-rust/src/models/password_stage.rs @@ -0,0 +1,87 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PasswordStage : PasswordStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PasswordStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + /// Selection of backends to test the password against. + #[serde(rename = "backends")] + pub backends: Vec, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + /// How many attempts a user has before the flow is canceled. To lock the user out, use a + /// reputation policy and a user_write stage. + #[serde( + rename = "failed_attempts_before_cancel", + skip_serializing_if = "Option::is_none" + )] + pub failed_attempts_before_cancel: Option, + /// When enabled, provides a 'show password' button with the password input field. + #[serde( + rename = "allow_show_password", + skip_serializing_if = "Option::is_none" + )] + pub allow_show_password: Option, +} + +impl PasswordStage { + /// PasswordStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + backends: Vec, + ) -> PasswordStage { + PasswordStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + backends, + configure_flow: None, + failed_attempts_before_cancel: None, + allow_show_password: None, + } + } +} diff --git a/packages/client-rust/src/models/password_stage_request.rs b/packages/client-rust/src/models/password_stage_request.rs new file mode 100644 index 0000000000..8bd5c9bac8 --- /dev/null +++ b/packages/client-rust/src/models/password_stage_request.rs @@ -0,0 +1,56 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PasswordStageRequest : PasswordStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PasswordStageRequest { + #[serde(rename = "name")] + pub name: String, + /// Selection of backends to test the password against. + #[serde(rename = "backends")] + pub backends: Vec, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + /// How many attempts a user has before the flow is canceled. To lock the user out, use a + /// reputation policy and a user_write stage. + #[serde( + rename = "failed_attempts_before_cancel", + skip_serializing_if = "Option::is_none" + )] + pub failed_attempts_before_cancel: Option, + /// When enabled, provides a 'show password' button with the password input field. + #[serde( + rename = "allow_show_password", + skip_serializing_if = "Option::is_none" + )] + pub allow_show_password: Option, +} + +impl PasswordStageRequest { + /// PasswordStage Serializer + pub fn new(name: String, backends: Vec) -> PasswordStageRequest { + PasswordStageRequest { + name, + backends, + configure_flow: None, + failed_attempts_before_cancel: None, + allow_show_password: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_agent_connector_request.rs b/packages/client-rust/src/models/patched_agent_connector_request.rs new file mode 100644 index 0000000000..a718ff1cc1 --- /dev/null +++ b/packages/client-rust/src/models/patched_agent_connector_request.rs @@ -0,0 +1,89 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedAgentConnectorRequest { + #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] + pub connector_uuid: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "snapshot_expiry", skip_serializing_if = "Option::is_none")] + pub snapshot_expiry: Option, + #[serde( + rename = "auth_session_duration", + skip_serializing_if = "Option::is_none" + )] + pub auth_session_duration: Option, + #[serde( + rename = "auth_terminate_session_on_expiry", + skip_serializing_if = "Option::is_none" + )] + pub auth_terminate_session_on_expiry: Option, + #[serde(rename = "refresh_interval", skip_serializing_if = "Option::is_none")] + pub refresh_interval: Option, + #[serde( + rename = "authorization_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authorization_flow: Option>, + #[serde(rename = "nss_uid_offset", skip_serializing_if = "Option::is_none")] + pub nss_uid_offset: Option, + #[serde(rename = "nss_gid_offset", skip_serializing_if = "Option::is_none")] + pub nss_gid_offset: Option, + #[serde( + rename = "challenge_key", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub challenge_key: Option>, + #[serde( + rename = "challenge_idle_timeout", + skip_serializing_if = "Option::is_none" + )] + pub challenge_idle_timeout: Option, + #[serde( + rename = "challenge_trigger_check_in", + skip_serializing_if = "Option::is_none" + )] + pub challenge_trigger_check_in: Option, + #[serde( + rename = "jwt_federation_providers", + skip_serializing_if = "Option::is_none" + )] + pub jwt_federation_providers: Option>, +} + +impl PatchedAgentConnectorRequest { + pub fn new() -> PatchedAgentConnectorRequest { + PatchedAgentConnectorRequest { + connector_uuid: None, + name: None, + enabled: None, + snapshot_expiry: None, + auth_session_duration: None, + auth_terminate_session_on_expiry: None, + refresh_interval: None, + authorization_flow: None, + nss_uid_offset: None, + nss_gid_offset: None, + challenge_key: None, + challenge_idle_timeout: None, + challenge_trigger_check_in: None, + jwt_federation_providers: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_application_entitlement_request.rs b/packages/client-rust/src/models/patched_application_entitlement_request.rs new file mode 100644 index 0000000000..f82aa2f3d1 --- /dev/null +++ b/packages/client-rust/src/models/patched_application_entitlement_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedApplicationEntitlementRequest : ApplicationEntitlement Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedApplicationEntitlementRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "app", skip_serializing_if = "Option::is_none")] + pub app: Option, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl PatchedApplicationEntitlementRequest { + /// ApplicationEntitlement Serializer + pub fn new() -> PatchedApplicationEntitlementRequest { + PatchedApplicationEntitlementRequest { + name: None, + app: None, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_application_request.rs b/packages/client-rust/src/models/patched_application_request.rs new file mode 100644 index 0000000000..34e4e12770 --- /dev/null +++ b/packages/client-rust/src/models/patched_application_request.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedApplicationRequest : Application Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedApplicationRequest { + /// Application's display Name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Internal application name, used in URLs. + #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] + pub slug: Option, + #[serde( + rename = "provider", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub provider: Option>, + #[serde( + rename = "backchannel_providers", + skip_serializing_if = "Option::is_none" + )] + pub backchannel_providers: Option>, + /// Open launch URL in a new browser tab or window. + #[serde(rename = "open_in_new_tab", skip_serializing_if = "Option::is_none")] + pub open_in_new_tab: Option, + #[serde(rename = "meta_launch_url", skip_serializing_if = "Option::is_none")] + pub meta_launch_url: Option, + #[serde(rename = "meta_icon", skip_serializing_if = "Option::is_none")] + pub meta_icon: Option, + #[serde(rename = "meta_description", skip_serializing_if = "Option::is_none")] + pub meta_description: Option, + #[serde(rename = "meta_publisher", skip_serializing_if = "Option::is_none")] + pub meta_publisher: Option, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + #[serde(rename = "group", skip_serializing_if = "Option::is_none")] + pub group: Option, +} + +impl PatchedApplicationRequest { + /// Application Serializer + pub fn new() -> PatchedApplicationRequest { + PatchedApplicationRequest { + name: None, + slug: None, + provider: None, + backchannel_providers: None, + open_in_new_tab: None, + meta_launch_url: None, + meta_icon: None, + meta_description: None, + meta_publisher: None, + policy_engine_mode: None, + group: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_authenticator_duo_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_duo_stage_request.rs new file mode 100644 index 0000000000..a77212c2d3 --- /dev/null +++ b/packages/client-rust/src/models/patched_authenticator_duo_stage_request.rs @@ -0,0 +1,58 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedAuthenticatorDuoStageRequest : AuthenticatorDuoStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedAuthenticatorDuoStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] + pub client_id: Option, + #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")] + pub client_secret: Option, + #[serde(rename = "api_hostname", skip_serializing_if = "Option::is_none")] + pub api_hostname: Option, + #[serde( + rename = "admin_integration_key", + skip_serializing_if = "Option::is_none" + )] + pub admin_integration_key: Option, + #[serde(rename = "admin_secret_key", skip_serializing_if = "Option::is_none")] + pub admin_secret_key: Option, +} + +impl PatchedAuthenticatorDuoStageRequest { + /// AuthenticatorDuoStage Serializer + pub fn new() -> PatchedAuthenticatorDuoStageRequest { + PatchedAuthenticatorDuoStageRequest { + name: None, + configure_flow: None, + friendly_name: None, + client_id: None, + client_secret: None, + api_hostname: None, + admin_integration_key: None, + admin_secret_key: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_authenticator_email_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_email_stage_request.rs new file mode 100644 index 0000000000..30f92e9a76 --- /dev/null +++ b/packages/client-rust/src/models/patched_authenticator_email_stage_request.rs @@ -0,0 +1,82 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedAuthenticatorEmailStageRequest : AuthenticatorEmailStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedAuthenticatorEmailStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + /// When enabled, global Email connection settings will be used and connection settings below + /// will be ignored. + #[serde( + rename = "use_global_settings", + skip_serializing_if = "Option::is_none" + )] + pub use_global_settings: Option, + #[serde(rename = "host", skip_serializing_if = "Option::is_none")] + pub host: Option, + #[serde(rename = "port", skip_serializing_if = "Option::is_none")] + pub port: Option, + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde(rename = "password", skip_serializing_if = "Option::is_none")] + pub password: Option, + #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")] + pub use_tls: Option, + #[serde(rename = "use_ssl", skip_serializing_if = "Option::is_none")] + pub use_ssl: Option, + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + #[serde(rename = "from_address", skip_serializing_if = "Option::is_none")] + pub from_address: Option, + #[serde(rename = "subject", skip_serializing_if = "Option::is_none")] + pub subject: Option, + /// Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). + #[serde(rename = "token_expiry", skip_serializing_if = "Option::is_none")] + pub token_expiry: Option, + #[serde(rename = "template", skip_serializing_if = "Option::is_none")] + pub template: Option, +} + +impl PatchedAuthenticatorEmailStageRequest { + /// AuthenticatorEmailStage Serializer + pub fn new() -> PatchedAuthenticatorEmailStageRequest { + PatchedAuthenticatorEmailStageRequest { + name: None, + configure_flow: None, + friendly_name: None, + use_global_settings: None, + host: None, + port: None, + username: None, + password: None, + use_tls: None, + use_ssl: None, + timeout: None, + from_address: None, + subject: None, + token_expiry: None, + template: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_authenticator_endpoint_gdtc_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_endpoint_gdtc_stage_request.rs new file mode 100644 index 0000000000..15ee52a204 --- /dev/null +++ b/packages/client-rust/src/models/patched_authenticator_endpoint_gdtc_stage_request.rs @@ -0,0 +1,43 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedAuthenticatorEndpointGdtcStageRequest : AuthenticatorEndpointGDTCStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedAuthenticatorEndpointGdtcStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] + pub credentials: Option>, +} + +impl PatchedAuthenticatorEndpointGdtcStageRequest { + /// AuthenticatorEndpointGDTCStage Serializer + pub fn new() -> PatchedAuthenticatorEndpointGdtcStageRequest { + PatchedAuthenticatorEndpointGdtcStageRequest { + name: None, + configure_flow: None, + friendly_name: None, + credentials: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_authenticator_sms_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_sms_stage_request.rs new file mode 100644 index 0000000000..8db5bc3133 --- /dev/null +++ b/packages/client-rust/src/models/patched_authenticator_sms_stage_request.rs @@ -0,0 +1,73 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedAuthenticatorSmsStageRequest : AuthenticatorSMSStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedAuthenticatorSmsStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "provider", skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[serde(rename = "from_number", skip_serializing_if = "Option::is_none")] + pub from_number: Option, + #[serde(rename = "account_sid", skip_serializing_if = "Option::is_none")] + pub account_sid: Option, + #[serde(rename = "auth", skip_serializing_if = "Option::is_none")] + pub auth: Option, + #[serde(rename = "auth_password", skip_serializing_if = "Option::is_none")] + pub auth_password: Option, + #[serde(rename = "auth_type", skip_serializing_if = "Option::is_none")] + pub auth_type: Option, + /// When enabled, the Phone number is only used during enrollment to verify the users + /// authenticity. Only a hash of the phone number is saved to ensure it is not reused in the + /// future. + #[serde(rename = "verify_only", skip_serializing_if = "Option::is_none")] + pub verify_only: Option, + /// Optionally modify the payload being sent to custom providers. + #[serde( + rename = "mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub mapping: Option>, +} + +impl PatchedAuthenticatorSmsStageRequest { + /// AuthenticatorSMSStage Serializer + pub fn new() -> PatchedAuthenticatorSmsStageRequest { + PatchedAuthenticatorSmsStageRequest { + name: None, + configure_flow: None, + friendly_name: None, + provider: None, + from_number: None, + account_sid: None, + auth: None, + auth_password: None, + auth_type: None, + verify_only: None, + mapping: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_authenticator_static_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_static_stage_request.rs new file mode 100644 index 0000000000..454f99925c --- /dev/null +++ b/packages/client-rust/src/models/patched_authenticator_static_stage_request.rs @@ -0,0 +1,46 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedAuthenticatorStaticStageRequest : AuthenticatorStaticStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedAuthenticatorStaticStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "token_count", skip_serializing_if = "Option::is_none")] + pub token_count: Option, + #[serde(rename = "token_length", skip_serializing_if = "Option::is_none")] + pub token_length: Option, +} + +impl PatchedAuthenticatorStaticStageRequest { + /// AuthenticatorStaticStage Serializer + pub fn new() -> PatchedAuthenticatorStaticStageRequest { + PatchedAuthenticatorStaticStageRequest { + name: None, + configure_flow: None, + friendly_name: None, + token_count: None, + token_length: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_authenticator_totp_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_totp_stage_request.rs new file mode 100644 index 0000000000..52778781af --- /dev/null +++ b/packages/client-rust/src/models/patched_authenticator_totp_stage_request.rs @@ -0,0 +1,43 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedAuthenticatorTotpStageRequest : AuthenticatorTOTPStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedAuthenticatorTotpStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "digits", skip_serializing_if = "Option::is_none")] + pub digits: Option, +} + +impl PatchedAuthenticatorTotpStageRequest { + /// AuthenticatorTOTPStage Serializer + pub fn new() -> PatchedAuthenticatorTotpStageRequest { + PatchedAuthenticatorTotpStageRequest { + name: None, + configure_flow: None, + friendly_name: None, + digits: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_authenticator_validate_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_validate_stage_request.rs new file mode 100644 index 0000000000..0569b9848a --- /dev/null +++ b/packages/client-rust/src/models/patched_authenticator_validate_stage_request.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedAuthenticatorValidateStageRequest : AuthenticatorValidateStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedAuthenticatorValidateStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde( + rename = "not_configured_action", + skip_serializing_if = "Option::is_none" + )] + pub not_configured_action: Option, + /// Device classes which can be used to authenticate + #[serde(rename = "device_classes", skip_serializing_if = "Option::is_none")] + pub device_classes: Option>, + /// Stages used to configure Authenticator when user doesn't have any compatible devices. After + /// this configuration Stage passes, the user is not prompted again. + #[serde( + rename = "configuration_stages", + skip_serializing_if = "Option::is_none" + )] + pub configuration_stages: Option>, + /// If any of the user's device has been used within this threshold, this stage will be skipped + #[serde( + rename = "last_auth_threshold", + skip_serializing_if = "Option::is_none" + )] + pub last_auth_threshold: Option, + /// Enforce user verification for WebAuthn devices. + #[serde( + rename = "webauthn_user_verification", + skip_serializing_if = "Option::is_none" + )] + pub webauthn_user_verification: Option, + #[serde(rename = "webauthn_hints", skip_serializing_if = "Option::is_none")] + pub webauthn_hints: Option>, + #[serde( + rename = "webauthn_allowed_device_types", + skip_serializing_if = "Option::is_none" + )] + pub webauthn_allowed_device_types: Option>, +} + +impl PatchedAuthenticatorValidateStageRequest { + /// AuthenticatorValidateStage Serializer + pub fn new() -> PatchedAuthenticatorValidateStageRequest { + PatchedAuthenticatorValidateStageRequest { + name: None, + not_configured_action: None, + device_classes: None, + configuration_stages: None, + last_auth_threshold: None, + webauthn_user_verification: None, + webauthn_hints: None, + webauthn_allowed_device_types: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_authenticator_web_authn_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_web_authn_stage_request.rs new file mode 100644 index 0000000000..b48058c70a --- /dev/null +++ b/packages/client-rust/src/models/patched_authenticator_web_authn_stage_request.rs @@ -0,0 +1,69 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedAuthenticatorWebAuthnStageRequest : AuthenticatorWebAuthnStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedAuthenticatorWebAuthnStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] + pub friendly_name: Option, + #[serde(rename = "user_verification", skip_serializing_if = "Option::is_none")] + pub user_verification: Option, + #[serde( + rename = "authenticator_attachment", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authenticator_attachment: Option>, + #[serde( + rename = "resident_key_requirement", + skip_serializing_if = "Option::is_none" + )] + pub resident_key_requirement: Option, + #[serde(rename = "hints", skip_serializing_if = "Option::is_none")] + pub hints: Option>, + #[serde( + rename = "device_type_restrictions", + skip_serializing_if = "Option::is_none" + )] + pub device_type_restrictions: Option>, + #[serde(rename = "max_attempts", skip_serializing_if = "Option::is_none")] + pub max_attempts: Option, +} + +impl PatchedAuthenticatorWebAuthnStageRequest { + /// AuthenticatorWebAuthnStage Serializer + pub fn new() -> PatchedAuthenticatorWebAuthnStageRequest { + PatchedAuthenticatorWebAuthnStageRequest { + name: None, + configure_flow: None, + friendly_name: None, + user_verification: None, + authenticator_attachment: None, + resident_key_requirement: None, + hints: None, + device_type_restrictions: None, + max_attempts: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_blueprint_instance_request.rs b/packages/client-rust/src/models/patched_blueprint_instance_request.rs new file mode 100644 index 0000000000..cec1b2bd16 --- /dev/null +++ b/packages/client-rust/src/models/patched_blueprint_instance_request.rs @@ -0,0 +1,39 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedBlueprintInstanceRequest : Info about a single blueprint instance file +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedBlueprintInstanceRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "path", skip_serializing_if = "Option::is_none")] + pub path: Option, + #[serde(rename = "context", skip_serializing_if = "Option::is_none")] + pub context: Option>, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, +} + +impl PatchedBlueprintInstanceRequest { + /// Info about a single blueprint instance file + pub fn new() -> PatchedBlueprintInstanceRequest { + PatchedBlueprintInstanceRequest { + name: None, + path: None, + context: None, + enabled: None, + content: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_brand_request.rs b/packages/client-rust/src/models/patched_brand_request.rs new file mode 100644 index 0000000000..bfbf3b137b --- /dev/null +++ b/packages/client-rust/src/models/patched_brand_request.rs @@ -0,0 +1,128 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedBrandRequest : Brand Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedBrandRequest { + /// Domain that activates this brand. Can be a superset, i.e. `a.b` for `aa.b` and `ba.b` + #[serde(rename = "domain", skip_serializing_if = "Option::is_none")] + pub domain: Option, + #[serde(rename = "default", skip_serializing_if = "Option::is_none")] + pub default: Option, + #[serde(rename = "branding_title", skip_serializing_if = "Option::is_none")] + pub branding_title: Option, + #[serde(rename = "branding_logo", skip_serializing_if = "Option::is_none")] + pub branding_logo: Option, + #[serde(rename = "branding_favicon", skip_serializing_if = "Option::is_none")] + pub branding_favicon: Option, + #[serde( + rename = "branding_custom_css", + skip_serializing_if = "Option::is_none" + )] + pub branding_custom_css: Option, + #[serde( + rename = "branding_default_flow_background", + skip_serializing_if = "Option::is_none" + )] + pub branding_default_flow_background: Option, + #[serde( + rename = "flow_authentication", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_authentication: Option>, + #[serde( + rename = "flow_invalidation", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_invalidation: Option>, + #[serde( + rename = "flow_recovery", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_recovery: Option>, + #[serde( + rename = "flow_unenrollment", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_unenrollment: Option>, + #[serde( + rename = "flow_user_settings", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_user_settings: Option>, + #[serde( + rename = "flow_device_code", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow_device_code: Option>, + /// When set, external users will be redirected to this application after authenticating. + #[serde( + rename = "default_application", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub default_application: Option>, + /// Web Certificate used by the authentik Core webserver. + #[serde( + rename = "web_certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub web_certificate: Option>, + /// Certificates used for client authentication. + #[serde( + rename = "client_certificates", + skip_serializing_if = "Option::is_none" + )] + pub client_certificates: Option>, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl PatchedBrandRequest { + /// Brand Serializer + pub fn new() -> PatchedBrandRequest { + PatchedBrandRequest { + domain: None, + default: None, + branding_title: None, + branding_logo: None, + branding_favicon: None, + branding_custom_css: None, + branding_default_flow_background: None, + flow_authentication: None, + flow_invalidation: None, + flow_recovery: None, + flow_unenrollment: None, + flow_user_settings: None, + flow_device_code: None, + default_application: None, + web_certificate: None, + client_certificates: None, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_captcha_stage_request.rs b/packages/client-rust/src/models/patched_captcha_stage_request.rs new file mode 100644 index 0000000000..0420a70263 --- /dev/null +++ b/packages/client-rust/src/models/patched_captcha_stage_request.rs @@ -0,0 +1,65 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedCaptchaStageRequest : CaptchaStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedCaptchaStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Public key, acquired your captcha Provider. + #[serde(rename = "public_key", skip_serializing_if = "Option::is_none")] + pub public_key: Option, + /// Private key, acquired your captcha Provider. + #[serde(rename = "private_key", skip_serializing_if = "Option::is_none")] + pub private_key: Option, + #[serde(rename = "js_url", skip_serializing_if = "Option::is_none")] + pub js_url: Option, + #[serde(rename = "api_url", skip_serializing_if = "Option::is_none")] + pub api_url: Option, + #[serde(rename = "interactive", skip_serializing_if = "Option::is_none")] + pub interactive: Option, + #[serde( + rename = "score_min_threshold", + skip_serializing_if = "Option::is_none" + )] + pub score_min_threshold: Option, + #[serde( + rename = "score_max_threshold", + skip_serializing_if = "Option::is_none" + )] + pub score_max_threshold: Option, + /// When enabled and the received captcha score is outside of the given threshold, the stage + /// will show an error message. When not enabled, the flow will continue, but the data from the + /// captcha will be available in the context for policy decisions + #[serde( + rename = "error_on_invalid_score", + skip_serializing_if = "Option::is_none" + )] + pub error_on_invalid_score: Option, +} + +impl PatchedCaptchaStageRequest { + /// CaptchaStage Serializer + pub fn new() -> PatchedCaptchaStageRequest { + PatchedCaptchaStageRequest { + name: None, + public_key: None, + private_key: None, + js_url: None, + api_url: None, + interactive: None, + score_min_threshold: None, + score_max_threshold: None, + error_on_invalid_score: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_certificate_key_pair_request.rs b/packages/client-rust/src/models/patched_certificate_key_pair_request.rs new file mode 100644 index 0000000000..b7b67abe50 --- /dev/null +++ b/packages/client-rust/src/models/patched_certificate_key_pair_request.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedCertificateKeyPairRequest : CertificateKeyPair Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedCertificateKeyPairRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// PEM-encoded Certificate data + #[serde(rename = "certificate_data", skip_serializing_if = "Option::is_none")] + pub certificate_data: Option, + /// Optional Private Key. If this is set, you can use this keypair for encryption. + #[serde(rename = "key_data", skip_serializing_if = "Option::is_none")] + pub key_data: Option, +} + +impl PatchedCertificateKeyPairRequest { + /// CertificateKeyPair Serializer + pub fn new() -> PatchedCertificateKeyPairRequest { + PatchedCertificateKeyPairRequest { + name: None, + certificate_data: None, + key_data: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_connection_token_request.rs b/packages/client-rust/src/models/patched_connection_token_request.rs new file mode 100644 index 0000000000..eb133b7953 --- /dev/null +++ b/packages/client-rust/src/models/patched_connection_token_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedConnectionTokenRequest : ConnectionToken Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedConnectionTokenRequest { + #[serde(rename = "pk", skip_serializing_if = "Option::is_none")] + pub pk: Option, + #[serde(rename = "provider", skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[serde(rename = "endpoint", skip_serializing_if = "Option::is_none")] + pub endpoint: Option, +} + +impl PatchedConnectionTokenRequest { + /// ConnectionToken Serializer + pub fn new() -> PatchedConnectionTokenRequest { + PatchedConnectionTokenRequest { + pk: None, + provider: None, + endpoint: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_consent_stage_request.rs b/packages/client-rust/src/models/patched_consent_stage_request.rs new file mode 100644 index 0000000000..c753accdac --- /dev/null +++ b/packages/client-rust/src/models/patched_consent_stage_request.rs @@ -0,0 +1,34 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedConsentStageRequest : ConsentStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedConsentStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3). + #[serde(rename = "consent_expire_in", skip_serializing_if = "Option::is_none")] + pub consent_expire_in: Option, +} + +impl PatchedConsentStageRequest { + /// ConsentStage Serializer + pub fn new() -> PatchedConsentStageRequest { + PatchedConsentStageRequest { + name: None, + mode: None, + consent_expire_in: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_deny_stage_request.rs b/packages/client-rust/src/models/patched_deny_stage_request.rs new file mode 100644 index 0000000000..632084dd02 --- /dev/null +++ b/packages/client-rust/src/models/patched_deny_stage_request.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedDenyStageRequest : DenyStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedDenyStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "deny_message", skip_serializing_if = "Option::is_none")] + pub deny_message: Option, +} + +impl PatchedDenyStageRequest { + /// DenyStage Serializer + pub fn new() -> PatchedDenyStageRequest { + PatchedDenyStageRequest { + name: None, + deny_message: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_device_access_group_request.rs b/packages/client-rust/src/models/patched_device_access_group_request.rs new file mode 100644 index 0000000000..5c99260250 --- /dev/null +++ b/packages/client-rust/src/models/patched_device_access_group_request.rs @@ -0,0 +1,28 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedDeviceAccessGroupRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl PatchedDeviceAccessGroupRequest { + pub fn new() -> PatchedDeviceAccessGroupRequest { + PatchedDeviceAccessGroupRequest { + name: None, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_device_user_binding_request.rs b/packages/client-rust/src/models/patched_device_user_binding_request.rs new file mode 100644 index 0000000000..06d611e83f --- /dev/null +++ b/packages/client-rust/src/models/patched_device_user_binding_request.rs @@ -0,0 +1,72 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedDeviceUserBindingRequest : PolicyBinding Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedDeviceUserBindingRequest { + #[serde( + rename = "policy", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub policy: Option>, + #[serde( + rename = "group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub group: Option>, + #[serde( + rename = "user", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub user: Option>, + #[serde(rename = "target", skip_serializing_if = "Option::is_none")] + pub target: Option, + /// Negates the outcome of the policy. Messages are unaffected. + #[serde(rename = "negate", skip_serializing_if = "Option::is_none")] + pub negate: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + /// Timeout after which Policy execution is terminated. + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + /// Result if the Policy execution fails. + #[serde(rename = "failure_result", skip_serializing_if = "Option::is_none")] + pub failure_result: Option, + #[serde(rename = "is_primary", skip_serializing_if = "Option::is_none")] + pub is_primary: Option, +} + +impl PatchedDeviceUserBindingRequest { + /// PolicyBinding Serializer + pub fn new() -> PatchedDeviceUserBindingRequest { + PatchedDeviceUserBindingRequest { + policy: None, + group: None, + user: None, + target: None, + negate: None, + enabled: None, + order: None, + timeout: None, + failure_result: None, + is_primary: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_docker_service_connection_request.rs b/packages/client-rust/src/models/patched_docker_service_connection_request.rs new file mode 100644 index 0000000000..ba21e2ebe7 --- /dev/null +++ b/packages/client-rust/src/models/patched_docker_service_connection_request.rs @@ -0,0 +1,54 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedDockerServiceConnectionRequest : DockerServiceConnection Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedDockerServiceConnectionRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// If enabled, use the local connection. Required Docker socket/Kubernetes Integration + #[serde(rename = "local", skip_serializing_if = "Option::is_none")] + pub local: Option, + /// Can be in the format of 'unix://' when connecting to a local docker daemon, or 'https://:2376' when connecting to a remote system. + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, + /// CA which the endpoint's Certificate is verified against. Can be left empty for no + /// validation. + #[serde( + rename = "tls_verification", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub tls_verification: Option>, + /// Certificate/Key used for authentication. Can be left empty for no authentication. + #[serde( + rename = "tls_authentication", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub tls_authentication: Option>, +} + +impl PatchedDockerServiceConnectionRequest { + /// DockerServiceConnection Serializer + pub fn new() -> PatchedDockerServiceConnectionRequest { + PatchedDockerServiceConnectionRequest { + name: None, + local: None, + url: None, + tls_verification: None, + tls_authentication: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_domain_request.rs b/packages/client-rust/src/models/patched_domain_request.rs new file mode 100644 index 0000000000..284c59ac35 --- /dev/null +++ b/packages/client-rust/src/models/patched_domain_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedDomainRequest : Domain Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedDomainRequest { + #[serde(rename = "domain", skip_serializing_if = "Option::is_none")] + pub domain: Option, + #[serde(rename = "is_primary", skip_serializing_if = "Option::is_none")] + pub is_primary: Option, + #[serde(rename = "tenant", skip_serializing_if = "Option::is_none")] + pub tenant: Option, +} + +impl PatchedDomainRequest { + /// Domain Serializer + pub fn new() -> PatchedDomainRequest { + PatchedDomainRequest { + domain: None, + is_primary: None, + tenant: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_dummy_policy_request.rs b/packages/client-rust/src/models/patched_dummy_policy_request.rs new file mode 100644 index 0000000000..4779e25837 --- /dev/null +++ b/packages/client-rust/src/models/patched_dummy_policy_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedDummyPolicyRequest : Dummy Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedDummyPolicyRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + #[serde(rename = "result", skip_serializing_if = "Option::is_none")] + pub result: Option, + #[serde(rename = "wait_min", skip_serializing_if = "Option::is_none")] + pub wait_min: Option, + #[serde(rename = "wait_max", skip_serializing_if = "Option::is_none")] + pub wait_max: Option, +} + +impl PatchedDummyPolicyRequest { + /// Dummy Policy Serializer + pub fn new() -> PatchedDummyPolicyRequest { + PatchedDummyPolicyRequest { + name: None, + execution_logging: None, + result: None, + wait_min: None, + wait_max: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_dummy_stage_request.rs b/packages/client-rust/src/models/patched_dummy_stage_request.rs new file mode 100644 index 0000000000..1860e34b89 --- /dev/null +++ b/packages/client-rust/src/models/patched_dummy_stage_request.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedDummyStageRequest : DummyStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedDummyStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "throw_error", skip_serializing_if = "Option::is_none")] + pub throw_error: Option, +} + +impl PatchedDummyStageRequest { + /// DummyStage Serializer + pub fn new() -> PatchedDummyStageRequest { + PatchedDummyStageRequest { + name: None, + throw_error: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_duo_device_request.rs b/packages/client-rust/src/models/patched_duo_device_request.rs new file mode 100644 index 0000000000..7a96be6697 --- /dev/null +++ b/packages/client-rust/src/models/patched_duo_device_request.rs @@ -0,0 +1,26 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedDuoDeviceRequest : Serializer for Duo authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedDuoDeviceRequest { + /// The human-readable name of this device. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl PatchedDuoDeviceRequest { + /// Serializer for Duo authenticator devices + pub fn new() -> PatchedDuoDeviceRequest { + PatchedDuoDeviceRequest { name: None } + } +} diff --git a/packages/client-rust/src/models/patched_email_device_request.rs b/packages/client-rust/src/models/patched_email_device_request.rs new file mode 100644 index 0000000000..fe5bbc9d33 --- /dev/null +++ b/packages/client-rust/src/models/patched_email_device_request.rs @@ -0,0 +1,26 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedEmailDeviceRequest : Serializer for email authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedEmailDeviceRequest { + /// The human-readable name of this device. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl PatchedEmailDeviceRequest { + /// Serializer for email authenticator devices + pub fn new() -> PatchedEmailDeviceRequest { + PatchedEmailDeviceRequest { name: None } + } +} diff --git a/packages/client-rust/src/models/patched_email_stage_request.rs b/packages/client-rust/src/models/patched_email_stage_request.rs new file mode 100644 index 0000000000..aad526b827 --- /dev/null +++ b/packages/client-rust/src/models/patched_email_stage_request.rs @@ -0,0 +1,91 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedEmailStageRequest : EmailStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedEmailStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// When enabled, global Email connection settings will be used and connection settings below + /// will be ignored. + #[serde( + rename = "use_global_settings", + skip_serializing_if = "Option::is_none" + )] + pub use_global_settings: Option, + #[serde(rename = "host", skip_serializing_if = "Option::is_none")] + pub host: Option, + #[serde(rename = "port", skip_serializing_if = "Option::is_none")] + pub port: Option, + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde(rename = "password", skip_serializing_if = "Option::is_none")] + pub password: Option, + #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")] + pub use_tls: Option, + #[serde(rename = "use_ssl", skip_serializing_if = "Option::is_none")] + pub use_ssl: Option, + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + #[serde(rename = "from_address", skip_serializing_if = "Option::is_none")] + pub from_address: Option, + /// Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). + #[serde(rename = "token_expiry", skip_serializing_if = "Option::is_none")] + pub token_expiry: Option, + #[serde(rename = "subject", skip_serializing_if = "Option::is_none")] + pub subject: Option, + #[serde(rename = "template", skip_serializing_if = "Option::is_none")] + pub template: Option, + /// Activate users upon completion of stage. + #[serde( + rename = "activate_user_on_success", + skip_serializing_if = "Option::is_none" + )] + pub activate_user_on_success: Option, + #[serde( + rename = "recovery_max_attempts", + skip_serializing_if = "Option::is_none" + )] + pub recovery_max_attempts: Option, + /// The time window used to count recent account recovery attempts. If the number of attempts + /// exceed recovery_max_attempts within this period, further attempts will be rate-limited. + /// (Format: hours=1;minutes=2;seconds=3). + #[serde( + rename = "recovery_cache_timeout", + skip_serializing_if = "Option::is_none" + )] + pub recovery_cache_timeout: Option, +} + +impl PatchedEmailStageRequest { + /// EmailStage Serializer + pub fn new() -> PatchedEmailStageRequest { + PatchedEmailStageRequest { + name: None, + use_global_settings: None, + host: None, + port: None, + username: None, + password: None, + use_tls: None, + use_ssl: None, + timeout: None, + from_address: None, + token_expiry: None, + subject: None, + template: None, + activate_user_on_success: None, + recovery_max_attempts: None, + recovery_cache_timeout: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_endpoint_device_request.rs b/packages/client-rust/src/models/patched_endpoint_device_request.rs new file mode 100644 index 0000000000..f2cf330fd4 --- /dev/null +++ b/packages/client-rust/src/models/patched_endpoint_device_request.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedEndpointDeviceRequest { + #[serde(rename = "device_uuid", skip_serializing_if = "Option::is_none")] + pub device_uuid: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde( + rename = "access_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub access_group: Option>, + #[serde(rename = "access_group_obj", skip_serializing_if = "Option::is_none")] + pub access_group_obj: Option, + #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] + pub expiring: Option, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl PatchedEndpointDeviceRequest { + pub fn new() -> PatchedEndpointDeviceRequest { + PatchedEndpointDeviceRequest { + device_uuid: None, + name: None, + access_group: None, + access_group_obj: None, + expiring: None, + expires: None, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_endpoint_request.rs b/packages/client-rust/src/models/patched_endpoint_request.rs new file mode 100644 index 0000000000..9db491b868 --- /dev/null +++ b/packages/client-rust/src/models/patched_endpoint_request.rs @@ -0,0 +1,51 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedEndpointRequest : Endpoint Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedEndpointRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "provider", skip_serializing_if = "Option::is_none")] + pub provider: Option, + #[serde(rename = "protocol", skip_serializing_if = "Option::is_none")] + pub protocol: Option, + #[serde(rename = "host", skip_serializing_if = "Option::is_none")] + pub host: Option, + #[serde(rename = "settings", skip_serializing_if = "Option::is_none")] + pub settings: Option>, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + #[serde(rename = "auth_mode", skip_serializing_if = "Option::is_none")] + pub auth_mode: Option, + #[serde( + rename = "maximum_connections", + skip_serializing_if = "Option::is_none" + )] + pub maximum_connections: Option, +} + +impl PatchedEndpointRequest { + /// Endpoint Serializer + pub fn new() -> PatchedEndpointRequest { + PatchedEndpointRequest { + name: None, + provider: None, + protocol: None, + host: None, + settings: None, + property_mappings: None, + auth_mode: None, + maximum_connections: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_endpoint_stage_request.rs b/packages/client-rust/src/models/patched_endpoint_stage_request.rs new file mode 100644 index 0000000000..b989c5a45c --- /dev/null +++ b/packages/client-rust/src/models/patched_endpoint_stage_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedEndpointStageRequest : EndpointStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedEndpointStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "connector", skip_serializing_if = "Option::is_none")] + pub connector: Option, + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, +} + +impl PatchedEndpointStageRequest { + /// EndpointStage Serializer + pub fn new() -> PatchedEndpointStageRequest { + PatchedEndpointStageRequest { + name: None, + connector: None, + mode: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_enrollment_token_request.rs b/packages/client-rust/src/models/patched_enrollment_token_request.rs new file mode 100644 index 0000000000..202405d953 --- /dev/null +++ b/packages/client-rust/src/models/patched_enrollment_token_request.rs @@ -0,0 +1,47 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedEnrollmentTokenRequest { + #[serde( + rename = "device_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub device_group: Option>, + #[serde(rename = "connector", skip_serializing_if = "Option::is_none")] + pub connector: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] + pub expiring: Option, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, +} + +impl PatchedEnrollmentTokenRequest { + pub fn new() -> PatchedEnrollmentTokenRequest { + PatchedEnrollmentTokenRequest { + device_group: None, + connector: None, + name: None, + expiring: None, + expires: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_event_matcher_policy_request.rs b/packages/client-rust/src/models/patched_event_matcher_policy_request.rs new file mode 100644 index 0000000000..c77202db26 --- /dev/null +++ b/packages/client-rust/src/models/patched_event_matcher_policy_request.rs @@ -0,0 +1,71 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedEventMatcherPolicyRequest : Event Matcher Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedEventMatcherPolicyRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + /// Match created events with this action type. When left empty, all action types will be + /// matched. + #[serde( + rename = "action", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub action: Option>, + /// Matches Event's Client IP (strict matching, for network matching use an Expression Policy) + #[serde( + rename = "client_ip", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub client_ip: Option>, + /// Match events created by selected application. When left empty, all applications are + /// matched. + #[serde( + rename = "app", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub app: Option>, + /// Match events created by selected model. When left empty, all models are matched. When an + /// app is selected, all the application's models are matched. + #[serde( + rename = "model", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub model: Option>, +} + +impl PatchedEventMatcherPolicyRequest { + /// Event Matcher Policy Serializer + pub fn new() -> PatchedEventMatcherPolicyRequest { + PatchedEventMatcherPolicyRequest { + name: None, + execution_logging: None, + action: None, + client_ip: None, + app: None, + model: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_event_request.rs b/packages/client-rust/src/models/patched_event_request.rs new file mode 100644 index 0000000000..febea710bc --- /dev/null +++ b/packages/client-rust/src/models/patched_event_request.rs @@ -0,0 +1,50 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedEventRequest : Event Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedEventRequest { + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option>, + #[serde(rename = "action", skip_serializing_if = "Option::is_none")] + pub action: Option, + #[serde(rename = "app", skip_serializing_if = "Option::is_none")] + pub app: Option, + #[serde(rename = "context", skip_serializing_if = "Option::is_none")] + pub context: Option>, + #[serde( + rename = "client_ip", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub client_ip: Option>, + #[serde(rename = "expires", skip_serializing_if = "Option::is_none")] + pub expires: Option, + #[serde(rename = "brand", skip_serializing_if = "Option::is_none")] + pub brand: Option>, +} + +impl PatchedEventRequest { + /// Event Serializer + pub fn new() -> PatchedEventRequest { + PatchedEventRequest { + user: None, + action: None, + app: None, + context: None, + client_ip: None, + expires: None, + brand: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_expression_policy_request.rs b/packages/client-rust/src/models/patched_expression_policy_request.rs new file mode 100644 index 0000000000..96bc7ae1f5 --- /dev/null +++ b/packages/client-rust/src/models/patched_expression_policy_request.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedExpressionPolicyRequest : Group Membership Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedExpressionPolicyRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, +} + +impl PatchedExpressionPolicyRequest { + /// Group Membership Policy Serializer + pub fn new() -> PatchedExpressionPolicyRequest { + PatchedExpressionPolicyRequest { + name: None, + execution_logging: None, + expression: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_fleet_connector_request.rs b/packages/client-rust/src/models/patched_fleet_connector_request.rs new file mode 100644 index 0000000000..f72e0e2bec --- /dev/null +++ b/packages/client-rust/src/models/patched_fleet_connector_request.rs @@ -0,0 +1,58 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedFleetConnectorRequest : FleetConnector Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedFleetConnectorRequest { + #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] + pub connector_uuid: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, + #[serde(rename = "token", skip_serializing_if = "Option::is_none")] + pub token: Option, + /// Configure additional headers to be sent. Mapping should return a dictionary of key-value + /// pairs + #[serde( + rename = "headers_mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub headers_mapping: Option>, + #[serde(rename = "map_users", skip_serializing_if = "Option::is_none")] + pub map_users: Option, + #[serde( + rename = "map_teams_access_group", + skip_serializing_if = "Option::is_none" + )] + pub map_teams_access_group: Option, +} + +impl PatchedFleetConnectorRequest { + /// FleetConnector Serializer + pub fn new() -> PatchedFleetConnectorRequest { + PatchedFleetConnectorRequest { + connector_uuid: None, + name: None, + enabled: None, + url: None, + token: None, + headers_mapping: None, + map_users: None, + map_teams_access_group: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_flow_request.rs b/packages/client-rust/src/models/patched_flow_request.rs new file mode 100644 index 0000000000..312fdf62fe --- /dev/null +++ b/packages/client-rust/src/models/patched_flow_request.rs @@ -0,0 +1,63 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedFlowRequest : Flow Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedFlowRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Visible in the URL. + #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] + pub slug: Option, + /// Shown as the Title in Flow pages. + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + /// Decides what this Flow is used for. For example, the Authentication flow is redirect to + /// when an un-authenticated user visits authentik. + #[serde(rename = "designation", skip_serializing_if = "Option::is_none")] + pub designation: Option, + /// Background shown during execution + #[serde(rename = "background", skip_serializing_if = "Option::is_none")] + pub background: Option, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// Enable compatibility mode, increases compatibility with password managers on mobile + /// devices. + #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")] + pub compatibility_mode: Option, + #[serde(rename = "layout", skip_serializing_if = "Option::is_none")] + pub layout: Option, + /// Configure what should happen when a flow denies access to a user. + #[serde(rename = "denied_action", skip_serializing_if = "Option::is_none")] + pub denied_action: Option, + /// Required level of authentication and authorization to access a flow. + #[serde(rename = "authentication", skip_serializing_if = "Option::is_none")] + pub authentication: Option, +} + +impl PatchedFlowRequest { + /// Flow Serializer + pub fn new() -> PatchedFlowRequest { + PatchedFlowRequest { + name: None, + slug: None, + title: None, + designation: None, + background: None, + policy_engine_mode: None, + compatibility_mode: None, + layout: None, + denied_action: None, + authentication: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_flow_stage_binding_request.rs b/packages/client-rust/src/models/patched_flow_stage_binding_request.rs new file mode 100644 index 0000000000..b4d8f89900 --- /dev/null +++ b/packages/client-rust/src/models/patched_flow_stage_binding_request.rs @@ -0,0 +1,57 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedFlowStageBindingRequest : FlowStageBinding Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedFlowStageBindingRequest { + #[serde(rename = "target", skip_serializing_if = "Option::is_none")] + pub target: Option, + #[serde(rename = "stage", skip_serializing_if = "Option::is_none")] + pub stage: Option, + /// Evaluate policies during the Flow planning process. + #[serde(rename = "evaluate_on_plan", skip_serializing_if = "Option::is_none")] + pub evaluate_on_plan: Option, + /// Evaluate policies when the Stage is presented to the user. + #[serde( + rename = "re_evaluate_policies", + skip_serializing_if = "Option::is_none" + )] + pub re_evaluate_policies: Option, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// Configure how the flow executor should handle an invalid response to a challenge. RETRY + /// returns the error message and a similar challenge to the executor. RESTART restarts the + /// flow from the beginning, and RESTART_WITH_CONTEXT restarts the flow while keeping the + /// current context. + #[serde( + rename = "invalid_response_action", + skip_serializing_if = "Option::is_none" + )] + pub invalid_response_action: Option, +} + +impl PatchedFlowStageBindingRequest { + /// FlowStageBinding Serializer + pub fn new() -> PatchedFlowStageBindingRequest { + PatchedFlowStageBindingRequest { + target: None, + stage: None, + evaluate_on_plan: None, + re_evaluate_policies: None, + order: None, + policy_engine_mode: None, + invalid_response_action: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_geo_ip_policy_request.rs b/packages/client-rust/src/models/patched_geo_ip_policy_request.rs new file mode 100644 index 0000000000..2bd63c5f5f --- /dev/null +++ b/packages/client-rust/src/models/patched_geo_ip_policy_request.rs @@ -0,0 +1,74 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedGeoIpPolicyRequest : GeoIP Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedGeoIpPolicyRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + #[serde(rename = "asns", skip_serializing_if = "Option::is_none")] + pub asns: Option>, + #[serde(rename = "countries", skip_serializing_if = "Option::is_none")] + pub countries: Option>, + #[serde( + rename = "check_history_distance", + skip_serializing_if = "Option::is_none" + )] + pub check_history_distance: Option, + #[serde( + rename = "history_max_distance_km", + skip_serializing_if = "Option::is_none" + )] + pub history_max_distance_km: Option, + #[serde( + rename = "distance_tolerance_km", + skip_serializing_if = "Option::is_none" + )] + pub distance_tolerance_km: Option, + #[serde( + rename = "history_login_count", + skip_serializing_if = "Option::is_none" + )] + pub history_login_count: Option, + #[serde( + rename = "check_impossible_travel", + skip_serializing_if = "Option::is_none" + )] + pub check_impossible_travel: Option, + #[serde( + rename = "impossible_tolerance_km", + skip_serializing_if = "Option::is_none" + )] + pub impossible_tolerance_km: Option, +} + +impl PatchedGeoIpPolicyRequest { + /// GeoIP Policy Serializer + pub fn new() -> PatchedGeoIpPolicyRequest { + PatchedGeoIpPolicyRequest { + name: None, + execution_logging: None, + asns: None, + countries: None, + check_history_distance: None, + history_max_distance_km: None, + distance_tolerance_km: None, + history_login_count: None, + check_impossible_travel: None, + impossible_tolerance_km: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_google_chrome_connector_request.rs b/packages/client-rust/src/models/patched_google_chrome_connector_request.rs new file mode 100644 index 0000000000..3e4fccf6c6 --- /dev/null +++ b/packages/client-rust/src/models/patched_google_chrome_connector_request.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedGoogleChromeConnectorRequest : GoogleChromeConnector Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedGoogleChromeConnectorRequest { + #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] + pub connector_uuid: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] + pub credentials: Option>, +} + +impl PatchedGoogleChromeConnectorRequest { + /// GoogleChromeConnector Serializer + pub fn new() -> PatchedGoogleChromeConnectorRequest { + PatchedGoogleChromeConnectorRequest { + connector_uuid: None, + name: None, + enabled: None, + credentials: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_google_endpoint_device_request.rs b/packages/client-rust/src/models/patched_google_endpoint_device_request.rs new file mode 100644 index 0000000000..14175a3067 --- /dev/null +++ b/packages/client-rust/src/models/patched_google_endpoint_device_request.rs @@ -0,0 +1,31 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedGoogleEndpointDeviceRequest : Serializer for Endpoint authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedGoogleEndpointDeviceRequest { + #[serde(rename = "pk", skip_serializing_if = "Option::is_none")] + pub pk: Option, + /// The human-readable name of this device. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl PatchedGoogleEndpointDeviceRequest { + /// Serializer for Endpoint authenticator devices + pub fn new() -> PatchedGoogleEndpointDeviceRequest { + PatchedGoogleEndpointDeviceRequest { + pk: None, + name: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_google_workspace_provider_mapping_request.rs b/packages/client-rust/src/models/patched_google_workspace_provider_mapping_request.rs new file mode 100644 index 0000000000..6f4ad697a4 --- /dev/null +++ b/packages/client-rust/src/models/patched_google_workspace_provider_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedGoogleWorkspaceProviderMappingRequest : GoogleWorkspaceProviderMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedGoogleWorkspaceProviderMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, +} + +impl PatchedGoogleWorkspaceProviderMappingRequest { + /// GoogleWorkspaceProviderMapping Serializer + pub fn new() -> PatchedGoogleWorkspaceProviderMappingRequest { + PatchedGoogleWorkspaceProviderMappingRequest { + managed: None, + name: None, + expression: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_google_workspace_provider_request.rs b/packages/client-rust/src/models/patched_google_workspace_provider_request.rs new file mode 100644 index 0000000000..74716ec082 --- /dev/null +++ b/packages/client-rust/src/models/patched_google_workspace_provider_request.rs @@ -0,0 +1,87 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedGoogleWorkspaceProviderRequest : GoogleWorkspaceProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedGoogleWorkspaceProviderRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Property mappings used for group creation/updating. + #[serde( + rename = "property_mappings_group", + skip_serializing_if = "Option::is_none" + )] + pub property_mappings_group: Option>, + #[serde(rename = "delegated_subject", skip_serializing_if = "Option::is_none")] + pub delegated_subject: Option, + #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] + pub credentials: Option>, + #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")] + pub scopes: Option, + #[serde( + rename = "exclude_users_service_account", + skip_serializing_if = "Option::is_none" + )] + pub exclude_users_service_account: Option, + #[serde( + rename = "filter_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub filter_group: Option>, + #[serde(rename = "user_delete_action", skip_serializing_if = "Option::is_none")] + pub user_delete_action: Option, + #[serde( + rename = "group_delete_action", + skip_serializing_if = "Option::is_none" + )] + pub group_delete_action: Option, + #[serde( + rename = "default_group_email_domain", + skip_serializing_if = "Option::is_none" + )] + pub default_group_email_domain: Option, + /// Controls the number of objects synced in a single task + #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] + pub sync_page_size: Option, + /// Timeout for synchronization of a single page + #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] + pub sync_page_timeout: Option, + /// When enabled, provider will not modify or create objects in the remote system. + #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] + pub dry_run: Option, +} + +impl PatchedGoogleWorkspaceProviderRequest { + /// GoogleWorkspaceProvider Serializer + pub fn new() -> PatchedGoogleWorkspaceProviderRequest { + PatchedGoogleWorkspaceProviderRequest { + name: None, + property_mappings: None, + property_mappings_group: None, + delegated_subject: None, + credentials: None, + scopes: None, + exclude_users_service_account: None, + filter_group: None, + user_delete_action: None, + group_delete_action: None, + default_group_email_domain: None, + sync_page_size: None, + sync_page_timeout: None, + dry_run: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_group_kerberos_source_connection_request.rs b/packages/client-rust/src/models/patched_group_kerberos_source_connection_request.rs new file mode 100644 index 0000000000..2d1020bcb3 --- /dev/null +++ b/packages/client-rust/src/models/patched_group_kerberos_source_connection_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedGroupKerberosSourceConnectionRequest : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedGroupKerberosSourceConnectionRequest { + #[serde(rename = "group", skip_serializing_if = "Option::is_none")] + pub group: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] + pub identifier: Option, +} + +impl PatchedGroupKerberosSourceConnectionRequest { + /// Group Source Connection + pub fn new() -> PatchedGroupKerberosSourceConnectionRequest { + PatchedGroupKerberosSourceConnectionRequest { + group: None, + source: None, + identifier: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_group_ldap_source_connection_request.rs b/packages/client-rust/src/models/patched_group_ldap_source_connection_request.rs new file mode 100644 index 0000000000..a90e4ee142 --- /dev/null +++ b/packages/client-rust/src/models/patched_group_ldap_source_connection_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedGroupLdapSourceConnectionRequest : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedGroupLdapSourceConnectionRequest { + #[serde(rename = "group", skip_serializing_if = "Option::is_none")] + pub group: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] + pub identifier: Option, +} + +impl PatchedGroupLdapSourceConnectionRequest { + /// Group Source Connection + pub fn new() -> PatchedGroupLdapSourceConnectionRequest { + PatchedGroupLdapSourceConnectionRequest { + group: None, + source: None, + identifier: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_group_o_auth_source_connection_request.rs b/packages/client-rust/src/models/patched_group_o_auth_source_connection_request.rs new file mode 100644 index 0000000000..f85046521d --- /dev/null +++ b/packages/client-rust/src/models/patched_group_o_auth_source_connection_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedGroupOAuthSourceConnectionRequest : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedGroupOAuthSourceConnectionRequest { + #[serde(rename = "group", skip_serializing_if = "Option::is_none")] + pub group: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] + pub identifier: Option, +} + +impl PatchedGroupOAuthSourceConnectionRequest { + /// Group Source Connection + pub fn new() -> PatchedGroupOAuthSourceConnectionRequest { + PatchedGroupOAuthSourceConnectionRequest { + group: None, + source: None, + identifier: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_group_plex_source_connection_request.rs b/packages/client-rust/src/models/patched_group_plex_source_connection_request.rs new file mode 100644 index 0000000000..1eeb3bb50d --- /dev/null +++ b/packages/client-rust/src/models/patched_group_plex_source_connection_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedGroupPlexSourceConnectionRequest : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedGroupPlexSourceConnectionRequest { + #[serde(rename = "group", skip_serializing_if = "Option::is_none")] + pub group: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] + pub identifier: Option, +} + +impl PatchedGroupPlexSourceConnectionRequest { + /// Group Source Connection + pub fn new() -> PatchedGroupPlexSourceConnectionRequest { + PatchedGroupPlexSourceConnectionRequest { + group: None, + source: None, + identifier: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_group_request.rs b/packages/client-rust/src/models/patched_group_request.rs new file mode 100644 index 0000000000..ef03433263 --- /dev/null +++ b/packages/client-rust/src/models/patched_group_request.rs @@ -0,0 +1,43 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedGroupRequest : Group Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedGroupRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Users added to this group will be superusers. + #[serde(rename = "is_superuser", skip_serializing_if = "Option::is_none")] + pub is_superuser: Option, + #[serde(rename = "parents", skip_serializing_if = "Option::is_none")] + pub parents: Option>, + #[serde(rename = "users", skip_serializing_if = "Option::is_none")] + pub users: Option>, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, + #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] + pub roles: Option>, +} + +impl PatchedGroupRequest { + /// Group Serializer + pub fn new() -> PatchedGroupRequest { + PatchedGroupRequest { + name: None, + is_superuser: None, + parents: None, + users: None, + attributes: None, + roles: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_group_saml_source_connection_request.rs b/packages/client-rust/src/models/patched_group_saml_source_connection_request.rs new file mode 100644 index 0000000000..67ac8bcac9 --- /dev/null +++ b/packages/client-rust/src/models/patched_group_saml_source_connection_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedGroupSamlSourceConnectionRequest : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedGroupSamlSourceConnectionRequest { + #[serde(rename = "group", skip_serializing_if = "Option::is_none")] + pub group: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] + pub identifier: Option, +} + +impl PatchedGroupSamlSourceConnectionRequest { + /// Group Source Connection + pub fn new() -> PatchedGroupSamlSourceConnectionRequest { + PatchedGroupSamlSourceConnectionRequest { + group: None, + source: None, + identifier: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_group_source_connection_request.rs b/packages/client-rust/src/models/patched_group_source_connection_request.rs new file mode 100644 index 0000000000..c32db429c2 --- /dev/null +++ b/packages/client-rust/src/models/patched_group_source_connection_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedGroupSourceConnectionRequest : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedGroupSourceConnectionRequest { + #[serde(rename = "group", skip_serializing_if = "Option::is_none")] + pub group: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] + pub identifier: Option, +} + +impl PatchedGroupSourceConnectionRequest { + /// Group Source Connection + pub fn new() -> PatchedGroupSourceConnectionRequest { + PatchedGroupSourceConnectionRequest { + group: None, + source: None, + identifier: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_group_telegram_source_connection_request.rs b/packages/client-rust/src/models/patched_group_telegram_source_connection_request.rs new file mode 100644 index 0000000000..81f88d59ff --- /dev/null +++ b/packages/client-rust/src/models/patched_group_telegram_source_connection_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedGroupTelegramSourceConnectionRequest : Group Source Connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedGroupTelegramSourceConnectionRequest { + #[serde(rename = "group", skip_serializing_if = "Option::is_none")] + pub group: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] + pub identifier: Option, +} + +impl PatchedGroupTelegramSourceConnectionRequest { + /// Group Source Connection + pub fn new() -> PatchedGroupTelegramSourceConnectionRequest { + PatchedGroupTelegramSourceConnectionRequest { + group: None, + source: None, + identifier: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_identification_stage_request.rs b/packages/client-rust/src/models/patched_identification_stage_request.rs new file mode 100644 index 0000000000..8f7b35e8ab --- /dev/null +++ b/packages/client-rust/src/models/patched_identification_stage_request.rs @@ -0,0 +1,118 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedIdentificationStageRequest : IdentificationStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedIdentificationStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Fields of the user object to match against. (Hold shift to select multiple options) + #[serde(rename = "user_fields", skip_serializing_if = "Option::is_none")] + pub user_fields: Option>, + /// When set, shows a password field, instead of showing the password field as separate step. + #[serde( + rename = "password_stage", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub password_stage: Option>, + /// When set, adds functionality exactly like a Captcha stage, but baked into the + /// Identification stage. + #[serde( + rename = "captcha_stage", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub captcha_stage: Option>, + /// When enabled, user fields are matched regardless of their casing. + #[serde( + rename = "case_insensitive_matching", + skip_serializing_if = "Option::is_none" + )] + pub case_insensitive_matching: Option, + /// When a valid username/email has been entered, and this option is enabled, the user's + /// username and avatar will be shown. Otherwise, the text that the user entered will be shown + #[serde(rename = "show_matched_user", skip_serializing_if = "Option::is_none")] + pub show_matched_user: Option, + /// Optional enrollment flow, which is linked at the bottom of the page. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + /// Optional recovery flow, which is linked at the bottom of the page. + #[serde( + rename = "recovery_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub recovery_flow: Option>, + /// Optional passwordless flow, which is linked at the bottom of the page. + #[serde( + rename = "passwordless_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub passwordless_flow: Option>, + /// Specify which sources should be shown. + #[serde(rename = "sources", skip_serializing_if = "Option::is_none")] + pub sources: Option>, + #[serde(rename = "show_source_labels", skip_serializing_if = "Option::is_none")] + pub show_source_labels: Option, + /// When enabled, the stage will succeed and continue even when incorrect user info is entered. + #[serde( + rename = "pretend_user_exists", + skip_serializing_if = "Option::is_none" + )] + pub pretend_user_exists: Option, + /// Show the user the 'Remember me on this device' toggle, allowing repeat users to skip + /// straight to entering their password. + #[serde(rename = "enable_remember_me", skip_serializing_if = "Option::is_none")] + pub enable_remember_me: Option, + /// When set, and conditional WebAuthn is available, allow the user to use their passkey as a + /// first factor. + #[serde( + rename = "webauthn_stage", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub webauthn_stage: Option>, +} + +impl PatchedIdentificationStageRequest { + /// IdentificationStage Serializer + pub fn new() -> PatchedIdentificationStageRequest { + PatchedIdentificationStageRequest { + name: None, + user_fields: None, + password_stage: None, + captcha_stage: None, + case_insensitive_matching: None, + show_matched_user: None, + enrollment_flow: None, + recovery_flow: None, + passwordless_flow: None, + sources: None, + show_source_labels: None, + pretend_user_exists: None, + enable_remember_me: None, + webauthn_stage: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_initial_permissions_request.rs b/packages/client-rust/src/models/patched_initial_permissions_request.rs new file mode 100644 index 0000000000..57812b6754 --- /dev/null +++ b/packages/client-rust/src/models/patched_initial_permissions_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedInitialPermissionsRequest : InitialPermissions serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedInitialPermissionsRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "role", skip_serializing_if = "Option::is_none")] + pub role: Option, + #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] + pub permissions: Option>, +} + +impl PatchedInitialPermissionsRequest { + /// InitialPermissions serializer + pub fn new() -> PatchedInitialPermissionsRequest { + PatchedInitialPermissionsRequest { + name: None, + role: None, + permissions: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_invitation_request.rs b/packages/client-rust/src/models/patched_invitation_request.rs new file mode 100644 index 0000000000..7bf691201c --- /dev/null +++ b/packages/client-rust/src/models/patched_invitation_request.rs @@ -0,0 +1,51 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedInvitationRequest : Invitation Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedInvitationRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, + #[serde(rename = "fixed_data", skip_serializing_if = "Option::is_none")] + pub fixed_data: Option>, + /// When enabled, the invitation will be deleted after usage. + #[serde(rename = "single_use", skip_serializing_if = "Option::is_none")] + pub single_use: Option, + /// When set, only the configured flow can use this invitation. + #[serde( + rename = "flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub flow: Option>, +} + +impl PatchedInvitationRequest { + /// Invitation Serializer + pub fn new() -> PatchedInvitationRequest { + PatchedInvitationRequest { + name: None, + expires: None, + fixed_data: None, + single_use: None, + flow: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_invitation_stage_request.rs b/packages/client-rust/src/models/patched_invitation_stage_request.rs new file mode 100644 index 0000000000..9a83b2ab79 --- /dev/null +++ b/packages/client-rust/src/models/patched_invitation_stage_request.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedInvitationStageRequest : InvitationStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedInvitationStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// If this flag is set, this Stage will jump to the next Stage when no Invitation is given. By + /// default this Stage will cancel the Flow when no invitation is given. + #[serde( + rename = "continue_flow_without_invitation", + skip_serializing_if = "Option::is_none" + )] + pub continue_flow_without_invitation: Option, +} + +impl PatchedInvitationStageRequest { + /// InvitationStage Serializer + pub fn new() -> PatchedInvitationStageRequest { + PatchedInvitationStageRequest { + name: None, + continue_flow_without_invitation: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_kerberos_source_property_mapping_request.rs b/packages/client-rust/src/models/patched_kerberos_source_property_mapping_request.rs new file mode 100644 index 0000000000..10cc57e319 --- /dev/null +++ b/packages/client-rust/src/models/patched_kerberos_source_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedKerberosSourcePropertyMappingRequest : Kerberos PropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedKerberosSourcePropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, +} + +impl PatchedKerberosSourcePropertyMappingRequest { + /// Kerberos PropertyMapping Serializer + pub fn new() -> PatchedKerberosSourcePropertyMappingRequest { + PatchedKerberosSourcePropertyMappingRequest { + managed: None, + name: None, + expression: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_kerberos_source_request.rs b/packages/client-rust/src/models/patched_kerberos_source_request.rs new file mode 100644 index 0000000000..c09fa1fed4 --- /dev/null +++ b/packages/client-rust/src/models/patched_kerberos_source_request.rs @@ -0,0 +1,158 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedKerberosSourceRequest : Kerberos Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedKerberosSourceRequest { + /// Source's display Name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Internal source name, used in URLs. + #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] + pub slug: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + /// How the source determines if an existing group should be used or a new group created. + #[serde( + rename = "group_matching_mode", + skip_serializing_if = "Option::is_none" + )] + pub group_matching_mode: Option, + /// Kerberos realm + #[serde(rename = "realm", skip_serializing_if = "Option::is_none")] + pub realm: Option, + /// Custom krb5.conf to use. Uses the system one by default + #[serde(rename = "krb5_conf", skip_serializing_if = "Option::is_none")] + pub krb5_conf: Option, + /// KAdmin server type + #[serde(rename = "kadmin_type", skip_serializing_if = "Option::is_none")] + pub kadmin_type: Option, + /// Sync users from Kerberos into authentik + #[serde(rename = "sync_users", skip_serializing_if = "Option::is_none")] + pub sync_users: Option, + /// When a user changes their password, sync it back to Kerberos + #[serde( + rename = "sync_users_password", + skip_serializing_if = "Option::is_none" + )] + pub sync_users_password: Option, + /// Principal to authenticate to kadmin for sync. + #[serde(rename = "sync_principal", skip_serializing_if = "Option::is_none")] + pub sync_principal: Option, + /// Password to authenticate to kadmin for sync + #[serde(rename = "sync_password", skip_serializing_if = "Option::is_none")] + pub sync_password: Option, + /// Keytab to authenticate to kadmin for sync. Must be base64-encoded or in the form + /// TYPE:residual + #[serde(rename = "sync_keytab", skip_serializing_if = "Option::is_none")] + pub sync_keytab: Option, + /// Credentials cache to authenticate to kadmin for sync. Must be in the form TYPE:residual + #[serde(rename = "sync_ccache", skip_serializing_if = "Option::is_none")] + pub sync_ccache: Option, + /// Force the use of a specific server name for SPNEGO. Must be in the form HTTP@hostname + #[serde(rename = "spnego_server_name", skip_serializing_if = "Option::is_none")] + pub spnego_server_name: Option, + /// SPNEGO keytab base64-encoded or path to keytab in the form FILE:path + #[serde(rename = "spnego_keytab", skip_serializing_if = "Option::is_none")] + pub spnego_keytab: Option, + /// Credential cache to use for SPNEGO in form type:residual + #[serde(rename = "spnego_ccache", skip_serializing_if = "Option::is_none")] + pub spnego_ccache: Option, + /// If enabled, the authentik-stored password will be updated upon login with the Kerberos + /// password backend + #[serde( + rename = "password_login_update_internal_password", + skip_serializing_if = "Option::is_none" + )] + pub password_login_update_internal_password: Option, + /// When to trigger sync for outgoing providers + #[serde( + rename = "sync_outgoing_trigger_mode", + skip_serializing_if = "Option::is_none" + )] + pub sync_outgoing_trigger_mode: Option, +} + +impl PatchedKerberosSourceRequest { + /// Kerberos Source Serializer + pub fn new() -> PatchedKerberosSourceRequest { + PatchedKerberosSourceRequest { + name: None, + slug: None, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + policy_engine_mode: None, + user_matching_mode: None, + user_path_template: None, + icon: None, + group_matching_mode: None, + realm: None, + krb5_conf: None, + kadmin_type: None, + sync_users: None, + sync_users_password: None, + sync_principal: None, + sync_password: None, + sync_keytab: None, + sync_ccache: None, + spnego_server_name: None, + spnego_keytab: None, + spnego_ccache: None, + password_login_update_internal_password: None, + sync_outgoing_trigger_mode: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_kubernetes_service_connection_request.rs b/packages/client-rust/src/models/patched_kubernetes_service_connection_request.rs new file mode 100644 index 0000000000..89af73c466 --- /dev/null +++ b/packages/client-rust/src/models/patched_kubernetes_service_connection_request.rs @@ -0,0 +1,40 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedKubernetesServiceConnectionRequest : KubernetesServiceConnection Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedKubernetesServiceConnectionRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// If enabled, use the local connection. Required Docker socket/Kubernetes Integration + #[serde(rename = "local", skip_serializing_if = "Option::is_none")] + pub local: Option, + /// Paste your kubeconfig here. authentik will automatically use the currently selected + /// context. + #[serde(rename = "kubeconfig", skip_serializing_if = "Option::is_none")] + pub kubeconfig: Option>, + /// Verify SSL Certificates of the Kubernetes API endpoint + #[serde(rename = "verify_ssl", skip_serializing_if = "Option::is_none")] + pub verify_ssl: Option, +} + +impl PatchedKubernetesServiceConnectionRequest { + /// KubernetesServiceConnection Serializer + pub fn new() -> PatchedKubernetesServiceConnectionRequest { + PatchedKubernetesServiceConnectionRequest { + name: None, + local: None, + kubeconfig: None, + verify_ssl: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_ldap_provider_request.rs b/packages/client-rust/src/models/patched_ldap_provider_request.rs new file mode 100644 index 0000000000..518db95410 --- /dev/null +++ b/packages/client-rust/src/models/patched_ldap_provider_request.rs @@ -0,0 +1,88 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedLdapProviderRequest : LDAPProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedLdapProviderRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow", skip_serializing_if = "Option::is_none")] + pub authorization_flow: Option, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow", skip_serializing_if = "Option::is_none")] + pub invalidation_flow: Option, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// DN under which objects are accessible. + #[serde(rename = "base_dn", skip_serializing_if = "Option::is_none")] + pub base_dn: Option, + #[serde( + rename = "certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub certificate: Option>, + #[serde(rename = "tls_server_name", skip_serializing_if = "Option::is_none")] + pub tls_server_name: Option, + /// The start for uidNumbers, this number is added to the user.pk to make sure that the numbers + /// aren't too low for POSIX users. Default is 2000 to ensure that we don't collide with local + /// users uidNumber + #[serde(rename = "uid_start_number", skip_serializing_if = "Option::is_none")] + pub uid_start_number: Option, + /// The start for gidNumbers, this number is added to a number generated from the group.pk to + /// make sure that the numbers aren't too low for POSIX groups. Default is 4000 to ensure that + /// we don't collide with local groups or users primary groups gidNumber + #[serde(rename = "gid_start_number", skip_serializing_if = "Option::is_none")] + pub gid_start_number: Option, + #[serde(rename = "search_mode", skip_serializing_if = "Option::is_none")] + pub search_mode: Option, + #[serde(rename = "bind_mode", skip_serializing_if = "Option::is_none")] + pub bind_mode: Option, + /// When enabled, code-based multi-factor authentication can be used by appending a semicolon + /// and the TOTP code to the password. This should only be enabled if all users that will bind + /// to this provider have a TOTP device configured, as otherwise a password may incorrectly be + /// rejected if it contains a semicolon. + #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")] + pub mfa_support: Option, +} + +impl PatchedLdapProviderRequest { + /// LDAPProvider Serializer + pub fn new() -> PatchedLdapProviderRequest { + PatchedLdapProviderRequest { + name: None, + authentication_flow: None, + authorization_flow: None, + invalidation_flow: None, + property_mappings: None, + base_dn: None, + certificate: None, + tls_server_name: None, + uid_start_number: None, + gid_start_number: None, + search_mode: None, + bind_mode: None, + mfa_support: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_ldap_source_property_mapping_request.rs b/packages/client-rust/src/models/patched_ldap_source_property_mapping_request.rs new file mode 100644 index 0000000000..b1a1f0dff4 --- /dev/null +++ b/packages/client-rust/src/models/patched_ldap_source_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedLdapSourcePropertyMappingRequest : LDAP PropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedLdapSourcePropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, +} + +impl PatchedLdapSourcePropertyMappingRequest { + /// LDAP PropertyMapping Serializer + pub fn new() -> PatchedLdapSourcePropertyMappingRequest { + PatchedLdapSourcePropertyMappingRequest { + managed: None, + name: None, + expression: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_ldap_source_request.rs b/packages/client-rust/src/models/patched_ldap_source_request.rs new file mode 100644 index 0000000000..64dd23a4d6 --- /dev/null +++ b/packages/client-rust/src/models/patched_ldap_source_request.rs @@ -0,0 +1,215 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedLdapSourceRequest : LDAP Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedLdapSourceRequest { + /// Source's display Name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Internal source name, used in URLs. + #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] + pub slug: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + #[serde(rename = "server_uri", skip_serializing_if = "Option::is_none")] + pub server_uri: Option, + /// Optionally verify the LDAP Server's Certificate against the CA Chain in this keypair. + #[serde( + rename = "peer_certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub peer_certificate: Option>, + /// Client certificate to authenticate against the LDAP Server's Certificate. + #[serde( + rename = "client_certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub client_certificate: Option>, + #[serde(rename = "bind_cn", skip_serializing_if = "Option::is_none")] + pub bind_cn: Option, + #[serde(rename = "bind_password", skip_serializing_if = "Option::is_none")] + pub bind_password: Option, + #[serde(rename = "start_tls", skip_serializing_if = "Option::is_none")] + pub start_tls: Option, + #[serde(rename = "sni", skip_serializing_if = "Option::is_none")] + pub sni: Option, + #[serde(rename = "base_dn", skip_serializing_if = "Option::is_none")] + pub base_dn: Option, + /// Prepended to Base DN for User-queries. + #[serde(rename = "additional_user_dn", skip_serializing_if = "Option::is_none")] + pub additional_user_dn: Option, + /// Prepended to Base DN for Group-queries. + #[serde( + rename = "additional_group_dn", + skip_serializing_if = "Option::is_none" + )] + pub additional_group_dn: Option, + /// Consider Objects matching this filter to be Users. + #[serde(rename = "user_object_filter", skip_serializing_if = "Option::is_none")] + pub user_object_filter: Option, + /// Consider Objects matching this filter to be Groups. + #[serde( + rename = "group_object_filter", + skip_serializing_if = "Option::is_none" + )] + pub group_object_filter: Option, + /// Field which contains members of a group. + #[serde( + rename = "group_membership_field", + skip_serializing_if = "Option::is_none" + )] + pub group_membership_field: Option, + /// Attribute which matches the value of `group_membership_field`. + #[serde( + rename = "user_membership_attribute", + skip_serializing_if = "Option::is_none" + )] + pub user_membership_attribute: Option, + /// Field which contains a unique Identifier. + #[serde( + rename = "object_uniqueness_field", + skip_serializing_if = "Option::is_none" + )] + pub object_uniqueness_field: Option, + /// Update internal authentik password when login succeeds with LDAP + #[serde( + rename = "password_login_update_internal_password", + skip_serializing_if = "Option::is_none" + )] + pub password_login_update_internal_password: Option, + #[serde(rename = "sync_users", skip_serializing_if = "Option::is_none")] + pub sync_users: Option, + /// When a user changes their password, sync it back to LDAP. This can only be enabled on a + /// single LDAP source. + #[serde( + rename = "sync_users_password", + skip_serializing_if = "Option::is_none" + )] + pub sync_users_password: Option, + #[serde(rename = "sync_groups", skip_serializing_if = "Option::is_none")] + pub sync_groups: Option, + #[serde( + rename = "sync_parent_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub sync_parent_group: Option>, + /// Lookup group membership based on a user attribute instead of a group attribute. This allows + /// nested group resolution on systems like FreeIPA and Active Directory + #[serde( + rename = "lookup_groups_from_user", + skip_serializing_if = "Option::is_none" + )] + pub lookup_groups_from_user: Option, + /// Delete authentik users and groups which were previously supplied by this source, but are + /// now missing from it. + #[serde( + rename = "delete_not_found_objects", + skip_serializing_if = "Option::is_none" + )] + pub delete_not_found_objects: Option, + /// When to trigger sync for outgoing providers + #[serde( + rename = "sync_outgoing_trigger_mode", + skip_serializing_if = "Option::is_none" + )] + pub sync_outgoing_trigger_mode: Option, +} + +impl PatchedLdapSourceRequest { + /// LDAP Source Serializer + pub fn new() -> PatchedLdapSourceRequest { + PatchedLdapSourceRequest { + name: None, + slug: None, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + policy_engine_mode: None, + user_matching_mode: None, + user_path_template: None, + icon: None, + server_uri: None, + peer_certificate: None, + client_certificate: None, + bind_cn: None, + bind_password: None, + start_tls: None, + sni: None, + base_dn: None, + additional_user_dn: None, + additional_group_dn: None, + user_object_filter: None, + group_object_filter: None, + group_membership_field: None, + user_membership_attribute: None, + object_uniqueness_field: None, + password_login_update_internal_password: None, + sync_users: None, + sync_users_password: None, + sync_groups: None, + sync_parent_group: None, + lookup_groups_from_user: None, + delete_not_found_objects: None, + sync_outgoing_trigger_mode: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_license_request.rs b/packages/client-rust/src/models/patched_license_request.rs new file mode 100644 index 0000000000..903443e6c8 --- /dev/null +++ b/packages/client-rust/src/models/patched_license_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedLicenseRequest : License Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedLicenseRequest { + #[serde(rename = "key", skip_serializing_if = "Option::is_none")] + pub key: Option, +} + +impl PatchedLicenseRequest { + /// License Serializer + pub fn new() -> PatchedLicenseRequest { + PatchedLicenseRequest { key: None } + } +} diff --git a/packages/client-rust/src/models/patched_lifecycle_rule_request.rs b/packages/client-rust/src/models/patched_lifecycle_rule_request.rs new file mode 100644 index 0000000000..68b6dd1cc7 --- /dev/null +++ b/packages/client-rust/src/models/patched_lifecycle_rule_request.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedLifecycleRuleRequest : Mixin to validate that a valid enterprise license exists before +/// allowing to save the object +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedLifecycleRuleRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "content_type", skip_serializing_if = "Option::is_none")] + pub content_type: Option, + #[serde( + rename = "object_id", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub object_id: Option>, + #[serde(rename = "interval", skip_serializing_if = "Option::is_none")] + pub interval: Option, + #[serde(rename = "grace_period", skip_serializing_if = "Option::is_none")] + pub grace_period: Option, + #[serde(rename = "reviewer_groups", skip_serializing_if = "Option::is_none")] + pub reviewer_groups: Option>, + #[serde(rename = "min_reviewers", skip_serializing_if = "Option::is_none")] + pub min_reviewers: Option, + #[serde( + rename = "min_reviewers_is_per_group", + skip_serializing_if = "Option::is_none" + )] + pub min_reviewers_is_per_group: Option, + #[serde(rename = "reviewers", skip_serializing_if = "Option::is_none")] + pub reviewers: Option>, + /// Select which transports should be used to notify the reviewers. If none are selected, the + /// notification will only be shown in the authentik UI. + #[serde( + rename = "notification_transports", + skip_serializing_if = "Option::is_none" + )] + pub notification_transports: Option>, +} + +impl PatchedLifecycleRuleRequest { + /// Mixin to validate that a valid enterprise license exists before allowing to save the object + pub fn new() -> PatchedLifecycleRuleRequest { + PatchedLifecycleRuleRequest { + name: None, + content_type: None, + object_id: None, + interval: None, + grace_period: None, + reviewer_groups: None, + min_reviewers: None, + min_reviewers_is_per_group: None, + reviewers: None, + notification_transports: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_microsoft_entra_provider_mapping_request.rs b/packages/client-rust/src/models/patched_microsoft_entra_provider_mapping_request.rs new file mode 100644 index 0000000000..40f895127b --- /dev/null +++ b/packages/client-rust/src/models/patched_microsoft_entra_provider_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedMicrosoftEntraProviderMappingRequest : MicrosoftEntraProviderMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedMicrosoftEntraProviderMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, +} + +impl PatchedMicrosoftEntraProviderMappingRequest { + /// MicrosoftEntraProviderMapping Serializer + pub fn new() -> PatchedMicrosoftEntraProviderMappingRequest { + PatchedMicrosoftEntraProviderMappingRequest { + managed: None, + name: None, + expression: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_microsoft_entra_provider_request.rs b/packages/client-rust/src/models/patched_microsoft_entra_provider_request.rs new file mode 100644 index 0000000000..1eefaa5014 --- /dev/null +++ b/packages/client-rust/src/models/patched_microsoft_entra_provider_request.rs @@ -0,0 +1,81 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedMicrosoftEntraProviderRequest : MicrosoftEntraProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedMicrosoftEntraProviderRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Property mappings used for group creation/updating. + #[serde( + rename = "property_mappings_group", + skip_serializing_if = "Option::is_none" + )] + pub property_mappings_group: Option>, + #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] + pub client_id: Option, + #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")] + pub client_secret: Option, + #[serde(rename = "tenant_id", skip_serializing_if = "Option::is_none")] + pub tenant_id: Option, + #[serde( + rename = "exclude_users_service_account", + skip_serializing_if = "Option::is_none" + )] + pub exclude_users_service_account: Option, + #[serde( + rename = "filter_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub filter_group: Option>, + #[serde(rename = "user_delete_action", skip_serializing_if = "Option::is_none")] + pub user_delete_action: Option, + #[serde( + rename = "group_delete_action", + skip_serializing_if = "Option::is_none" + )] + pub group_delete_action: Option, + /// Controls the number of objects synced in a single task + #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] + pub sync_page_size: Option, + /// Timeout for synchronization of a single page + #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] + pub sync_page_timeout: Option, + /// When enabled, provider will not modify or create objects in the remote system. + #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] + pub dry_run: Option, +} + +impl PatchedMicrosoftEntraProviderRequest { + /// MicrosoftEntraProvider Serializer + pub fn new() -> PatchedMicrosoftEntraProviderRequest { + PatchedMicrosoftEntraProviderRequest { + name: None, + property_mappings: None, + property_mappings_group: None, + client_id: None, + client_secret: None, + tenant_id: None, + exclude_users_service_account: None, + filter_group: None, + user_delete_action: None, + group_delete_action: None, + sync_page_size: None, + sync_page_timeout: None, + dry_run: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_mutual_tls_stage_request.rs b/packages/client-rust/src/models/patched_mutual_tls_stage_request.rs new file mode 100644 index 0000000000..b2bad7ff62 --- /dev/null +++ b/packages/client-rust/src/models/patched_mutual_tls_stage_request.rs @@ -0,0 +1,44 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedMutualTlsStageRequest : MutualTLSStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedMutualTlsStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// Configure certificate authorities to validate the certificate against. This option has a + /// higher priority than the `client_certificate` option on `Brand`. + #[serde( + rename = "certificate_authorities", + skip_serializing_if = "Option::is_none" + )] + pub certificate_authorities: Option>, + #[serde(rename = "cert_attribute", skip_serializing_if = "Option::is_none")] + pub cert_attribute: Option, + #[serde(rename = "user_attribute", skip_serializing_if = "Option::is_none")] + pub user_attribute: Option, +} + +impl PatchedMutualTlsStageRequest { + /// MutualTLSStage Serializer + pub fn new() -> PatchedMutualTlsStageRequest { + PatchedMutualTlsStageRequest { + name: None, + mode: None, + certificate_authorities: None, + cert_attribute: None, + user_attribute: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_notification_request.rs b/packages/client-rust/src/models/patched_notification_request.rs new file mode 100644 index 0000000000..f1703c0de3 --- /dev/null +++ b/packages/client-rust/src/models/patched_notification_request.rs @@ -0,0 +1,46 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedNotificationRequest : Notification Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedNotificationRequest { + #[serde( + rename = "hyperlink", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub hyperlink: Option>, + #[serde( + rename = "hyperlink_label", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub hyperlink_label: Option>, + #[serde(rename = "event", skip_serializing_if = "Option::is_none")] + pub event: Option, + #[serde(rename = "seen", skip_serializing_if = "Option::is_none")] + pub seen: Option, +} + +impl PatchedNotificationRequest { + /// Notification Serializer + pub fn new() -> PatchedNotificationRequest { + PatchedNotificationRequest { + hyperlink: None, + hyperlink_label: None, + event: None, + seen: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_notification_rule_request.rs b/packages/client-rust/src/models/patched_notification_rule_request.rs new file mode 100644 index 0000000000..351937d769 --- /dev/null +++ b/packages/client-rust/src/models/patched_notification_rule_request.rs @@ -0,0 +1,54 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedNotificationRuleRequest : NotificationRule Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedNotificationRuleRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Select which transports should be used to notify the user. If none are selected, the + /// notification will only be shown in the authentik UI. + #[serde(rename = "transports", skip_serializing_if = "Option::is_none")] + pub transports: Option>, + /// Controls which severity level the created notifications will have. + #[serde(rename = "severity", skip_serializing_if = "Option::is_none")] + pub severity: Option, + /// Define which group of users this notification should be sent and shown to. If left empty, + /// Notification won't ben sent. + #[serde( + rename = "destination_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub destination_group: Option>, + /// When enabled, notification will be sent to user the user that triggered the event.When + /// destination_group is configured, notification is sent to both. + #[serde( + rename = "destination_event_user", + skip_serializing_if = "Option::is_none" + )] + pub destination_event_user: Option, +} + +impl PatchedNotificationRuleRequest { + /// NotificationRule Serializer + pub fn new() -> PatchedNotificationRuleRequest { + PatchedNotificationRuleRequest { + name: None, + transports: None, + severity: None, + destination_group: None, + destination_event_user: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_notification_transport_request.rs b/packages/client-rust/src/models/patched_notification_transport_request.rs new file mode 100644 index 0000000000..969e7ebe82 --- /dev/null +++ b/packages/client-rust/src/models/patched_notification_transport_request.rs @@ -0,0 +1,75 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedNotificationTransportRequest : NotificationTransport Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedNotificationTransportRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, + #[serde(rename = "webhook_url", skip_serializing_if = "Option::is_none")] + pub webhook_url: Option, + /// When set, the selected ceritifcate is used to validate the certificate of the webhook + /// server. + #[serde( + rename = "webhook_ca", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub webhook_ca: Option>, + /// Customize the body of the request. Mapping should return data that is JSON-serializable. + #[serde( + rename = "webhook_mapping_body", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub webhook_mapping_body: Option>, + /// Configure additional headers to be sent. Mapping should return a dictionary of key-value + /// pairs + #[serde( + rename = "webhook_mapping_headers", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub webhook_mapping_headers: Option>, + #[serde( + rename = "email_subject_prefix", + skip_serializing_if = "Option::is_none" + )] + pub email_subject_prefix: Option, + #[serde(rename = "email_template", skip_serializing_if = "Option::is_none")] + pub email_template: Option, + /// Only send notification once, for example when sending a webhook into a chat channel. + #[serde(rename = "send_once", skip_serializing_if = "Option::is_none")] + pub send_once: Option, +} + +impl PatchedNotificationTransportRequest { + /// NotificationTransport Serializer + pub fn new() -> PatchedNotificationTransportRequest { + PatchedNotificationTransportRequest { + name: None, + mode: None, + webhook_url: None, + webhook_ca: None, + webhook_mapping_body: None, + webhook_mapping_headers: None, + email_subject_prefix: None, + email_template: None, + send_once: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_notification_webhook_mapping_request.rs b/packages/client-rust/src/models/patched_notification_webhook_mapping_request.rs new file mode 100644 index 0000000000..9cc6beacab --- /dev/null +++ b/packages/client-rust/src/models/patched_notification_webhook_mapping_request.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedNotificationWebhookMappingRequest : NotificationWebhookMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedNotificationWebhookMappingRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, +} + +impl PatchedNotificationWebhookMappingRequest { + /// NotificationWebhookMapping Serializer + pub fn new() -> PatchedNotificationWebhookMappingRequest { + PatchedNotificationWebhookMappingRequest { + name: None, + expression: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_o_auth2_provider_request.rs b/packages/client-rust/src/models/patched_o_auth2_provider_request.rs new file mode 100644 index 0000000000..a94dff1047 --- /dev/null +++ b/packages/client-rust/src/models/patched_o_auth2_provider_request.rs @@ -0,0 +1,149 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedOAuth2ProviderRequest : OAuth2Provider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedOAuth2ProviderRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow", skip_serializing_if = "Option::is_none")] + pub authorization_flow: Option, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow", skip_serializing_if = "Option::is_none")] + pub invalidation_flow: Option, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Confidential clients are capable of maintaining the confidentiality of their credentials. + /// Public clients are incapable + #[serde(rename = "client_type", skip_serializing_if = "Option::is_none")] + pub client_type: Option, + #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] + pub client_id: Option, + #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")] + pub client_secret: Option, + /// Access codes not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "access_code_validity", + skip_serializing_if = "Option::is_none" + )] + pub access_code_validity: Option, + /// Tokens not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "access_token_validity", + skip_serializing_if = "Option::is_none" + )] + pub access_token_validity: Option, + /// Tokens not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "refresh_token_validity", + skip_serializing_if = "Option::is_none" + )] + pub refresh_token_validity: Option, + /// When refreshing a token, if the refresh token is valid for less than this duration, it will + /// be renewed. When set to seconds=0, token will always be renewed. (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "refresh_token_threshold", + skip_serializing_if = "Option::is_none" + )] + pub refresh_token_threshold: Option, + /// Include User claims from scopes in the id_token, for applications that don't access the + /// userinfo endpoint. + #[serde( + rename = "include_claims_in_id_token", + skip_serializing_if = "Option::is_none" + )] + pub include_claims_in_id_token: Option, + /// Key used to sign the tokens. + #[serde( + rename = "signing_key", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub signing_key: Option>, + /// Key used to encrypt the tokens. When set, tokens will be encrypted and returned as JWEs. + #[serde( + rename = "encryption_key", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub encryption_key: Option>, + #[serde(rename = "redirect_uris", skip_serializing_if = "Option::is_none")] + pub redirect_uris: Option>, + #[serde(rename = "logout_uri", skip_serializing_if = "Option::is_none")] + pub logout_uri: Option, + /// Backchannel logs out with server to server calls. Frontchannel uses iframes in your browser + #[serde(rename = "logout_method", skip_serializing_if = "Option::is_none")] + pub logout_method: Option, + /// Configure what data should be used as unique User Identifier. For most cases, the default + /// should be fine. + #[serde(rename = "sub_mode", skip_serializing_if = "Option::is_none")] + pub sub_mode: Option, + /// Configure how the issuer field of the ID Token should be filled. + #[serde(rename = "issuer_mode", skip_serializing_if = "Option::is_none")] + pub issuer_mode: Option, + #[serde( + rename = "jwt_federation_sources", + skip_serializing_if = "Option::is_none" + )] + pub jwt_federation_sources: Option>, + #[serde( + rename = "jwt_federation_providers", + skip_serializing_if = "Option::is_none" + )] + pub jwt_federation_providers: Option>, +} + +impl PatchedOAuth2ProviderRequest { + /// OAuth2Provider Serializer + pub fn new() -> PatchedOAuth2ProviderRequest { + PatchedOAuth2ProviderRequest { + name: None, + authentication_flow: None, + authorization_flow: None, + invalidation_flow: None, + property_mappings: None, + client_type: None, + client_id: None, + client_secret: None, + access_code_validity: None, + access_token_validity: None, + refresh_token_validity: None, + refresh_token_threshold: None, + include_claims_in_id_token: None, + signing_key: None, + encryption_key: None, + redirect_uris: None, + logout_uri: None, + logout_method: None, + sub_mode: None, + issuer_mode: None, + jwt_federation_sources: None, + jwt_federation_providers: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_o_auth_source_property_mapping_request.rs b/packages/client-rust/src/models/patched_o_auth_source_property_mapping_request.rs new file mode 100644 index 0000000000..5a7eca3542 --- /dev/null +++ b/packages/client-rust/src/models/patched_o_auth_source_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedOAuthSourcePropertyMappingRequest : OAuthSourcePropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedOAuthSourcePropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, +} + +impl PatchedOAuthSourcePropertyMappingRequest { + /// OAuthSourcePropertyMapping Serializer + pub fn new() -> PatchedOAuthSourcePropertyMappingRequest { + PatchedOAuthSourcePropertyMappingRequest { + managed: None, + name: None, + expression: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_o_auth_source_request.rs b/packages/client-rust/src/models/patched_o_auth_source_request.rs new file mode 100644 index 0000000000..41f315b9fa --- /dev/null +++ b/packages/client-rust/src/models/patched_o_auth_source_request.rs @@ -0,0 +1,161 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedOAuthSourceRequest : OAuth Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedOAuthSourceRequest { + /// Source's display Name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Internal source name, used in URLs. + #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] + pub slug: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + /// How the source determines if an existing group should be used or a new group created. + #[serde( + rename = "group_matching_mode", + skip_serializing_if = "Option::is_none" + )] + pub group_matching_mode: Option, + #[serde(rename = "provider_type", skip_serializing_if = "Option::is_none")] + pub provider_type: Option, + /// URL used to request the initial token. This URL is only required for OAuth 1. + #[serde( + rename = "request_token_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub request_token_url: Option>, + /// URL the user is redirect to to conest the flow. + #[serde( + rename = "authorization_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authorization_url: Option>, + /// URL used by authentik to retrieve tokens. + #[serde( + rename = "access_token_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub access_token_url: Option>, + /// URL used by authentik to get user information. + #[serde( + rename = "profile_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub profile_url: Option>, + #[serde(rename = "pkce", skip_serializing_if = "Option::is_none")] + pub pkce: Option, + #[serde(rename = "consumer_key", skip_serializing_if = "Option::is_none")] + pub consumer_key: Option, + #[serde(rename = "consumer_secret", skip_serializing_if = "Option::is_none")] + pub consumer_secret: Option, + #[serde(rename = "additional_scopes", skip_serializing_if = "Option::is_none")] + pub additional_scopes: Option, + #[serde( + rename = "oidc_well_known_url", + skip_serializing_if = "Option::is_none" + )] + pub oidc_well_known_url: Option, + #[serde(rename = "oidc_jwks_url", skip_serializing_if = "Option::is_none")] + pub oidc_jwks_url: Option, + #[serde(rename = "oidc_jwks", skip_serializing_if = "Option::is_none")] + pub oidc_jwks: Option>, + /// How to perform authentication during an authorization_code token request flow + #[serde( + rename = "authorization_code_auth_method", + skip_serializing_if = "Option::is_none" + )] + pub authorization_code_auth_method: Option, +} + +impl PatchedOAuthSourceRequest { + /// OAuth Source Serializer + pub fn new() -> PatchedOAuthSourceRequest { + PatchedOAuthSourceRequest { + name: None, + slug: None, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + policy_engine_mode: None, + user_matching_mode: None, + user_path_template: None, + icon: None, + group_matching_mode: None, + provider_type: None, + request_token_url: None, + authorization_url: None, + access_token_url: None, + profile_url: None, + pkce: None, + consumer_key: None, + consumer_secret: None, + additional_scopes: None, + oidc_well_known_url: None, + oidc_jwks_url: None, + oidc_jwks: None, + authorization_code_auth_method: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_outpost_request.rs b/packages/client-rust/src/models/patched_outpost_request.rs new file mode 100644 index 0000000000..730e82699a --- /dev/null +++ b/packages/client-rust/src/models/patched_outpost_request.rs @@ -0,0 +1,57 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedOutpostRequest : Outpost Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedOutpostRequest { + #[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 = "providers", skip_serializing_if = "Option::is_none")] + pub providers: Option>, + /// Select Service-Connection authentik should use to manage this outpost. Leave empty if + /// authentik should not handle the deployment. + #[serde( + rename = "service_connection", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub service_connection: Option>, + #[serde(rename = "config", skip_serializing_if = "Option::is_none")] + pub config: Option>, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, +} + +impl PatchedOutpostRequest { + /// Outpost Serializer + pub fn new() -> PatchedOutpostRequest { + PatchedOutpostRequest { + name: None, + r#type: None, + providers: None, + service_connection: None, + config: None, + managed: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_password_expiry_policy_request.rs b/packages/client-rust/src/models/patched_password_expiry_policy_request.rs new file mode 100644 index 0000000000..3f44b5ebdd --- /dev/null +++ b/packages/client-rust/src/models/patched_password_expiry_policy_request.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedPasswordExpiryPolicyRequest : Password Expiry Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedPasswordExpiryPolicyRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + #[serde(rename = "days", skip_serializing_if = "Option::is_none")] + pub days: Option, + #[serde(rename = "deny_only", skip_serializing_if = "Option::is_none")] + pub deny_only: Option, +} + +impl PatchedPasswordExpiryPolicyRequest { + /// Password Expiry Policy Serializer + pub fn new() -> PatchedPasswordExpiryPolicyRequest { + PatchedPasswordExpiryPolicyRequest { + name: None, + execution_logging: None, + days: None, + deny_only: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_password_policy_request.rs b/packages/client-rust/src/models/patched_password_policy_request.rs new file mode 100644 index 0000000000..9f41bc03ef --- /dev/null +++ b/packages/client-rust/src/models/patched_password_policy_request.rs @@ -0,0 +1,80 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedPasswordPolicyRequest : Password Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedPasswordPolicyRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + /// Field key to check, field keys defined in Prompt stages are available. + #[serde(rename = "password_field", skip_serializing_if = "Option::is_none")] + pub password_field: Option, + #[serde(rename = "amount_digits", skip_serializing_if = "Option::is_none")] + pub amount_digits: Option, + #[serde(rename = "amount_uppercase", skip_serializing_if = "Option::is_none")] + pub amount_uppercase: Option, + #[serde(rename = "amount_lowercase", skip_serializing_if = "Option::is_none")] + pub amount_lowercase: Option, + #[serde(rename = "amount_symbols", skip_serializing_if = "Option::is_none")] + pub amount_symbols: Option, + #[serde(rename = "length_min", skip_serializing_if = "Option::is_none")] + pub length_min: Option, + #[serde(rename = "symbol_charset", skip_serializing_if = "Option::is_none")] + pub symbol_charset: Option, + #[serde(rename = "error_message", skip_serializing_if = "Option::is_none")] + pub error_message: Option, + #[serde(rename = "check_static_rules", skip_serializing_if = "Option::is_none")] + pub check_static_rules: Option, + #[serde( + rename = "check_have_i_been_pwned", + skip_serializing_if = "Option::is_none" + )] + pub check_have_i_been_pwned: Option, + #[serde(rename = "check_zxcvbn", skip_serializing_if = "Option::is_none")] + pub check_zxcvbn: Option, + /// How many times the password hash is allowed to be on haveibeenpwned + #[serde(rename = "hibp_allowed_count", skip_serializing_if = "Option::is_none")] + pub hibp_allowed_count: Option, + /// If the zxcvbn score is equal or less than this value, the policy will fail. + #[serde( + rename = "zxcvbn_score_threshold", + skip_serializing_if = "Option::is_none" + )] + pub zxcvbn_score_threshold: Option, +} + +impl PatchedPasswordPolicyRequest { + /// Password Policy Serializer + pub fn new() -> PatchedPasswordPolicyRequest { + PatchedPasswordPolicyRequest { + name: None, + execution_logging: None, + password_field: None, + amount_digits: None, + amount_uppercase: None, + amount_lowercase: None, + amount_symbols: None, + length_min: None, + symbol_charset: None, + error_message: None, + check_static_rules: None, + check_have_i_been_pwned: None, + check_zxcvbn: None, + hibp_allowed_count: None, + zxcvbn_score_threshold: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_password_stage_request.rs b/packages/client-rust/src/models/patched_password_stage_request.rs new file mode 100644 index 0000000000..eaf43c8f09 --- /dev/null +++ b/packages/client-rust/src/models/patched_password_stage_request.rs @@ -0,0 +1,56 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedPasswordStageRequest : PasswordStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedPasswordStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Selection of backends to test the password against. + #[serde(rename = "backends", skip_serializing_if = "Option::is_none")] + pub backends: Option>, + /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able + /// to configure this stage. + #[serde( + rename = "configure_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub configure_flow: Option>, + /// How many attempts a user has before the flow is canceled. To lock the user out, use a + /// reputation policy and a user_write stage. + #[serde( + rename = "failed_attempts_before_cancel", + skip_serializing_if = "Option::is_none" + )] + pub failed_attempts_before_cancel: Option, + /// When enabled, provides a 'show password' button with the password input field. + #[serde( + rename = "allow_show_password", + skip_serializing_if = "Option::is_none" + )] + pub allow_show_password: Option, +} + +impl PatchedPasswordStageRequest { + /// PasswordStage Serializer + pub fn new() -> PatchedPasswordStageRequest { + PatchedPasswordStageRequest { + name: None, + backends: None, + configure_flow: None, + failed_attempts_before_cancel: None, + allow_show_password: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_permission_assign_request.rs b/packages/client-rust/src/models/patched_permission_assign_request.rs new file mode 100644 index 0000000000..35b36b9236 --- /dev/null +++ b/packages/client-rust/src/models/patched_permission_assign_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedPermissionAssignRequest : Request to assign a new permission +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedPermissionAssignRequest { + #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] + pub permissions: Option>, + #[serde(rename = "model", skip_serializing_if = "Option::is_none")] + pub model: Option, + #[serde(rename = "object_pk", skip_serializing_if = "Option::is_none")] + pub object_pk: Option, +} + +impl PatchedPermissionAssignRequest { + /// Request to assign a new permission + pub fn new() -> PatchedPermissionAssignRequest { + PatchedPermissionAssignRequest { + permissions: None, + model: None, + object_pk: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_plex_source_property_mapping_request.rs b/packages/client-rust/src/models/patched_plex_source_property_mapping_request.rs new file mode 100644 index 0000000000..b92847c5b9 --- /dev/null +++ b/packages/client-rust/src/models/patched_plex_source_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedPlexSourcePropertyMappingRequest : PlexSourcePropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedPlexSourcePropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, +} + +impl PatchedPlexSourcePropertyMappingRequest { + /// PlexSourcePropertyMapping Serializer + pub fn new() -> PatchedPlexSourcePropertyMappingRequest { + PatchedPlexSourcePropertyMappingRequest { + managed: None, + name: None, + expression: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_plex_source_request.rs b/packages/client-rust/src/models/patched_plex_source_request.rs new file mode 100644 index 0000000000..4cbb102c92 --- /dev/null +++ b/packages/client-rust/src/models/patched_plex_source_request.rs @@ -0,0 +1,108 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedPlexSourceRequest : Plex Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedPlexSourceRequest { + /// Source's display Name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Internal source name, used in URLs. + #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] + pub slug: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + /// How the source determines if an existing group should be used or a new group created. + #[serde( + rename = "group_matching_mode", + skip_serializing_if = "Option::is_none" + )] + pub group_matching_mode: Option, + /// Client identifier used to talk to Plex. + #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] + pub client_id: Option, + /// Which servers a user has to be a member of to be granted access. Empty list allows every + /// server. + #[serde(rename = "allowed_servers", skip_serializing_if = "Option::is_none")] + pub allowed_servers: Option>, + /// Allow friends to authenticate, even if you don't share a server. + #[serde(rename = "allow_friends", skip_serializing_if = "Option::is_none")] + pub allow_friends: Option, + /// Plex token used to check friends + #[serde(rename = "plex_token", skip_serializing_if = "Option::is_none")] + pub plex_token: Option, +} + +impl PatchedPlexSourceRequest { + /// Plex Source Serializer + pub fn new() -> PatchedPlexSourceRequest { + PatchedPlexSourceRequest { + name: None, + slug: None, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + policy_engine_mode: None, + user_matching_mode: None, + user_path_template: None, + icon: None, + group_matching_mode: None, + client_id: None, + allowed_servers: None, + allow_friends: None, + plex_token: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_policy_binding_request.rs b/packages/client-rust/src/models/patched_policy_binding_request.rs new file mode 100644 index 0000000000..810ec50e66 --- /dev/null +++ b/packages/client-rust/src/models/patched_policy_binding_request.rs @@ -0,0 +1,69 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedPolicyBindingRequest : PolicyBinding Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedPolicyBindingRequest { + #[serde( + rename = "policy", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub policy: Option>, + #[serde( + rename = "group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub group: Option>, + #[serde( + rename = "user", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub user: Option>, + #[serde(rename = "target", skip_serializing_if = "Option::is_none")] + pub target: Option, + /// Negates the outcome of the policy. Messages are unaffected. + #[serde(rename = "negate", skip_serializing_if = "Option::is_none")] + pub negate: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + /// Timeout after which Policy execution is terminated. + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + /// Result if the Policy execution fails. + #[serde(rename = "failure_result", skip_serializing_if = "Option::is_none")] + pub failure_result: Option, +} + +impl PatchedPolicyBindingRequest { + /// PolicyBinding Serializer + pub fn new() -> PatchedPolicyBindingRequest { + PatchedPolicyBindingRequest { + policy: None, + group: None, + user: None, + target: None, + negate: None, + enabled: None, + order: None, + timeout: None, + failure_result: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_prompt_request.rs b/packages/client-rust/src/models/patched_prompt_request.rs new file mode 100644 index 0000000000..cb9a61a8fb --- /dev/null +++ b/packages/client-rust/src/models/patched_prompt_request.rs @@ -0,0 +1,69 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedPromptRequest : Prompt Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedPromptRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Name of the form field, also used to store the value + #[serde(rename = "field_key", skip_serializing_if = "Option::is_none")] + pub field_key: Option, + #[serde(rename = "label", skip_serializing_if = "Option::is_none")] + pub label: Option, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "required", skip_serializing_if = "Option::is_none")] + pub required: Option, + /// Optionally provide a short hint that describes the expected input value. When creating a + /// fixed choice field, enable interpreting as expression and return a list to return multiple + /// choices. + #[serde(rename = "placeholder", skip_serializing_if = "Option::is_none")] + pub placeholder: Option, + /// Optionally pre-fill the input with an initial value. When creating a fixed choice field, + /// enable interpreting as expression and return a list to return multiple default choices. + #[serde(rename = "initial_value", skip_serializing_if = "Option::is_none")] + pub initial_value: Option, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "sub_text", skip_serializing_if = "Option::is_none")] + pub sub_text: Option, + #[serde( + rename = "placeholder_expression", + skip_serializing_if = "Option::is_none" + )] + pub placeholder_expression: Option, + #[serde( + rename = "initial_value_expression", + skip_serializing_if = "Option::is_none" + )] + pub initial_value_expression: Option, +} + +impl PatchedPromptRequest { + /// Prompt Serializer + pub fn new() -> PatchedPromptRequest { + PatchedPromptRequest { + name: None, + field_key: None, + label: None, + r#type: None, + required: None, + placeholder: None, + initial_value: None, + order: None, + sub_text: None, + placeholder_expression: None, + initial_value_expression: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_prompt_stage_request.rs b/packages/client-rust/src/models/patched_prompt_stage_request.rs new file mode 100644 index 0000000000..8a3049af1e --- /dev/null +++ b/packages/client-rust/src/models/patched_prompt_stage_request.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedPromptStageRequest : PromptStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedPromptStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "fields", skip_serializing_if = "Option::is_none")] + pub fields: Option>, + #[serde( + rename = "validation_policies", + skip_serializing_if = "Option::is_none" + )] + pub validation_policies: Option>, +} + +impl PatchedPromptStageRequest { + /// PromptStage Serializer + pub fn new() -> PatchedPromptStageRequest { + PatchedPromptStageRequest { + name: None, + fields: None, + validation_policies: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_proxy_provider_request.rs b/packages/client-rust/src/models/patched_proxy_provider_request.rs new file mode 100644 index 0000000000..43b0aefe67 --- /dev/null +++ b/packages/client-rust/src/models/patched_proxy_provider_request.rs @@ -0,0 +1,137 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedProxyProviderRequest : ProxyProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedProxyProviderRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow", skip_serializing_if = "Option::is_none")] + pub authorization_flow: Option, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow", skip_serializing_if = "Option::is_none")] + pub invalidation_flow: Option, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + #[serde(rename = "internal_host", skip_serializing_if = "Option::is_none")] + pub internal_host: Option, + #[serde(rename = "external_host", skip_serializing_if = "Option::is_none")] + pub external_host: Option, + /// Validate SSL Certificates of upstream servers + #[serde( + rename = "internal_host_ssl_validation", + skip_serializing_if = "Option::is_none" + )] + pub internal_host_ssl_validation: Option, + #[serde( + rename = "certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub certificate: Option>, + /// Regular expressions for which authentication is not required. Each new line is interpreted + /// as a new Regular Expression. + #[serde(rename = "skip_path_regex", skip_serializing_if = "Option::is_none")] + pub skip_path_regex: Option, + /// Set a custom HTTP-Basic Authentication header based on values from authentik. + #[serde(rename = "basic_auth_enabled", skip_serializing_if = "Option::is_none")] + pub basic_auth_enabled: Option, + /// User/Group Attribute used for the password part of the HTTP-Basic Header. + #[serde( + rename = "basic_auth_password_attribute", + skip_serializing_if = "Option::is_none" + )] + pub basic_auth_password_attribute: Option, + /// User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the + /// user's Email address is used. + #[serde( + rename = "basic_auth_user_attribute", + skip_serializing_if = "Option::is_none" + )] + pub basic_auth_user_attribute: Option, + /// Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with + /// internal_host. + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// When enabled, this provider will intercept the authorization header and authenticate + /// requests based on its value. + #[serde( + rename = "intercept_header_auth", + skip_serializing_if = "Option::is_none" + )] + pub intercept_header_auth: Option, + #[serde(rename = "cookie_domain", skip_serializing_if = "Option::is_none")] + pub cookie_domain: Option, + #[serde( + rename = "jwt_federation_sources", + skip_serializing_if = "Option::is_none" + )] + pub jwt_federation_sources: Option>, + #[serde( + rename = "jwt_federation_providers", + skip_serializing_if = "Option::is_none" + )] + pub jwt_federation_providers: Option>, + /// Tokens not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "access_token_validity", + skip_serializing_if = "Option::is_none" + )] + pub access_token_validity: Option, + /// Tokens not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "refresh_token_validity", + skip_serializing_if = "Option::is_none" + )] + pub refresh_token_validity: Option, +} + +impl PatchedProxyProviderRequest { + /// ProxyProvider Serializer + pub fn new() -> PatchedProxyProviderRequest { + PatchedProxyProviderRequest { + name: None, + authentication_flow: None, + authorization_flow: None, + invalidation_flow: None, + property_mappings: None, + internal_host: None, + external_host: None, + internal_host_ssl_validation: None, + certificate: None, + skip_path_regex: None, + basic_auth_enabled: None, + basic_auth_password_attribute: None, + basic_auth_user_attribute: None, + mode: None, + intercept_header_auth: None, + cookie_domain: None, + jwt_federation_sources: None, + jwt_federation_providers: None, + access_token_validity: None, + refresh_token_validity: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_rac_property_mapping_request.rs b/packages/client-rust/src/models/patched_rac_property_mapping_request.rs new file mode 100644 index 0000000000..312ad51978 --- /dev/null +++ b/packages/client-rust/src/models/patched_rac_property_mapping_request.rs @@ -0,0 +1,44 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedRacPropertyMappingRequest : RACPropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedRacPropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, + #[serde(rename = "static_settings", skip_serializing_if = "Option::is_none")] + pub static_settings: Option>, +} + +impl PatchedRacPropertyMappingRequest { + /// RACPropertyMapping Serializer + pub fn new() -> PatchedRacPropertyMappingRequest { + PatchedRacPropertyMappingRequest { + managed: None, + name: None, + expression: None, + static_settings: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_rac_provider_request.rs b/packages/client-rust/src/models/patched_rac_provider_request.rs new file mode 100644 index 0000000000..15e71e79af --- /dev/null +++ b/packages/client-rust/src/models/patched_rac_provider_request.rs @@ -0,0 +1,59 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedRacProviderRequest : RACProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedRacProviderRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow", skip_serializing_if = "Option::is_none")] + pub authorization_flow: Option, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + #[serde(rename = "settings", skip_serializing_if = "Option::is_none")] + pub settings: Option>, + /// Determines how long a session lasts. Default of 0 means that the sessions lasts until the + /// browser is closed. (Format: hours=-1;minutes=-2;seconds=-3) + #[serde(rename = "connection_expiry", skip_serializing_if = "Option::is_none")] + pub connection_expiry: Option, + /// When set to true, connection tokens will be deleted upon disconnect. + #[serde( + rename = "delete_token_on_disconnect", + skip_serializing_if = "Option::is_none" + )] + pub delete_token_on_disconnect: Option, +} + +impl PatchedRacProviderRequest { + /// RACProvider Serializer + pub fn new() -> PatchedRacProviderRequest { + PatchedRacProviderRequest { + name: None, + authentication_flow: None, + authorization_flow: None, + property_mappings: None, + settings: None, + connection_expiry: None, + delete_token_on_disconnect: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_radius_provider_property_mapping_request.rs b/packages/client-rust/src/models/patched_radius_provider_property_mapping_request.rs new file mode 100644 index 0000000000..a424d67cd9 --- /dev/null +++ b/packages/client-rust/src/models/patched_radius_provider_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedRadiusProviderPropertyMappingRequest : RadiusProviderPropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedRadiusProviderPropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, +} + +impl PatchedRadiusProviderPropertyMappingRequest { + /// RadiusProviderPropertyMapping Serializer + pub fn new() -> PatchedRadiusProviderPropertyMappingRequest { + PatchedRadiusProviderPropertyMappingRequest { + managed: None, + name: None, + expression: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_radius_provider_request.rs b/packages/client-rust/src/models/patched_radius_provider_request.rs new file mode 100644 index 0000000000..9792d208d7 --- /dev/null +++ b/packages/client-rust/src/models/patched_radius_provider_request.rs @@ -0,0 +1,72 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedRadiusProviderRequest : RadiusProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedRadiusProviderRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow", skip_serializing_if = "Option::is_none")] + pub authorization_flow: Option, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow", skip_serializing_if = "Option::is_none")] + pub invalidation_flow: Option, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// List of CIDRs (comma-separated) that clients can connect from. A more specific CIDR will + /// match before a looser one. Clients connecting from a non-specified CIDR will be dropped. + #[serde(rename = "client_networks", skip_serializing_if = "Option::is_none")] + pub client_networks: Option, + /// Shared secret between clients and server to hash packets. + #[serde(rename = "shared_secret", skip_serializing_if = "Option::is_none")] + pub shared_secret: Option, + /// When enabled, code-based multi-factor authentication can be used by appending a semicolon + /// and the TOTP code to the password. This should only be enabled if all users that will bind + /// to this provider have a TOTP device configured, as otherwise a password may incorrectly be + /// rejected if it contains a semicolon. + #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")] + pub mfa_support: Option, + #[serde( + rename = "certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub certificate: Option>, +} + +impl PatchedRadiusProviderRequest { + /// RadiusProvider Serializer + pub fn new() -> PatchedRadiusProviderRequest { + PatchedRadiusProviderRequest { + name: None, + authentication_flow: None, + authorization_flow: None, + invalidation_flow: None, + property_mappings: None, + client_networks: None, + shared_secret: None, + mfa_support: None, + certificate: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_redirect_stage_request.rs b/packages/client-rust/src/models/patched_redirect_stage_request.rs new file mode 100644 index 0000000000..5970afc85b --- /dev/null +++ b/packages/client-rust/src/models/patched_redirect_stage_request.rs @@ -0,0 +1,44 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedRedirectStageRequest : RedirectStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedRedirectStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "keep_context", skip_serializing_if = "Option::is_none")] + pub keep_context: Option, + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, + #[serde(rename = "target_static", skip_serializing_if = "Option::is_none")] + pub target_static: Option, + #[serde( + rename = "target_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub target_flow: Option>, +} + +impl PatchedRedirectStageRequest { + /// RedirectStage Serializer + pub fn new() -> PatchedRedirectStageRequest { + PatchedRedirectStageRequest { + name: None, + keep_context: None, + mode: None, + target_static: None, + target_flow: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_reputation_policy_request.rs b/packages/client-rust/src/models/patched_reputation_policy_request.rs new file mode 100644 index 0000000000..050859e7a5 --- /dev/null +++ b/packages/client-rust/src/models/patched_reputation_policy_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedReputationPolicyRequest : Reputation Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedReputationPolicyRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + #[serde(rename = "check_ip", skip_serializing_if = "Option::is_none")] + pub check_ip: Option, + #[serde(rename = "check_username", skip_serializing_if = "Option::is_none")] + pub check_username: Option, + #[serde(rename = "threshold", skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +impl PatchedReputationPolicyRequest { + /// Reputation Policy Serializer + pub fn new() -> PatchedReputationPolicyRequest { + PatchedReputationPolicyRequest { + name: None, + execution_logging: None, + check_ip: None, + check_username: None, + threshold: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_role_request.rs b/packages/client-rust/src/models/patched_role_request.rs new file mode 100644 index 0000000000..c09c97ae75 --- /dev/null +++ b/packages/client-rust/src/models/patched_role_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedRoleRequest : Role serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedRoleRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl PatchedRoleRequest { + /// Role serializer + pub fn new() -> PatchedRoleRequest { + PatchedRoleRequest { name: None } + } +} diff --git a/packages/client-rust/src/models/patched_saml_property_mapping_request.rs b/packages/client-rust/src/models/patched_saml_property_mapping_request.rs new file mode 100644 index 0000000000..8480ba87f8 --- /dev/null +++ b/packages/client-rust/src/models/patched_saml_property_mapping_request.rs @@ -0,0 +1,52 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedSamlPropertyMappingRequest : SAMLPropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedSamlPropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, + #[serde(rename = "saml_name", skip_serializing_if = "Option::is_none")] + pub saml_name: Option, + #[serde( + rename = "friendly_name", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option>, +} + +impl PatchedSamlPropertyMappingRequest { + /// SAMLPropertyMapping Serializer + pub fn new() -> PatchedSamlPropertyMappingRequest { + PatchedSamlPropertyMappingRequest { + managed: None, + name: None, + expression: None, + saml_name: None, + friendly_name: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_saml_provider_request.rs b/packages/client-rust/src/models/patched_saml_provider_request.rs new file mode 100644 index 0000000000..80cacea2e7 --- /dev/null +++ b/packages/client-rust/src/models/patched_saml_provider_request.rs @@ -0,0 +1,193 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedSamlProviderRequest : SAMLProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedSamlProviderRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow", skip_serializing_if = "Option::is_none")] + pub authorization_flow: Option, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow", skip_serializing_if = "Option::is_none")] + pub invalidation_flow: Option, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + #[serde(rename = "acs_url", skip_serializing_if = "Option::is_none")] + pub acs_url: Option, + /// Single Logout Service URL where the logout response should be sent. + #[serde(rename = "sls_url", skip_serializing_if = "Option::is_none")] + pub sls_url: Option, + /// Value of the audience restriction field of the assertion. When left empty, no audience + /// restriction will be added. + #[serde(rename = "audience", skip_serializing_if = "Option::is_none")] + pub audience: Option, + /// Also known as EntityID + #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// Assertion valid not before current time + this value (Format: + /// hours=-1;minutes=-2;seconds=-3). + #[serde( + rename = "assertion_valid_not_before", + skip_serializing_if = "Option::is_none" + )] + pub assertion_valid_not_before: Option, + /// Assertion not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "assertion_valid_not_on_or_after", + skip_serializing_if = "Option::is_none" + )] + pub assertion_valid_not_on_or_after: Option, + /// Session not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "session_valid_not_on_or_after", + skip_serializing_if = "Option::is_none" + )] + pub session_valid_not_on_or_after: Option, + /// Configure how the NameID value will be created. When left empty, the NameIDPolicy of the + /// incoming request will be considered + #[serde( + rename = "name_id_mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub name_id_mapping: Option>, + /// Configure how the AuthnContextClassRef value will be created. When left empty, the + /// AuthnContextClassRef will be set based on which authentication methods the user used to + /// authenticate. + #[serde( + rename = "authn_context_class_ref_mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authn_context_class_ref_mapping: Option>, + #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] + pub digest_algorithm: Option, + #[serde( + rename = "signature_algorithm", + skip_serializing_if = "Option::is_none" + )] + pub signature_algorithm: Option, + /// Keypair used to sign outgoing Responses going to the Service Provider. + #[serde( + rename = "signing_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub signing_kp: Option>, + /// When selected, incoming assertion's Signatures will be validated against this certificate. + /// To allow unsigned Requests, leave on default. + #[serde( + rename = "verification_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub verification_kp: Option>, + /// When selected, incoming assertions are encrypted by the IdP using the public key of the + /// encryption keypair. The assertion is decrypted by the SP using the the private key. + #[serde( + rename = "encryption_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub encryption_kp: Option>, + #[serde(rename = "sign_assertion", skip_serializing_if = "Option::is_none")] + pub sign_assertion: Option, + #[serde(rename = "sign_response", skip_serializing_if = "Option::is_none")] + pub sign_response: Option, + #[serde( + rename = "sign_logout_request", + skip_serializing_if = "Option::is_none" + )] + pub sign_logout_request: Option, + #[serde( + rename = "sign_logout_response", + skip_serializing_if = "Option::is_none" + )] + pub sign_logout_response: Option, + /// This determines how authentik sends the response back to the Service Provider. + #[serde(rename = "sp_binding", skip_serializing_if = "Option::is_none")] + pub sp_binding: Option, + /// This determines how authentik sends the logout response back to the Service Provider. + #[serde(rename = "sls_binding", skip_serializing_if = "Option::is_none")] + pub sls_binding: Option, + /// Method to use for logout. Front-channel iframe loads all logout URLs simultaneously in + /// hidden iframes. Front-channel native uses your active browser tab to send post requests and + /// redirect to providers. Back-channel sends logout requests directly from the server without + /// user interaction (requires POST SLS binding). + #[serde(rename = "logout_method", skip_serializing_if = "Option::is_none")] + pub logout_method: Option, + /// Default relay_state value for IDP-initiated logins + #[serde( + rename = "default_relay_state", + skip_serializing_if = "Option::is_none" + )] + pub default_relay_state: Option, + #[serde( + rename = "default_name_id_policy", + skip_serializing_if = "Option::is_none" + )] + pub default_name_id_policy: Option, +} + +impl PatchedSamlProviderRequest { + /// SAMLProvider Serializer + pub fn new() -> PatchedSamlProviderRequest { + PatchedSamlProviderRequest { + name: None, + authentication_flow: None, + authorization_flow: None, + invalidation_flow: None, + property_mappings: None, + acs_url: None, + sls_url: None, + audience: None, + issuer: None, + assertion_valid_not_before: None, + assertion_valid_not_on_or_after: None, + session_valid_not_on_or_after: None, + name_id_mapping: None, + authn_context_class_ref_mapping: None, + digest_algorithm: None, + signature_algorithm: None, + signing_kp: None, + verification_kp: None, + encryption_kp: None, + sign_assertion: None, + sign_response: None, + sign_logout_request: None, + sign_logout_response: None, + sp_binding: None, + sls_binding: None, + logout_method: None, + default_relay_state: None, + default_name_id_policy: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_saml_source_property_mapping_request.rs b/packages/client-rust/src/models/patched_saml_source_property_mapping_request.rs new file mode 100644 index 0000000000..95d330929c --- /dev/null +++ b/packages/client-rust/src/models/patched_saml_source_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedSamlSourcePropertyMappingRequest : SAMLSourcePropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedSamlSourcePropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, +} + +impl PatchedSamlSourcePropertyMappingRequest { + /// SAMLSourcePropertyMapping Serializer + pub fn new() -> PatchedSamlSourcePropertyMappingRequest { + PatchedSamlSourcePropertyMappingRequest { + managed: None, + name: None, + expression: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_saml_source_request.rs b/packages/client-rust/src/models/patched_saml_source_request.rs new file mode 100644 index 0000000000..e79fd56f86 --- /dev/null +++ b/packages/client-rust/src/models/patched_saml_source_request.rs @@ -0,0 +1,183 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedSamlSourceRequest : SAMLSource Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedSamlSourceRequest { + /// Source's display Name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Internal source name, used in URLs. + #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] + pub slug: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + /// How the source determines if an existing group should be used or a new group created. + #[serde( + rename = "group_matching_mode", + skip_serializing_if = "Option::is_none" + )] + pub group_matching_mode: Option, + /// Flow used before authentication. + #[serde( + rename = "pre_authentication_flow", + skip_serializing_if = "Option::is_none" + )] + pub pre_authentication_flow: Option, + /// Also known as Entity ID. Defaults the Metadata URL. + #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// URL that the initial Login request is sent to. + #[serde(rename = "sso_url", skip_serializing_if = "Option::is_none")] + pub sso_url: Option, + /// Optional URL if your IDP supports Single-Logout. + #[serde( + rename = "slo_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub slo_url: Option>, + /// Allows authentication flows initiated by the IdP. This can be a security risk, as no + /// validation of the request ID is done. + #[serde( + rename = "allow_idp_initiated", + skip_serializing_if = "Option::is_none" + )] + pub allow_idp_initiated: Option, + /// NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent. + #[serde(rename = "name_id_policy", skip_serializing_if = "Option::is_none")] + pub name_id_policy: Option, + #[serde(rename = "binding_type", skip_serializing_if = "Option::is_none")] + pub binding_type: Option, + /// When selected, incoming assertion's Signatures will be validated against this certificate. + /// To allow unsigned Requests, leave on default. + #[serde( + rename = "verification_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub verification_kp: Option>, + /// Keypair used to sign outgoing Responses going to the Identity Provider. + #[serde( + rename = "signing_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub signing_kp: Option>, + #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] + pub digest_algorithm: Option, + #[serde( + rename = "signature_algorithm", + skip_serializing_if = "Option::is_none" + )] + pub signature_algorithm: Option, + /// Time offset when temporary users should be deleted. This only applies if your IDP uses the + /// NameID Format 'transient', and the user doesn't log out manually. (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "temporary_user_delete_after", + skip_serializing_if = "Option::is_none" + )] + pub temporary_user_delete_after: Option, + /// When selected, incoming assertions are encrypted by the IdP using the public key of the + /// encryption keypair. The assertion is decrypted by the SP using the the private key. + #[serde( + rename = "encryption_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub encryption_kp: Option>, + #[serde(rename = "signed_assertion", skip_serializing_if = "Option::is_none")] + pub signed_assertion: Option, + #[serde(rename = "signed_response", skip_serializing_if = "Option::is_none")] + pub signed_response: Option, +} + +impl PatchedSamlSourceRequest { + /// SAMLSource Serializer + pub fn new() -> PatchedSamlSourceRequest { + PatchedSamlSourceRequest { + name: None, + slug: None, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + policy_engine_mode: None, + user_matching_mode: None, + user_path_template: None, + icon: None, + group_matching_mode: None, + pre_authentication_flow: None, + issuer: None, + sso_url: None, + slo_url: None, + allow_idp_initiated: None, + name_id_policy: None, + binding_type: None, + verification_kp: None, + signing_kp: None, + digest_algorithm: None, + signature_algorithm: None, + temporary_user_delete_after: None, + encryption_kp: None, + signed_assertion: None, + signed_response: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_schedule_request.rs b/packages/client-rust/src/models/patched_schedule_request.rs new file mode 100644 index 0000000000..0ef3646b3d --- /dev/null +++ b/packages/client-rust/src/models/patched_schedule_request.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedScheduleRequest { + #[serde( + rename = "rel_obj_id", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub rel_obj_id: Option>, + /// When to schedule tasks + #[serde(rename = "crontab", skip_serializing_if = "Option::is_none")] + pub crontab: Option, + /// Pause this schedule + #[serde(rename = "paused", skip_serializing_if = "Option::is_none")] + pub paused: Option, +} + +impl PatchedScheduleRequest { + pub fn new() -> PatchedScheduleRequest { + PatchedScheduleRequest { + rel_obj_id: None, + crontab: None, + paused: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_scim_mapping_request.rs b/packages/client-rust/src/models/patched_scim_mapping_request.rs new file mode 100644 index 0000000000..43b9219fc2 --- /dev/null +++ b/packages/client-rust/src/models/patched_scim_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedScimMappingRequest : SCIMMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedScimMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, +} + +impl PatchedScimMappingRequest { + /// SCIMMapping Serializer + pub fn new() -> PatchedScimMappingRequest { + PatchedScimMappingRequest { + managed: None, + name: None, + expression: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_scim_provider_request.rs b/packages/client-rust/src/models/patched_scim_provider_request.rs new file mode 100644 index 0000000000..7ff56c219d --- /dev/null +++ b/packages/client-rust/src/models/patched_scim_provider_request.rs @@ -0,0 +1,100 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedScimProviderRequest : SCIMProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedScimProviderRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Property mappings used for group creation/updating. + #[serde( + rename = "property_mappings_group", + skip_serializing_if = "Option::is_none" + )] + pub property_mappings_group: Option>, + /// Base URL to SCIM requests, usually ends in /v2 + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, + #[serde( + rename = "verify_certificates", + skip_serializing_if = "Option::is_none" + )] + pub verify_certificates: Option, + /// Authentication token + #[serde(rename = "token", skip_serializing_if = "Option::is_none")] + pub token: Option, + #[serde(rename = "auth_mode", skip_serializing_if = "Option::is_none")] + pub auth_mode: Option, + /// OAuth Source used for authentication + #[serde( + rename = "auth_oauth", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub auth_oauth: Option>, + /// Additional OAuth parameters, such as grant_type + #[serde(rename = "auth_oauth_params", skip_serializing_if = "Option::is_none")] + pub auth_oauth_params: Option>, + /// Alter authentik behavior for vendor-specific SCIM implementations. + #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")] + pub compatibility_mode: Option, + /// Cache duration for ServiceProviderConfig responses. Set minutes=0 to disable. + #[serde( + rename = "service_provider_config_cache_timeout", + skip_serializing_if = "Option::is_none" + )] + pub service_provider_config_cache_timeout: Option, + #[serde( + rename = "exclude_users_service_account", + skip_serializing_if = "Option::is_none" + )] + pub exclude_users_service_account: Option, + /// Controls the number of objects synced in a single task + #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] + pub sync_page_size: Option, + /// Timeout for synchronization of a single page + #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] + pub sync_page_timeout: Option, + /// Group filters used to define sync-scope for groups. + #[serde(rename = "group_filters", skip_serializing_if = "Option::is_none")] + pub group_filters: Option>, + /// When enabled, provider will not modify or create objects in the remote system. + #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] + pub dry_run: Option, +} + +impl PatchedScimProviderRequest { + /// SCIMProvider Serializer + pub fn new() -> PatchedScimProviderRequest { + PatchedScimProviderRequest { + name: None, + property_mappings: None, + property_mappings_group: None, + url: None, + verify_certificates: None, + token: None, + auth_mode: None, + auth_oauth: None, + auth_oauth_params: None, + compatibility_mode: None, + service_provider_config_cache_timeout: None, + exclude_users_service_account: None, + sync_page_size: None, + sync_page_timeout: None, + group_filters: None, + dry_run: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_scim_source_group_request.rs b/packages/client-rust/src/models/patched_scim_source_group_request.rs new file mode 100644 index 0000000000..10b1bb17a1 --- /dev/null +++ b/packages/client-rust/src/models/patched_scim_source_group_request.rs @@ -0,0 +1,39 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedScimSourceGroupRequest : SCIMSourceGroup Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedScimSourceGroupRequest { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "external_id", skip_serializing_if = "Option::is_none")] + pub external_id: Option, + #[serde(rename = "group", skip_serializing_if = "Option::is_none")] + pub group: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl PatchedScimSourceGroupRequest { + /// SCIMSourceGroup Serializer + pub fn new() -> PatchedScimSourceGroupRequest { + PatchedScimSourceGroupRequest { + id: None, + external_id: None, + group: None, + source: None, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_scim_source_property_mapping_request.rs b/packages/client-rust/src/models/patched_scim_source_property_mapping_request.rs new file mode 100644 index 0000000000..89db56c847 --- /dev/null +++ b/packages/client-rust/src/models/patched_scim_source_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedScimSourcePropertyMappingRequest : SCIMSourcePropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedScimSourcePropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, +} + +impl PatchedScimSourcePropertyMappingRequest { + /// SCIMSourcePropertyMapping Serializer + pub fn new() -> PatchedScimSourcePropertyMappingRequest { + PatchedScimSourcePropertyMappingRequest { + managed: None, + name: None, + expression: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_scim_source_request.rs b/packages/client-rust/src/models/patched_scim_source_request.rs new file mode 100644 index 0000000000..cc3171a89a --- /dev/null +++ b/packages/client-rust/src/models/patched_scim_source_request.rs @@ -0,0 +1,50 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedScimSourceRequest : SCIMSource Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedScimSourceRequest { + /// Source's display Name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Internal source name, used in URLs. + #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] + pub slug: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, +} + +impl PatchedScimSourceRequest { + /// SCIMSource Serializer + pub fn new() -> PatchedScimSourceRequest { + PatchedScimSourceRequest { + name: None, + slug: None, + enabled: None, + user_property_mappings: None, + group_property_mappings: None, + user_path_template: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_scim_source_user_request.rs b/packages/client-rust/src/models/patched_scim_source_user_request.rs new file mode 100644 index 0000000000..dcf5f4f861 --- /dev/null +++ b/packages/client-rust/src/models/patched_scim_source_user_request.rs @@ -0,0 +1,39 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedScimSourceUserRequest : SCIMSourceUser Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedScimSourceUserRequest { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "external_id", skip_serializing_if = "Option::is_none")] + pub external_id: Option, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl PatchedScimSourceUserRequest { + /// SCIMSourceUser Serializer + pub fn new() -> PatchedScimSourceUserRequest { + PatchedScimSourceUserRequest { + id: None, + external_id: None, + user: None, + source: None, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_scope_mapping_request.rs b/packages/client-rust/src/models/patched_scope_mapping_request.rs new file mode 100644 index 0000000000..aa914b12ea --- /dev/null +++ b/packages/client-rust/src/models/patched_scope_mapping_request.rs @@ -0,0 +1,49 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedScopeMappingRequest : ScopeMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedScopeMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, + /// Scope name requested by the client + #[serde(rename = "scope_name", skip_serializing_if = "Option::is_none")] + pub scope_name: Option, + /// Description shown to the user when consenting. If left empty, the user won't be informed. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, +} + +impl PatchedScopeMappingRequest { + /// ScopeMapping Serializer + pub fn new() -> PatchedScopeMappingRequest { + PatchedScopeMappingRequest { + managed: None, + name: None, + expression: None, + scope_name: None, + description: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_settings_request.rs b/packages/client-rust/src/models/patched_settings_request.rs new file mode 100644 index 0000000000..4dbae7d8a5 --- /dev/null +++ b/packages/client-rust/src/models/patched_settings_request.rs @@ -0,0 +1,121 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedSettingsRequest : Settings Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedSettingsRequest { + /// Configure how authentik should show avatars for users. + #[serde(rename = "avatars", skip_serializing_if = "Option::is_none")] + pub avatars: Option, + /// Enable the ability for users to change their name. + #[serde( + rename = "default_user_change_name", + skip_serializing_if = "Option::is_none" + )] + pub default_user_change_name: Option, + /// Enable the ability for users to change their email address. + #[serde( + rename = "default_user_change_email", + skip_serializing_if = "Option::is_none" + )] + pub default_user_change_email: Option, + /// Enable the ability for users to change their username. + #[serde( + rename = "default_user_change_username", + skip_serializing_if = "Option::is_none" + )] + pub default_user_change_username: Option, + /// Events will be deleted after this duration.(Format: weeks=3;days=2;hours=3,seconds=2). + #[serde(rename = "event_retention", skip_serializing_if = "Option::is_none")] + pub event_retention: Option, + /// Reputation cannot decrease lower than this value. Zero or negative. + #[serde( + rename = "reputation_lower_limit", + skip_serializing_if = "Option::is_none" + )] + pub reputation_lower_limit: Option, + /// Reputation cannot increase higher than this value. Zero or positive. + #[serde( + rename = "reputation_upper_limit", + skip_serializing_if = "Option::is_none" + )] + pub reputation_upper_limit: Option, + #[serde( + rename = "footer_links", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub footer_links: Option>, + /// When enabled, all the events caused by a user will be deleted upon the user's deletion. + #[serde(rename = "gdpr_compliance", skip_serializing_if = "Option::is_none")] + pub gdpr_compliance: Option, + /// Globally enable/disable impersonation. + #[serde(rename = "impersonation", skip_serializing_if = "Option::is_none")] + pub impersonation: Option, + /// Require administrators to provide a reason for impersonating a user. + #[serde( + rename = "impersonation_require_reason", + skip_serializing_if = "Option::is_none" + )] + pub impersonation_require_reason: Option, + /// Default token duration + #[serde( + rename = "default_token_duration", + skip_serializing_if = "Option::is_none" + )] + pub default_token_duration: Option, + /// Default token length + #[serde( + rename = "default_token_length", + skip_serializing_if = "Option::is_none" + )] + pub default_token_length: Option, + /// Default page size for API responses, if no size was requested. + #[serde( + rename = "pagination_default_page_size", + skip_serializing_if = "Option::is_none" + )] + pub pagination_default_page_size: Option, + /// Maximum page size + #[serde( + rename = "pagination_max_page_size", + skip_serializing_if = "Option::is_none" + )] + pub pagination_max_page_size: Option, + #[serde(rename = "flags", skip_serializing_if = "Option::is_none")] + pub flags: Option, +} + +impl PatchedSettingsRequest { + /// Settings Serializer + pub fn new() -> PatchedSettingsRequest { + PatchedSettingsRequest { + avatars: None, + default_user_change_name: None, + default_user_change_email: None, + default_user_change_username: None, + event_retention: None, + reputation_lower_limit: None, + reputation_upper_limit: None, + footer_links: None, + gdpr_compliance: None, + impersonation: None, + impersonation_require_reason: None, + default_token_duration: None, + default_token_length: None, + pagination_default_page_size: None, + pagination_max_page_size: None, + flags: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_settings_request_flags.rs b/packages/client-rust/src/models/patched_settings_request_flags.rs new file mode 100644 index 0000000000..3021d6b028 --- /dev/null +++ b/packages/client-rust/src/models/patched_settings_request_flags.rs @@ -0,0 +1,44 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedSettingsRequestFlags { + /// Configure if applications without any policy/group/user bindings should be accessible to + /// any user. + #[serde(rename = "core_default_app_access")] + pub core_default_app_access: bool, + /// Include additional information in audit logs, may incur a performance penalty. + #[serde(rename = "enterprise_audit_include_expanded_diff")] + pub enterprise_audit_include_expanded_diff: bool, + /// Upon successful authentication, re-start authentication in other open tabs. + #[serde(rename = "flows_continuous_login")] + pub flows_continuous_login: bool, + /// Refresh other tabs after successful authentication. + #[serde(rename = "flows_refresh_others")] + pub flows_refresh_others: bool, +} + +impl PatchedSettingsRequestFlags { + pub fn new( + core_default_app_access: bool, + enterprise_audit_include_expanded_diff: bool, + flows_continuous_login: bool, + flows_refresh_others: bool, + ) -> PatchedSettingsRequestFlags { + PatchedSettingsRequestFlags { + core_default_app_access, + enterprise_audit_include_expanded_diff, + flows_continuous_login, + flows_refresh_others, + } + } +} diff --git a/packages/client-rust/src/models/patched_sms_device_request.rs b/packages/client-rust/src/models/patched_sms_device_request.rs new file mode 100644 index 0000000000..86af522441 --- /dev/null +++ b/packages/client-rust/src/models/patched_sms_device_request.rs @@ -0,0 +1,26 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedSmsDeviceRequest : Serializer for sms authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedSmsDeviceRequest { + /// The human-readable name of this device. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl PatchedSmsDeviceRequest { + /// Serializer for sms authenticator devices + pub fn new() -> PatchedSmsDeviceRequest { + PatchedSmsDeviceRequest { name: None } + } +} diff --git a/packages/client-rust/src/models/patched_source_stage_request.rs b/packages/client-rust/src/models/patched_source_stage_request.rs new file mode 100644 index 0000000000..6c8a386b12 --- /dev/null +++ b/packages/client-rust/src/models/patched_source_stage_request.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedSourceStageRequest : SourceStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedSourceStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + /// Amount of time a user can take to return from the source to continue the flow (Format: + /// hours=-1;minutes=-2;seconds=-3) + #[serde(rename = "resume_timeout", skip_serializing_if = "Option::is_none")] + pub resume_timeout: Option, +} + +impl PatchedSourceStageRequest { + /// SourceStage Serializer + pub fn new() -> PatchedSourceStageRequest { + PatchedSourceStageRequest { + name: None, + source: None, + resume_timeout: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_ssf_provider_request.rs b/packages/client-rust/src/models/patched_ssf_provider_request.rs new file mode 100644 index 0000000000..47442f1ab5 --- /dev/null +++ b/packages/client-rust/src/models/patched_ssf_provider_request.rs @@ -0,0 +1,40 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedSsfProviderRequest : SSFProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedSsfProviderRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Key used to sign the SSF Events. + #[serde(rename = "signing_key", skip_serializing_if = "Option::is_none")] + pub signing_key: Option, + #[serde( + rename = "oidc_auth_providers", + skip_serializing_if = "Option::is_none" + )] + pub oidc_auth_providers: Option>, + #[serde(rename = "event_retention", skip_serializing_if = "Option::is_none")] + pub event_retention: Option, +} + +impl PatchedSsfProviderRequest { + /// SSFProvider Serializer + pub fn new() -> PatchedSsfProviderRequest { + PatchedSsfProviderRequest { + name: None, + signing_key: None, + oidc_auth_providers: None, + event_retention: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_static_device_request.rs b/packages/client-rust/src/models/patched_static_device_request.rs new file mode 100644 index 0000000000..de91dcc98e --- /dev/null +++ b/packages/client-rust/src/models/patched_static_device_request.rs @@ -0,0 +1,26 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedStaticDeviceRequest : Serializer for static authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedStaticDeviceRequest { + /// The human-readable name of this device. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl PatchedStaticDeviceRequest { + /// Serializer for static authenticator devices + pub fn new() -> PatchedStaticDeviceRequest { + PatchedStaticDeviceRequest { name: None } + } +} diff --git a/packages/client-rust/src/models/patched_telegram_source_property_mapping_request.rs b/packages/client-rust/src/models/patched_telegram_source_property_mapping_request.rs new file mode 100644 index 0000000000..1ed78746e4 --- /dev/null +++ b/packages/client-rust/src/models/patched_telegram_source_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedTelegramSourcePropertyMappingRequest : TelegramSourcePropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedTelegramSourcePropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, +} + +impl PatchedTelegramSourcePropertyMappingRequest { + /// TelegramSourcePropertyMapping Serializer + pub fn new() -> PatchedTelegramSourcePropertyMappingRequest { + PatchedTelegramSourcePropertyMappingRequest { + managed: None, + name: None, + expression: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_telegram_source_request.rs b/packages/client-rust/src/models/patched_telegram_source_request.rs new file mode 100644 index 0000000000..f79e431515 --- /dev/null +++ b/packages/client-rust/src/models/patched_telegram_source_request.rs @@ -0,0 +1,106 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedTelegramSourceRequest : Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedTelegramSourceRequest { + /// Source's display Name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Internal source name, used in URLs. + #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] + pub slug: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + /// Telegram bot username + #[serde(rename = "bot_username", skip_serializing_if = "Option::is_none")] + pub bot_username: Option, + /// Telegram bot token + #[serde(rename = "bot_token", skip_serializing_if = "Option::is_none")] + pub bot_token: Option, + /// Request access to send messages from your bot. + #[serde( + rename = "request_message_access", + skip_serializing_if = "Option::is_none" + )] + pub request_message_access: Option, + /// Flow used before authentication. + #[serde( + rename = "pre_authentication_flow", + skip_serializing_if = "Option::is_none" + )] + pub pre_authentication_flow: Option, +} + +impl PatchedTelegramSourceRequest { + /// Source Serializer + pub fn new() -> PatchedTelegramSourceRequest { + PatchedTelegramSourceRequest { + name: None, + slug: None, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + policy_engine_mode: None, + user_matching_mode: None, + user_path_template: None, + icon: None, + bot_username: None, + bot_token: None, + request_message_access: None, + pre_authentication_flow: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_tenant_request.rs b/packages/client-rust/src/models/patched_tenant_request.rs new file mode 100644 index 0000000000..9f0f0ee22e --- /dev/null +++ b/packages/client-rust/src/models/patched_tenant_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedTenantRequest : Tenant Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedTenantRequest { + #[serde(rename = "schema_name", skip_serializing_if = "Option::is_none")] + pub schema_name: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "ready", skip_serializing_if = "Option::is_none")] + pub ready: Option, +} + +impl PatchedTenantRequest { + /// Tenant Serializer + pub fn new() -> PatchedTenantRequest { + PatchedTenantRequest { + schema_name: None, + name: None, + ready: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_token_request.rs b/packages/client-rust/src/models/patched_token_request.rs new file mode 100644 index 0000000000..34d780738c --- /dev/null +++ b/packages/client-rust/src/models/patched_token_request.rs @@ -0,0 +1,58 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedTokenRequest : Token Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedTokenRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] + pub identifier: Option, + #[serde(rename = "intent", skip_serializing_if = "Option::is_none")] + pub intent: Option, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, + #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] + pub expiring: Option, +} + +impl PatchedTokenRequest { + /// Token Serializer + pub fn new() -> PatchedTokenRequest { + PatchedTokenRequest { + managed: None, + identifier: None, + intent: None, + user: None, + description: None, + expires: None, + expiring: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_totp_device_request.rs b/packages/client-rust/src/models/patched_totp_device_request.rs new file mode 100644 index 0000000000..d724a7122c --- /dev/null +++ b/packages/client-rust/src/models/patched_totp_device_request.rs @@ -0,0 +1,26 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedTotpDeviceRequest : Serializer for totp authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedTotpDeviceRequest { + /// The human-readable name of this device. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl PatchedTotpDeviceRequest { + /// Serializer for totp authenticator devices + pub fn new() -> PatchedTotpDeviceRequest { + PatchedTotpDeviceRequest { name: None } + } +} diff --git a/packages/client-rust/src/models/patched_unique_password_policy_request.rs b/packages/client-rust/src/models/patched_unique_password_policy_request.rs new file mode 100644 index 0000000000..2c88cb707b --- /dev/null +++ b/packages/client-rust/src/models/patched_unique_password_policy_request.rs @@ -0,0 +1,43 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedUniquePasswordPolicyRequest : Password Uniqueness Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedUniquePasswordPolicyRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + /// Field key to check, field keys defined in Prompt stages are available. + #[serde(rename = "password_field", skip_serializing_if = "Option::is_none")] + pub password_field: Option, + /// Number of passwords to check against. + #[serde( + rename = "num_historical_passwords", + skip_serializing_if = "Option::is_none" + )] + pub num_historical_passwords: Option, +} + +impl PatchedUniquePasswordPolicyRequest { + /// Password Uniqueness Policy Serializer + pub fn new() -> PatchedUniquePasswordPolicyRequest { + PatchedUniquePasswordPolicyRequest { + name: None, + execution_logging: None, + password_field: None, + num_historical_passwords: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_user_delete_stage_request.rs b/packages/client-rust/src/models/patched_user_delete_stage_request.rs new file mode 100644 index 0000000000..a7fe826672 --- /dev/null +++ b/packages/client-rust/src/models/patched_user_delete_stage_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedUserDeleteStageRequest : UserDeleteStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedUserDeleteStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl PatchedUserDeleteStageRequest { + /// UserDeleteStage Serializer + pub fn new() -> PatchedUserDeleteStageRequest { + PatchedUserDeleteStageRequest { name: None } + } +} diff --git a/packages/client-rust/src/models/patched_user_kerberos_source_connection_request.rs b/packages/client-rust/src/models/patched_user_kerberos_source_connection_request.rs new file mode 100644 index 0000000000..00b2c1e14e --- /dev/null +++ b/packages/client-rust/src/models/patched_user_kerberos_source_connection_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedUserKerberosSourceConnectionRequest : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedUserKerberosSourceConnectionRequest { + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] + pub identifier: Option, +} + +impl PatchedUserKerberosSourceConnectionRequest { + /// User source connection + pub fn new() -> PatchedUserKerberosSourceConnectionRequest { + PatchedUserKerberosSourceConnectionRequest { + user: None, + source: None, + identifier: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_user_ldap_source_connection_request.rs b/packages/client-rust/src/models/patched_user_ldap_source_connection_request.rs new file mode 100644 index 0000000000..b7cef53a0c --- /dev/null +++ b/packages/client-rust/src/models/patched_user_ldap_source_connection_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedUserLdapSourceConnectionRequest : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedUserLdapSourceConnectionRequest { + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] + pub identifier: Option, +} + +impl PatchedUserLdapSourceConnectionRequest { + /// User source connection + pub fn new() -> PatchedUserLdapSourceConnectionRequest { + PatchedUserLdapSourceConnectionRequest { + user: None, + source: None, + identifier: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_user_login_stage_request.rs b/packages/client-rust/src/models/patched_user_login_stage_request.rs new file mode 100644 index 0000000000..943c6a612d --- /dev/null +++ b/packages/client-rust/src/models/patched_user_login_stage_request.rs @@ -0,0 +1,58 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedUserLoginStageRequest : UserLoginStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedUserLoginStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Determines how long a session lasts. Default of 0 means that the sessions lasts until the + /// browser is closed. (Format: hours=-1;minutes=-2;seconds=-3) + #[serde(rename = "session_duration", skip_serializing_if = "Option::is_none")] + pub session_duration: Option, + /// Terminate all other sessions of the user logging in. + #[serde( + rename = "terminate_other_sessions", + skip_serializing_if = "Option::is_none" + )] + pub terminate_other_sessions: Option, + /// Offset the session will be extended by when the user picks the remember me option. Default + /// of 0 means that the remember me option will not be shown. (Format: + /// hours=-1;minutes=-2;seconds=-3) + #[serde(rename = "remember_me_offset", skip_serializing_if = "Option::is_none")] + pub remember_me_offset: Option, + /// Bind sessions created by this stage to the configured network + #[serde(rename = "network_binding", skip_serializing_if = "Option::is_none")] + pub network_binding: Option, + /// Bind sessions created by this stage to the configured GeoIP location + #[serde(rename = "geoip_binding", skip_serializing_if = "Option::is_none")] + pub geoip_binding: Option, + /// When set to a non-zero value, authentik will save a cookie with a longer expiry,to remember + /// the device the user is logging in from. (Format: hours=-1;minutes=-2;seconds=-3) + #[serde(rename = "remember_device", skip_serializing_if = "Option::is_none")] + pub remember_device: Option, +} + +impl PatchedUserLoginStageRequest { + /// UserLoginStage Serializer + pub fn new() -> PatchedUserLoginStageRequest { + PatchedUserLoginStageRequest { + name: None, + session_duration: None, + terminate_other_sessions: None, + remember_me_offset: None, + network_binding: None, + geoip_binding: None, + remember_device: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_user_logout_stage_request.rs b/packages/client-rust/src/models/patched_user_logout_stage_request.rs new file mode 100644 index 0000000000..d056b85a87 --- /dev/null +++ b/packages/client-rust/src/models/patched_user_logout_stage_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedUserLogoutStageRequest : UserLogoutStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedUserLogoutStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl PatchedUserLogoutStageRequest { + /// UserLogoutStage Serializer + pub fn new() -> PatchedUserLogoutStageRequest { + PatchedUserLogoutStageRequest { name: None } + } +} diff --git a/packages/client-rust/src/models/patched_user_o_auth_source_connection_request.rs b/packages/client-rust/src/models/patched_user_o_auth_source_connection_request.rs new file mode 100644 index 0000000000..d55ce43a41 --- /dev/null +++ b/packages/client-rust/src/models/patched_user_o_auth_source_connection_request.rs @@ -0,0 +1,44 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedUserOAuthSourceConnectionRequest : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedUserOAuthSourceConnectionRequest { + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] + pub identifier: Option, + #[serde( + rename = "access_token", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub access_token: Option>, + #[serde(rename = "expires", skip_serializing_if = "Option::is_none")] + pub expires: Option, +} + +impl PatchedUserOAuthSourceConnectionRequest { + /// User source connection + pub fn new() -> PatchedUserOAuthSourceConnectionRequest { + PatchedUserOAuthSourceConnectionRequest { + user: None, + source: None, + identifier: None, + access_token: None, + expires: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_user_plex_source_connection_request.rs b/packages/client-rust/src/models/patched_user_plex_source_connection_request.rs new file mode 100644 index 0000000000..d96eff930d --- /dev/null +++ b/packages/client-rust/src/models/patched_user_plex_source_connection_request.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedUserPlexSourceConnectionRequest : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedUserPlexSourceConnectionRequest { + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] + pub identifier: Option, + #[serde(rename = "plex_token", skip_serializing_if = "Option::is_none")] + pub plex_token: Option, +} + +impl PatchedUserPlexSourceConnectionRequest { + /// User source connection + pub fn new() -> PatchedUserPlexSourceConnectionRequest { + PatchedUserPlexSourceConnectionRequest { + user: None, + source: None, + identifier: None, + plex_token: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_user_request.rs b/packages/client-rust/src/models/patched_user_request.rs new file mode 100644 index 0000000000..fa9d14e486 --- /dev/null +++ b/packages/client-rust/src/models/patched_user_request.rs @@ -0,0 +1,62 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedUserRequest : User Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedUserRequest { + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + /// User's display name. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Designates whether this user should be treated as active. Unselect this instead of deleting + /// accounts. + #[serde(rename = "is_active", skip_serializing_if = "Option::is_none")] + pub is_active: Option, + #[serde( + rename = "last_login", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub last_login: Option>, + #[serde(rename = "groups", skip_serializing_if = "Option::is_none")] + pub groups: Option>, + #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] + pub roles: Option>, + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, + #[serde(rename = "path", skip_serializing_if = "Option::is_none")] + pub path: Option, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, +} + +impl PatchedUserRequest { + /// User Serializer + pub fn new() -> PatchedUserRequest { + PatchedUserRequest { + username: None, + name: None, + is_active: None, + last_login: None, + groups: None, + roles: None, + email: None, + attributes: None, + path: None, + r#type: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_user_saml_source_connection_request.rs b/packages/client-rust/src/models/patched_user_saml_source_connection_request.rs new file mode 100644 index 0000000000..5cc5df0f2e --- /dev/null +++ b/packages/client-rust/src/models/patched_user_saml_source_connection_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedUserSamlSourceConnectionRequest : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedUserSamlSourceConnectionRequest { + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] + pub identifier: Option, +} + +impl PatchedUserSamlSourceConnectionRequest { + /// User source connection + pub fn new() -> PatchedUserSamlSourceConnectionRequest { + PatchedUserSamlSourceConnectionRequest { + user: None, + source: None, + identifier: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_user_source_connection_request.rs b/packages/client-rust/src/models/patched_user_source_connection_request.rs new file mode 100644 index 0000000000..34357dffad --- /dev/null +++ b/packages/client-rust/src/models/patched_user_source_connection_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedUserSourceConnectionRequest : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedUserSourceConnectionRequest { + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] + pub identifier: Option, +} + +impl PatchedUserSourceConnectionRequest { + /// User source connection + pub fn new() -> PatchedUserSourceConnectionRequest { + PatchedUserSourceConnectionRequest { + user: None, + source: None, + identifier: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_user_telegram_source_connection_request.rs b/packages/client-rust/src/models/patched_user_telegram_source_connection_request.rs new file mode 100644 index 0000000000..812561d84b --- /dev/null +++ b/packages/client-rust/src/models/patched_user_telegram_source_connection_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedUserTelegramSourceConnectionRequest : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedUserTelegramSourceConnectionRequest { + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option, + #[serde(rename = "source", skip_serializing_if = "Option::is_none")] + pub source: Option, + #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] + pub identifier: Option, +} + +impl PatchedUserTelegramSourceConnectionRequest { + /// User source connection + pub fn new() -> PatchedUserTelegramSourceConnectionRequest { + PatchedUserTelegramSourceConnectionRequest { + user: None, + source: None, + identifier: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_user_write_stage_request.rs b/packages/client-rust/src/models/patched_user_write_stage_request.rs new file mode 100644 index 0000000000..b9b79ce3bc --- /dev/null +++ b/packages/client-rust/src/models/patched_user_write_stage_request.rs @@ -0,0 +1,52 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedUserWriteStageRequest : UserWriteStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedUserWriteStageRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "user_creation_mode", skip_serializing_if = "Option::is_none")] + pub user_creation_mode: Option, + /// When set, newly created users are inactive and cannot login. + #[serde( + rename = "create_users_as_inactive", + skip_serializing_if = "Option::is_none" + )] + pub create_users_as_inactive: Option, + /// Optionally add newly created users to this group. + #[serde( + rename = "create_users_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub create_users_group: Option>, + #[serde(rename = "user_type", skip_serializing_if = "Option::is_none")] + pub user_type: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, +} + +impl PatchedUserWriteStageRequest { + /// UserWriteStage Serializer + pub fn new() -> PatchedUserWriteStageRequest { + PatchedUserWriteStageRequest { + name: None, + user_creation_mode: None, + create_users_as_inactive: None, + create_users_group: None, + user_type: None, + user_path_template: None, + } + } +} diff --git a/packages/client-rust/src/models/patched_web_authn_device_request.rs b/packages/client-rust/src/models/patched_web_authn_device_request.rs new file mode 100644 index 0000000000..3590f21352 --- /dev/null +++ b/packages/client-rust/src/models/patched_web_authn_device_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedWebAuthnDeviceRequest : Serializer for WebAuthn authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedWebAuthnDeviceRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl PatchedWebAuthnDeviceRequest { + /// Serializer for WebAuthn authenticator devices + pub fn new() -> PatchedWebAuthnDeviceRequest { + PatchedWebAuthnDeviceRequest { name: None } + } +} diff --git a/packages/client-rust/src/models/patched_ws_federation_provider_request.rs b/packages/client-rust/src/models/patched_ws_federation_provider_request.rs new file mode 100644 index 0000000000..d0a2e5bb6f --- /dev/null +++ b/packages/client-rust/src/models/patched_ws_federation_provider_request.rs @@ -0,0 +1,142 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PatchedWsFederationProviderRequest : WSFederationProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchedWsFederationProviderRequest { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow", skip_serializing_if = "Option::is_none")] + pub authorization_flow: Option, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow", skip_serializing_if = "Option::is_none")] + pub invalidation_flow: Option, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + #[serde(rename = "reply_url", skip_serializing_if = "Option::is_none")] + pub reply_url: Option, + #[serde(rename = "wtrealm", skip_serializing_if = "Option::is_none")] + pub wtrealm: Option, + /// Assertion valid not before current time + this value (Format: + /// hours=-1;minutes=-2;seconds=-3). + #[serde( + rename = "assertion_valid_not_before", + skip_serializing_if = "Option::is_none" + )] + pub assertion_valid_not_before: Option, + /// Assertion not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "assertion_valid_not_on_or_after", + skip_serializing_if = "Option::is_none" + )] + pub assertion_valid_not_on_or_after: Option, + /// Session not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "session_valid_not_on_or_after", + skip_serializing_if = "Option::is_none" + )] + pub session_valid_not_on_or_after: Option, + /// Configure how the NameID value will be created. When left empty, the NameIDPolicy of the + /// incoming request will be considered + #[serde( + rename = "name_id_mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub name_id_mapping: Option>, + /// Configure how the AuthnContextClassRef value will be created. When left empty, the + /// AuthnContextClassRef will be set based on which authentication methods the user used to + /// authenticate. + #[serde( + rename = "authn_context_class_ref_mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authn_context_class_ref_mapping: Option>, + #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] + pub digest_algorithm: Option, + #[serde( + rename = "signature_algorithm", + skip_serializing_if = "Option::is_none" + )] + pub signature_algorithm: Option, + /// Keypair used to sign outgoing Responses going to the Service Provider. + #[serde( + rename = "signing_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub signing_kp: Option>, + /// When selected, incoming assertions are encrypted by the IdP using the public key of the + /// encryption keypair. The assertion is decrypted by the SP using the the private key. + #[serde( + rename = "encryption_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub encryption_kp: Option>, + #[serde(rename = "sign_assertion", skip_serializing_if = "Option::is_none")] + pub sign_assertion: Option, + #[serde( + rename = "sign_logout_request", + skip_serializing_if = "Option::is_none" + )] + pub sign_logout_request: Option, + #[serde( + rename = "default_name_id_policy", + skip_serializing_if = "Option::is_none" + )] + pub default_name_id_policy: Option, +} + +impl PatchedWsFederationProviderRequest { + /// WSFederationProvider Serializer + pub fn new() -> PatchedWsFederationProviderRequest { + PatchedWsFederationProviderRequest { + name: None, + authentication_flow: None, + authorization_flow: None, + invalidation_flow: None, + property_mappings: None, + reply_url: None, + wtrealm: None, + assertion_valid_not_before: None, + assertion_valid_not_on_or_after: None, + session_valid_not_on_or_after: None, + name_id_mapping: None, + authn_context_class_ref_mapping: None, + digest_algorithm: None, + signature_algorithm: None, + signing_kp: None, + encryption_kp: None, + sign_assertion: None, + sign_logout_request: None, + default_name_id_policy: None, + } + } +} diff --git a/packages/client-rust/src/models/permission.rs b/packages/client-rust/src/models/permission.rs new file mode 100644 index 0000000000..29e3433bd3 --- /dev/null +++ b/packages/client-rust/src/models/permission.rs @@ -0,0 +1,55 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Permission : Global permission +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Permission { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "codename")] + pub codename: String, + #[serde(rename = "model")] + pub model: String, + #[serde(rename = "app_label")] + pub app_label: String, + /// Human-readable app label + #[serde(rename = "app_label_verbose")] + pub app_label_verbose: String, + /// Human-readable model name + #[serde(rename = "model_verbose")] + pub model_verbose: String, +} + +impl Permission { + /// Global permission + pub fn new( + id: i32, + name: String, + codename: String, + model: String, + app_label: String, + app_label_verbose: String, + model_verbose: String, + ) -> Permission { + Permission { + id, + name, + codename, + model, + app_label, + app_label_verbose, + model_verbose, + } + } +} diff --git a/packages/client-rust/src/models/permission_assign_request.rs b/packages/client-rust/src/models/permission_assign_request.rs new file mode 100644 index 0000000000..81e335345a --- /dev/null +++ b/packages/client-rust/src/models/permission_assign_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PermissionAssignRequest : Request to assign a new permission +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PermissionAssignRequest { + #[serde(rename = "permissions")] + pub permissions: Vec, + #[serde(rename = "model", skip_serializing_if = "Option::is_none")] + pub model: Option, + #[serde(rename = "object_pk", skip_serializing_if = "Option::is_none")] + pub object_pk: Option, +} + +impl PermissionAssignRequest { + /// Request to assign a new permission + pub fn new(permissions: Vec) -> PermissionAssignRequest { + PermissionAssignRequest { + permissions, + model: None, + object_pk: None, + } + } +} diff --git a/packages/client-rust/src/models/permission_assign_result.rs b/packages/client-rust/src/models/permission_assign_result.rs new file mode 100644 index 0000000000..bec2386884 --- /dev/null +++ b/packages/client-rust/src/models/permission_assign_result.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PermissionAssignResult : Result from assigning permissions to a user/role +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PermissionAssignResult { + #[serde(rename = "id")] + pub id: String, +} + +impl PermissionAssignResult { + /// Result from assigning permissions to a user/role + pub fn new(id: String) -> PermissionAssignResult { + PermissionAssignResult { id } + } +} diff --git a/packages/client-rust/src/models/pkce_method_enum.rs b/packages/client-rust/src/models/pkce_method_enum.rs new file mode 100644 index 0000000000..09cb7813d0 --- /dev/null +++ b/packages/client-rust/src/models/pkce_method_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum PkceMethodEnum { + #[serde(rename = "none")] + None, + #[serde(rename = "plain")] + Plain, + #[serde(rename = "S256")] + S256, +} + +impl std::fmt::Display for PkceMethodEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::None => write!(f, "none"), + Self::Plain => write!(f, "plain"), + Self::S256 => write!(f, "S256"), + } + } +} + +impl Default for PkceMethodEnum { + fn default() -> PkceMethodEnum { + Self::None + } +} diff --git a/packages/client-rust/src/models/plex_authentication_challenge.rs b/packages/client-rust/src/models/plex_authentication_challenge.rs new file mode 100644 index 0000000000..044e6b886b --- /dev/null +++ b/packages/client-rust/src/models/plex_authentication_challenge.rs @@ -0,0 +1,39 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PlexAuthenticationChallenge : Challenge shown to the user in identification stage +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PlexAuthenticationChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "client_id")] + pub client_id: String, + #[serde(rename = "slug")] + pub slug: String, +} + +impl PlexAuthenticationChallenge { + /// Challenge shown to the user in identification stage + pub fn new(client_id: String, slug: String) -> PlexAuthenticationChallenge { + PlexAuthenticationChallenge { + flow_info: None, + component: None, + response_errors: None, + client_id, + slug, + } + } +} diff --git a/packages/client-rust/src/models/plex_authentication_challenge_response_request.rs b/packages/client-rust/src/models/plex_authentication_challenge_response_request.rs new file mode 100644 index 0000000000..0f16547300 --- /dev/null +++ b/packages/client-rust/src/models/plex_authentication_challenge_response_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PlexAuthenticationChallengeResponseRequest : Pseudo class for plex response +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PlexAuthenticationChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, +} + +impl PlexAuthenticationChallengeResponseRequest { + /// Pseudo class for plex response + pub fn new() -> PlexAuthenticationChallengeResponseRequest { + PlexAuthenticationChallengeResponseRequest { component: None } + } +} diff --git a/packages/client-rust/src/models/plex_source.rs b/packages/client-rust/src/models/plex_source.rs new file mode 100644 index 0000000000..8510534402 --- /dev/null +++ b/packages/client-rust/src/models/plex_source.rs @@ -0,0 +1,151 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PlexSource : Plex Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PlexSource { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Source's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal source name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde(rename = "managed", deserialize_with = "Option::deserialize")] + pub managed: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + #[serde(rename = "icon_url")] + pub icon_url: String, + #[serde(rename = "icon_themed_urls", deserialize_with = "Option::deserialize")] + pub icon_themed_urls: Option, + /// How the source determines if an existing group should be used or a new group created. + #[serde( + rename = "group_matching_mode", + skip_serializing_if = "Option::is_none" + )] + pub group_matching_mode: Option, + /// Client identifier used to talk to Plex. + #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] + pub client_id: Option, + /// Which servers a user has to be a member of to be granted access. Empty list allows every + /// server. + #[serde(rename = "allowed_servers", skip_serializing_if = "Option::is_none")] + pub allowed_servers: Option>, + /// Allow friends to authenticate, even if you don't share a server. + #[serde(rename = "allow_friends", skip_serializing_if = "Option::is_none")] + pub allow_friends: Option, + /// Plex token used to check friends + #[serde(rename = "plex_token")] + pub plex_token: String, +} + +impl PlexSource { + /// Plex Source Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + slug: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + managed: Option, + icon_url: String, + icon_themed_urls: Option, + plex_token: String, + ) -> PlexSource { + PlexSource { + pk, + name, + slug, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + policy_engine_mode: None, + user_matching_mode: None, + managed, + user_path_template: None, + icon: None, + icon_url, + icon_themed_urls, + group_matching_mode: None, + client_id: None, + allowed_servers: None, + allow_friends: None, + plex_token, + } + } +} diff --git a/packages/client-rust/src/models/plex_source_property_mapping.rs b/packages/client-rust/src/models/plex_source_property_mapping.rs new file mode 100644 index 0000000000..553496424e --- /dev/null +++ b/packages/client-rust/src/models/plex_source_property_mapping.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PlexSourcePropertyMapping : PlexSourcePropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PlexSourcePropertyMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + /// Get object's component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl PlexSourcePropertyMapping { + /// PlexSourcePropertyMapping Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + expression: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> PlexSourcePropertyMapping { + PlexSourcePropertyMapping { + pk, + managed: None, + name, + expression, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/plex_source_property_mapping_request.rs b/packages/client-rust/src/models/plex_source_property_mapping_request.rs new file mode 100644 index 0000000000..71370c83e3 --- /dev/null +++ b/packages/client-rust/src/models/plex_source_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PlexSourcePropertyMappingRequest : PlexSourcePropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PlexSourcePropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, +} + +impl PlexSourcePropertyMappingRequest { + /// PlexSourcePropertyMapping Serializer + pub fn new(name: String, expression: String) -> PlexSourcePropertyMappingRequest { + PlexSourcePropertyMappingRequest { + managed: None, + name, + expression, + } + } +} diff --git a/packages/client-rust/src/models/plex_source_request.rs b/packages/client-rust/src/models/plex_source_request.rs new file mode 100644 index 0000000000..23354507c5 --- /dev/null +++ b/packages/client-rust/src/models/plex_source_request.rs @@ -0,0 +1,108 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PlexSourceRequest : Plex Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PlexSourceRequest { + /// Source's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal source name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + /// How the source determines if an existing group should be used or a new group created. + #[serde( + rename = "group_matching_mode", + skip_serializing_if = "Option::is_none" + )] + pub group_matching_mode: Option, + /// Client identifier used to talk to Plex. + #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] + pub client_id: Option, + /// Which servers a user has to be a member of to be granted access. Empty list allows every + /// server. + #[serde(rename = "allowed_servers", skip_serializing_if = "Option::is_none")] + pub allowed_servers: Option>, + /// Allow friends to authenticate, even if you don't share a server. + #[serde(rename = "allow_friends", skip_serializing_if = "Option::is_none")] + pub allow_friends: Option, + /// Plex token used to check friends + #[serde(rename = "plex_token")] + pub plex_token: String, +} + +impl PlexSourceRequest { + /// Plex Source Serializer + pub fn new(name: String, slug: String, plex_token: String) -> PlexSourceRequest { + PlexSourceRequest { + name, + slug, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + policy_engine_mode: None, + user_matching_mode: None, + user_path_template: None, + icon: None, + group_matching_mode: None, + client_id: None, + allowed_servers: None, + allow_friends: None, + plex_token, + } + } +} diff --git a/packages/client-rust/src/models/plex_token_redeem_request.rs b/packages/client-rust/src/models/plex_token_redeem_request.rs new file mode 100644 index 0000000000..0bd4bec9e7 --- /dev/null +++ b/packages/client-rust/src/models/plex_token_redeem_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PlexTokenRedeemRequest : Serializer to redeem a plex token +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PlexTokenRedeemRequest { + #[serde(rename = "plex_token")] + pub plex_token: String, +} + +impl PlexTokenRedeemRequest { + /// Serializer to redeem a plex token + pub fn new(plex_token: String) -> PlexTokenRedeemRequest { + PlexTokenRedeemRequest { plex_token } + } +} diff --git a/packages/client-rust/src/models/policy.rs b/packages/client-rust/src/models/policy.rs new file mode 100644 index 0000000000..9575fcc55f --- /dev/null +++ b/packages/client-rust/src/models/policy.rs @@ -0,0 +1,63 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Policy : Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Policy { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Return objects policy is bound to + #[serde(rename = "bound_to")] + pub bound_to: i32, +} + +impl Policy { + /// Policy Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + bound_to: i32, + ) -> Policy { + Policy { + pk, + name, + execution_logging: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + bound_to, + } + } +} diff --git a/packages/client-rust/src/models/policy_binding.rs b/packages/client-rust/src/models/policy_binding.rs new file mode 100644 index 0000000000..2b5f8f3ae5 --- /dev/null +++ b/packages/client-rust/src/models/policy_binding.rs @@ -0,0 +1,88 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PolicyBinding : PolicyBinding Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PolicyBinding { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde( + rename = "policy", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub policy: Option>, + #[serde( + rename = "group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub group: Option>, + #[serde( + rename = "user", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub user: Option>, + #[serde(rename = "policy_obj")] + pub policy_obj: models::Policy, + #[serde(rename = "group_obj")] + pub group_obj: models::PartialGroup, + #[serde(rename = "user_obj")] + pub user_obj: models::PartialUser, + #[serde(rename = "target")] + pub target: uuid::Uuid, + /// Negates the outcome of the policy. Messages are unaffected. + #[serde(rename = "negate", skip_serializing_if = "Option::is_none")] + pub negate: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "order")] + pub order: i32, + /// Timeout after which Policy execution is terminated. + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + /// Result if the Policy execution fails. + #[serde(rename = "failure_result", skip_serializing_if = "Option::is_none")] + pub failure_result: Option, +} + +impl PolicyBinding { + /// PolicyBinding Serializer + pub fn new( + pk: uuid::Uuid, + policy_obj: models::Policy, + group_obj: models::PartialGroup, + user_obj: models::PartialUser, + target: uuid::Uuid, + order: i32, + ) -> PolicyBinding { + PolicyBinding { + pk, + policy: None, + group: None, + user: None, + policy_obj, + group_obj, + user_obj, + target, + negate: None, + enabled: None, + order, + timeout: None, + failure_result: None, + } + } +} diff --git a/packages/client-rust/src/models/policy_binding_request.rs b/packages/client-rust/src/models/policy_binding_request.rs new file mode 100644 index 0000000000..778eca1300 --- /dev/null +++ b/packages/client-rust/src/models/policy_binding_request.rs @@ -0,0 +1,69 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PolicyBindingRequest : PolicyBinding Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PolicyBindingRequest { + #[serde( + rename = "policy", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub policy: Option>, + #[serde( + rename = "group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub group: Option>, + #[serde( + rename = "user", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub user: Option>, + #[serde(rename = "target")] + pub target: uuid::Uuid, + /// Negates the outcome of the policy. Messages are unaffected. + #[serde(rename = "negate", skip_serializing_if = "Option::is_none")] + pub negate: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "order")] + pub order: i32, + /// Timeout after which Policy execution is terminated. + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + /// Result if the Policy execution fails. + #[serde(rename = "failure_result", skip_serializing_if = "Option::is_none")] + pub failure_result: Option, +} + +impl PolicyBindingRequest { + /// PolicyBinding Serializer + pub fn new(target: uuid::Uuid, order: i32) -> PolicyBindingRequest { + PolicyBindingRequest { + policy: None, + group: None, + user: None, + target, + negate: None, + enabled: None, + order, + timeout: None, + failure_result: None, + } + } +} diff --git a/packages/client-rust/src/models/policy_engine_mode.rs b/packages/client-rust/src/models/policy_engine_mode.rs new file mode 100644 index 0000000000..0856eabff9 --- /dev/null +++ b/packages/client-rust/src/models/policy_engine_mode.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum PolicyEngineMode { + #[serde(rename = "all")] + All, + #[serde(rename = "any")] + Any, +} + +impl std::fmt::Display for PolicyEngineMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::All => write!(f, "all"), + Self::Any => write!(f, "any"), + } + } +} + +impl Default for PolicyEngineMode { + fn default() -> PolicyEngineMode { + Self::All + } +} diff --git a/packages/client-rust/src/models/policy_test_request.rs b/packages/client-rust/src/models/policy_test_request.rs new file mode 100644 index 0000000000..227b98a506 --- /dev/null +++ b/packages/client-rust/src/models/policy_test_request.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PolicyTestRequest : Test policy execution for a user with context +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PolicyTestRequest { + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "context", skip_serializing_if = "Option::is_none")] + pub context: Option>, +} + +impl PolicyTestRequest { + /// Test policy execution for a user with context + pub fn new(user: i32) -> PolicyTestRequest { + PolicyTestRequest { + user, + context: None, + } + } +} diff --git a/packages/client-rust/src/models/policy_test_result.rs b/packages/client-rust/src/models/policy_test_result.rs new file mode 100644 index 0000000000..d90478391c --- /dev/null +++ b/packages/client-rust/src/models/policy_test_result.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PolicyTestResult : result of a policy test +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PolicyTestResult { + #[serde(rename = "passing")] + pub passing: bool, + #[serde(rename = "messages")] + pub messages: Vec, + #[serde(rename = "log_messages")] + pub log_messages: Vec, +} + +impl PolicyTestResult { + /// result of a policy test + pub fn new( + passing: bool, + messages: Vec, + log_messages: Vec, + ) -> PolicyTestResult { + PolicyTestResult { + passing, + messages, + log_messages, + } + } +} diff --git a/packages/client-rust/src/models/process.rs b/packages/client-rust/src/models/process.rs new file mode 100644 index 0000000000..3f108036da --- /dev/null +++ b/packages/client-rust/src/models/process.rs @@ -0,0 +1,31 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Process { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option, +} + +impl Process { + pub fn new(id: i32, name: String) -> Process { + Process { + id, + name, + user: None, + } + } +} diff --git a/packages/client-rust/src/models/process_request.rs b/packages/client-rust/src/models/process_request.rs new file mode 100644 index 0000000000..54a2829f8c --- /dev/null +++ b/packages/client-rust/src/models/process_request.rs @@ -0,0 +1,31 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ProcessRequest { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option, +} + +impl ProcessRequest { + pub fn new(id: i32, name: String) -> ProcessRequest { + ProcessRequest { + id, + name, + user: None, + } + } +} diff --git a/packages/client-rust/src/models/prompt.rs b/packages/client-rust/src/models/prompt.rs new file mode 100644 index 0000000000..732de949c7 --- /dev/null +++ b/packages/client-rust/src/models/prompt.rs @@ -0,0 +1,82 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Prompt : Prompt Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Prompt { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Name of the form field, also used to store the value + #[serde(rename = "field_key")] + pub field_key: String, + #[serde(rename = "label")] + pub label: String, + #[serde(rename = "type")] + pub r#type: models::PromptTypeEnum, + #[serde(rename = "required", skip_serializing_if = "Option::is_none")] + pub required: Option, + /// Optionally provide a short hint that describes the expected input value. When creating a + /// fixed choice field, enable interpreting as expression and return a list to return multiple + /// choices. + #[serde(rename = "placeholder", skip_serializing_if = "Option::is_none")] + pub placeholder: Option, + /// Optionally pre-fill the input with an initial value. When creating a fixed choice field, + /// enable interpreting as expression and return a list to return multiple default choices. + #[serde(rename = "initial_value", skip_serializing_if = "Option::is_none")] + pub initial_value: Option, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "prompt_stages_obj")] + pub prompt_stages_obj: Vec, + #[serde(rename = "sub_text", skip_serializing_if = "Option::is_none")] + pub sub_text: Option, + #[serde( + rename = "placeholder_expression", + skip_serializing_if = "Option::is_none" + )] + pub placeholder_expression: Option, + #[serde( + rename = "initial_value_expression", + skip_serializing_if = "Option::is_none" + )] + pub initial_value_expression: Option, +} + +impl Prompt { + /// Prompt Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + field_key: String, + label: String, + r#type: models::PromptTypeEnum, + prompt_stages_obj: Vec, + ) -> Prompt { + Prompt { + pk, + name, + field_key, + label, + r#type, + required: None, + placeholder: None, + initial_value: None, + order: None, + prompt_stages_obj, + sub_text: None, + placeholder_expression: None, + initial_value_expression: None, + } + } +} diff --git a/packages/client-rust/src/models/prompt_challenge.rs b/packages/client-rust/src/models/prompt_challenge.rs new file mode 100644 index 0000000000..baf4d78714 --- /dev/null +++ b/packages/client-rust/src/models/prompt_challenge.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PromptChallenge : Initial challenge being sent, define fields +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PromptChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "fields")] + pub fields: Vec, +} + +impl PromptChallenge { + /// Initial challenge being sent, define fields + pub fn new(fields: Vec) -> PromptChallenge { + PromptChallenge { + flow_info: None, + component: None, + response_errors: None, + fields, + } + } +} diff --git a/packages/client-rust/src/models/prompt_challenge_response_request.rs b/packages/client-rust/src/models/prompt_challenge_response_request.rs new file mode 100644 index 0000000000..f9fc0f6862 --- /dev/null +++ b/packages/client-rust/src/models/prompt_challenge_response_request.rs @@ -0,0 +1,26 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PromptChallengeResponseRequest : Validate response, fields are dynamically created based on the +/// stage +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PromptChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, +} + +impl PromptChallengeResponseRequest { + /// Validate response, fields are dynamically created based on the stage + pub fn new() -> PromptChallengeResponseRequest { + PromptChallengeResponseRequest { component: None } + } +} diff --git a/packages/client-rust/src/models/prompt_choice.rs b/packages/client-rust/src/models/prompt_choice.rs new file mode 100644 index 0000000000..c0ff4bb2d6 --- /dev/null +++ b/packages/client-rust/src/models/prompt_choice.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PromptChoice : Serializer for a single Choice field +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PromptChoice { + #[serde(rename = "value")] + pub value: String, + #[serde(rename = "label")] + pub label: String, +} + +impl PromptChoice { + /// Serializer for a single Choice field + pub fn new(value: String, label: String) -> PromptChoice { + PromptChoice { value, label } + } +} diff --git a/packages/client-rust/src/models/prompt_request.rs b/packages/client-rust/src/models/prompt_request.rs new file mode 100644 index 0000000000..bd4b8ba377 --- /dev/null +++ b/packages/client-rust/src/models/prompt_request.rs @@ -0,0 +1,74 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PromptRequest : Prompt Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PromptRequest { + #[serde(rename = "name")] + pub name: String, + /// Name of the form field, also used to store the value + #[serde(rename = "field_key")] + pub field_key: String, + #[serde(rename = "label")] + pub label: String, + #[serde(rename = "type")] + pub r#type: models::PromptTypeEnum, + #[serde(rename = "required", skip_serializing_if = "Option::is_none")] + pub required: Option, + /// Optionally provide a short hint that describes the expected input value. When creating a + /// fixed choice field, enable interpreting as expression and return a list to return multiple + /// choices. + #[serde(rename = "placeholder", skip_serializing_if = "Option::is_none")] + pub placeholder: Option, + /// Optionally pre-fill the input with an initial value. When creating a fixed choice field, + /// enable interpreting as expression and return a list to return multiple default choices. + #[serde(rename = "initial_value", skip_serializing_if = "Option::is_none")] + pub initial_value: Option, + #[serde(rename = "order", skip_serializing_if = "Option::is_none")] + pub order: Option, + #[serde(rename = "sub_text", skip_serializing_if = "Option::is_none")] + pub sub_text: Option, + #[serde( + rename = "placeholder_expression", + skip_serializing_if = "Option::is_none" + )] + pub placeholder_expression: Option, + #[serde( + rename = "initial_value_expression", + skip_serializing_if = "Option::is_none" + )] + pub initial_value_expression: Option, +} + +impl PromptRequest { + /// Prompt Serializer + pub fn new( + name: String, + field_key: String, + label: String, + r#type: models::PromptTypeEnum, + ) -> PromptRequest { + PromptRequest { + name, + field_key, + label, + r#type, + required: None, + placeholder: None, + initial_value: None, + order: None, + sub_text: None, + placeholder_expression: None, + initial_value_expression: None, + } + } +} diff --git a/packages/client-rust/src/models/prompt_stage.rs b/packages/client-rust/src/models/prompt_stage.rs new file mode 100644 index 0000000000..ce3c46e19b --- /dev/null +++ b/packages/client-rust/src/models/prompt_stage.rs @@ -0,0 +1,67 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PromptStage : PromptStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PromptStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + #[serde(rename = "fields")] + pub fields: Vec, + #[serde( + rename = "validation_policies", + skip_serializing_if = "Option::is_none" + )] + pub validation_policies: Option>, +} + +impl PromptStage { + /// PromptStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + fields: Vec, + ) -> PromptStage { + PromptStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + fields, + validation_policies: None, + } + } +} diff --git a/packages/client-rust/src/models/prompt_stage_request.rs b/packages/client-rust/src/models/prompt_stage_request.rs new file mode 100644 index 0000000000..32bed7f39f --- /dev/null +++ b/packages/client-rust/src/models/prompt_stage_request.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PromptStageRequest : PromptStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PromptStageRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "fields")] + pub fields: Vec, + #[serde( + rename = "validation_policies", + skip_serializing_if = "Option::is_none" + )] + pub validation_policies: Option>, +} + +impl PromptStageRequest { + /// PromptStage Serializer + pub fn new(name: String, fields: Vec) -> PromptStageRequest { + PromptStageRequest { + name, + fields, + validation_policies: None, + } + } +} diff --git a/packages/client-rust/src/models/prompt_type_enum.rs b/packages/client-rust/src/models/prompt_type_enum.rs new file mode 100644 index 0000000000..d3fbb59b1c --- /dev/null +++ b/packages/client-rust/src/models/prompt_type_enum.rs @@ -0,0 +1,83 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum PromptTypeEnum { + #[serde(rename = "text")] + Text, + #[serde(rename = "text_area")] + TextArea, + #[serde(rename = "text_read_only")] + TextReadOnly, + #[serde(rename = "text_area_read_only")] + TextAreaReadOnly, + #[serde(rename = "username")] + Username, + #[serde(rename = "email")] + Email, + #[serde(rename = "password")] + Password, + #[serde(rename = "number")] + Number, + #[serde(rename = "checkbox")] + Checkbox, + #[serde(rename = "radio-button-group")] + RadioButtonGroup, + #[serde(rename = "dropdown")] + Dropdown, + #[serde(rename = "date")] + Date, + #[serde(rename = "date-time")] + DateTime, + #[serde(rename = "file")] + File, + #[serde(rename = "separator")] + Separator, + #[serde(rename = "hidden")] + Hidden, + #[serde(rename = "static")] + Static, + #[serde(rename = "ak-locale")] + AkLocale, +} + +impl std::fmt::Display for PromptTypeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Text => write!(f, "text"), + Self::TextArea => write!(f, "text_area"), + Self::TextReadOnly => write!(f, "text_read_only"), + Self::TextAreaReadOnly => write!(f, "text_area_read_only"), + Self::Username => write!(f, "username"), + Self::Email => write!(f, "email"), + Self::Password => write!(f, "password"), + Self::Number => write!(f, "number"), + Self::Checkbox => write!(f, "checkbox"), + Self::RadioButtonGroup => write!(f, "radio-button-group"), + Self::Dropdown => write!(f, "dropdown"), + Self::Date => write!(f, "date"), + Self::DateTime => write!(f, "date-time"), + Self::File => write!(f, "file"), + Self::Separator => write!(f, "separator"), + Self::Hidden => write!(f, "hidden"), + Self::Static => write!(f, "static"), + Self::AkLocale => write!(f, "ak-locale"), + } + } +} + +impl Default for PromptTypeEnum { + fn default() -> PromptTypeEnum { + Self::Text + } +} diff --git a/packages/client-rust/src/models/property_mapping.rs b/packages/client-rust/src/models/property_mapping.rs new file mode 100644 index 0000000000..14dfe4e339 --- /dev/null +++ b/packages/client-rust/src/models/property_mapping.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PropertyMapping : PropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PropertyMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + /// Get object's component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl PropertyMapping { + /// PropertyMapping Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + expression: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> PropertyMapping { + PropertyMapping { + pk, + managed: None, + name, + expression, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/property_mapping_preview.rs b/packages/client-rust/src/models/property_mapping_preview.rs new file mode 100644 index 0000000000..4396b33a1b --- /dev/null +++ b/packages/client-rust/src/models/property_mapping_preview.rs @@ -0,0 +1,28 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PropertyMappingPreview : Preview how the current user is mapped via the property mappings +/// selected in a provider +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PropertyMappingPreview { + #[serde(rename = "preview")] + pub preview: std::collections::HashMap, +} + +impl PropertyMappingPreview { + /// Preview how the current user is mapped via the property mappings selected in a provider + pub fn new( + preview: std::collections::HashMap, + ) -> PropertyMappingPreview { + PropertyMappingPreview { preview } + } +} diff --git a/packages/client-rust/src/models/property_mapping_test_request.rs b/packages/client-rust/src/models/property_mapping_test_request.rs new file mode 100644 index 0000000000..24529ffdbd --- /dev/null +++ b/packages/client-rust/src/models/property_mapping_test_request.rs @@ -0,0 +1,43 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PropertyMappingTestRequest : Test property mapping execution for a user/group with context +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PropertyMappingTestRequest { + #[serde( + rename = "user", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub user: Option>, + #[serde(rename = "context", skip_serializing_if = "Option::is_none")] + pub context: Option>, + #[serde( + rename = "group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub group: Option>, +} + +impl PropertyMappingTestRequest { + /// Test property mapping execution for a user/group with context + pub fn new() -> PropertyMappingTestRequest { + PropertyMappingTestRequest { + user: None, + context: None, + group: None, + } + } +} diff --git a/packages/client-rust/src/models/property_mapping_test_result.rs b/packages/client-rust/src/models/property_mapping_test_result.rs new file mode 100644 index 0000000000..ca42844e63 --- /dev/null +++ b/packages/client-rust/src/models/property_mapping_test_result.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// PropertyMappingTestResult : Result of a Property-mapping test +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PropertyMappingTestResult { + #[serde(rename = "result")] + pub result: String, + #[serde(rename = "successful")] + pub successful: bool, +} + +impl PropertyMappingTestResult { + /// Result of a Property-mapping test + pub fn new(result: String, successful: bool) -> PropertyMappingTestResult { + PropertyMappingTestResult { result, successful } + } +} diff --git a/packages/client-rust/src/models/protocol_enum.rs b/packages/client-rust/src/models/protocol_enum.rs new file mode 100644 index 0000000000..9688504653 --- /dev/null +++ b/packages/client-rust/src/models/protocol_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ProtocolEnum { + #[serde(rename = "rdp")] + Rdp, + #[serde(rename = "vnc")] + Vnc, + #[serde(rename = "ssh")] + Ssh, +} + +impl std::fmt::Display for ProtocolEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Rdp => write!(f, "rdp"), + Self::Vnc => write!(f, "vnc"), + Self::Ssh => write!(f, "ssh"), + } + } +} + +impl Default for ProtocolEnum { + fn default() -> ProtocolEnum { + Self::Rdp + } +} diff --git a/packages/client-rust/src/models/provider.rs b/packages/client-rust/src/models/provider.rs new file mode 100644 index 0000000000..dd6417b2a5 --- /dev/null +++ b/packages/client-rust/src/models/provider.rs @@ -0,0 +1,108 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Provider : Provider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Provider { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow")] + pub authorization_flow: uuid::Uuid, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow")] + pub invalidation_flow: uuid::Uuid, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_name: Option, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_backchannel_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_backchannel_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_name: Option, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl Provider { + /// Provider Serializer + pub fn new( + pk: i32, + name: String, + authorization_flow: uuid::Uuid, + invalidation_flow: uuid::Uuid, + component: String, + assigned_application_slug: Option, + assigned_application_name: Option, + assigned_backchannel_application_slug: Option, + assigned_backchannel_application_name: Option, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> Provider { + Provider { + pk, + name, + authentication_flow: None, + authorization_flow, + invalidation_flow, + property_mappings: None, + component, + assigned_application_slug, + assigned_application_name, + assigned_backchannel_application_slug, + assigned_backchannel_application_name, + verbose_name, + verbose_name_plural, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/provider_enum.rs b/packages/client-rust/src/models/provider_enum.rs new file mode 100644 index 0000000000..7403524ed2 --- /dev/null +++ b/packages/client-rust/src/models/provider_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ProviderEnum { + #[serde(rename = "twilio")] + Twilio, + #[serde(rename = "generic")] + Generic, +} + +impl std::fmt::Display for ProviderEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Twilio => write!(f, "twilio"), + Self::Generic => write!(f, "generic"), + } + } +} + +impl Default for ProviderEnum { + fn default() -> ProviderEnum { + Self::Twilio + } +} diff --git a/packages/client-rust/src/models/provider_model_enum.rs b/packages/client-rust/src/models/provider_model_enum.rs new file mode 100644 index 0000000000..fa2c65f2a8 --- /dev/null +++ b/packages/client-rust/src/models/provider_model_enum.rs @@ -0,0 +1,86 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ProviderModelEnum { + #[serde(rename = "authentik_providers_google_workspace.googleworkspaceprovider")] + AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovider, + #[serde(rename = "authentik_providers_ldap.ldapprovider")] + AuthentikProvidersLdapLdapprovider, + #[serde(rename = "authentik_providers_microsoft_entra.microsoftentraprovider")] + AuthentikProvidersMicrosoftEntraMicrosoftentraprovider, + #[serde(rename = "authentik_providers_oauth2.oauth2provider")] + AuthentikProvidersOauth2Oauth2provider, + #[serde(rename = "authentik_providers_proxy.proxyprovider")] + AuthentikProvidersProxyProxyprovider, + #[serde(rename = "authentik_providers_rac.racprovider")] + AuthentikProvidersRacRacprovider, + #[serde(rename = "authentik_providers_radius.radiusprovider")] + AuthentikProvidersRadiusRadiusprovider, + #[serde(rename = "authentik_providers_saml.samlprovider")] + AuthentikProvidersSamlSamlprovider, + #[serde(rename = "authentik_providers_scim.scimprovider")] + AuthentikProvidersScimScimprovider, + #[serde(rename = "authentik_providers_ssf.ssfprovider")] + AuthentikProvidersSsfSsfprovider, + #[serde(rename = "authentik_providers_ws_federation.wsfederationprovider")] + AuthentikProvidersWsFederationWsfederationprovider, +} + +impl std::fmt::Display for ProviderModelEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovider => write!( + f, + "authentik_providers_google_workspace.googleworkspaceprovider" + ), + Self::AuthentikProvidersLdapLdapprovider => { + write!(f, "authentik_providers_ldap.ldapprovider") + } + Self::AuthentikProvidersMicrosoftEntraMicrosoftentraprovider => write!( + f, + "authentik_providers_microsoft_entra.microsoftentraprovider" + ), + Self::AuthentikProvidersOauth2Oauth2provider => { + write!(f, "authentik_providers_oauth2.oauth2provider") + } + Self::AuthentikProvidersProxyProxyprovider => { + write!(f, "authentik_providers_proxy.proxyprovider") + } + Self::AuthentikProvidersRacRacprovider => { + write!(f, "authentik_providers_rac.racprovider") + } + Self::AuthentikProvidersRadiusRadiusprovider => { + write!(f, "authentik_providers_radius.radiusprovider") + } + Self::AuthentikProvidersSamlSamlprovider => { + write!(f, "authentik_providers_saml.samlprovider") + } + Self::AuthentikProvidersScimScimprovider => { + write!(f, "authentik_providers_scim.scimprovider") + } + Self::AuthentikProvidersSsfSsfprovider => { + write!(f, "authentik_providers_ssf.ssfprovider") + } + Self::AuthentikProvidersWsFederationWsfederationprovider => { + write!(f, "authentik_providers_ws_federation.wsfederationprovider") + } + } + } +} + +impl Default for ProviderModelEnum { + fn default() -> ProviderModelEnum { + Self::AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovider + } +} diff --git a/packages/client-rust/src/models/provider_type_enum.rs b/packages/client-rust/src/models/provider_type_enum.rs new file mode 100644 index 0000000000..d4778e880a --- /dev/null +++ b/packages/client-rust/src/models/provider_type_enum.rs @@ -0,0 +1,80 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ProviderTypeEnum { + #[serde(rename = "apple")] + Apple, + #[serde(rename = "openidconnect")] + Openidconnect, + #[serde(rename = "entraid")] + Entraid, + #[serde(rename = "azuread")] + Azuread, + #[serde(rename = "discord")] + Discord, + #[serde(rename = "facebook")] + Facebook, + #[serde(rename = "github")] + Github, + #[serde(rename = "gitlab")] + Gitlab, + #[serde(rename = "google")] + Google, + #[serde(rename = "mailcow")] + Mailcow, + #[serde(rename = "okta")] + Okta, + #[serde(rename = "patreon")] + Patreon, + #[serde(rename = "reddit")] + Reddit, + #[serde(rename = "slack")] + Slack, + #[serde(rename = "twitch")] + Twitch, + #[serde(rename = "twitter")] + Twitter, + #[serde(rename = "wechat")] + Wechat, +} + +impl std::fmt::Display for ProviderTypeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Apple => write!(f, "apple"), + Self::Openidconnect => write!(f, "openidconnect"), + Self::Entraid => write!(f, "entraid"), + Self::Azuread => write!(f, "azuread"), + Self::Discord => write!(f, "discord"), + Self::Facebook => write!(f, "facebook"), + Self::Github => write!(f, "github"), + Self::Gitlab => write!(f, "gitlab"), + Self::Google => write!(f, "google"), + Self::Mailcow => write!(f, "mailcow"), + Self::Okta => write!(f, "okta"), + Self::Patreon => write!(f, "patreon"), + Self::Reddit => write!(f, "reddit"), + Self::Slack => write!(f, "slack"), + Self::Twitch => write!(f, "twitch"), + Self::Twitter => write!(f, "twitter"), + Self::Wechat => write!(f, "wechat"), + } + } +} + +impl Default for ProviderTypeEnum { + fn default() -> ProviderTypeEnum { + Self::Apple + } +} diff --git a/packages/client-rust/src/models/proxy_mode.rs b/packages/client-rust/src/models/proxy_mode.rs new file mode 100644 index 0000000000..012dea4713 --- /dev/null +++ b/packages/client-rust/src/models/proxy_mode.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ProxyMode { + #[serde(rename = "proxy")] + Proxy, + #[serde(rename = "forward_single")] + ForwardSingle, + #[serde(rename = "forward_domain")] + ForwardDomain, +} + +impl std::fmt::Display for ProxyMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Proxy => write!(f, "proxy"), + Self::ForwardSingle => write!(f, "forward_single"), + Self::ForwardDomain => write!(f, "forward_domain"), + } + } +} + +impl Default for ProxyMode { + fn default() -> ProxyMode { + Self::Proxy + } +} diff --git a/packages/client-rust/src/models/proxy_outpost_config.rs b/packages/client-rust/src/models/proxy_outpost_config.rs new file mode 100644 index 0000000000..f12f22ff64 --- /dev/null +++ b/packages/client-rust/src/models/proxy_outpost_config.rs @@ -0,0 +1,131 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ProxyOutpostConfig : Proxy provider serializer for outposts +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ProxyOutpostConfig { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "internal_host", skip_serializing_if = "Option::is_none")] + pub internal_host: Option, + #[serde(rename = "external_host")] + pub external_host: String, + /// Validate SSL Certificates of upstream servers + #[serde( + rename = "internal_host_ssl_validation", + skip_serializing_if = "Option::is_none" + )] + pub internal_host_ssl_validation: Option, + #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] + pub client_id: Option, + #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")] + pub client_secret: Option, + #[serde(rename = "oidc_configuration")] + pub oidc_configuration: models::OpenIdConnectConfiguration, + #[serde(rename = "cookie_secret", skip_serializing_if = "Option::is_none")] + pub cookie_secret: Option, + #[serde( + rename = "certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub certificate: Option>, + /// Regular expressions for which authentication is not required. Each new line is interpreted + /// as a new Regular Expression. + #[serde(rename = "skip_path_regex", skip_serializing_if = "Option::is_none")] + pub skip_path_regex: Option, + /// Set a custom HTTP-Basic Authentication header based on values from authentik. + #[serde(rename = "basic_auth_enabled", skip_serializing_if = "Option::is_none")] + pub basic_auth_enabled: Option, + /// User/Group Attribute used for the password part of the HTTP-Basic Header. + #[serde( + rename = "basic_auth_password_attribute", + skip_serializing_if = "Option::is_none" + )] + pub basic_auth_password_attribute: Option, + /// User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the + /// user's Email address is used. + #[serde( + rename = "basic_auth_user_attribute", + skip_serializing_if = "Option::is_none" + )] + pub basic_auth_user_attribute: Option, + /// Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with + /// internal_host. + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, + #[serde(rename = "cookie_domain", skip_serializing_if = "Option::is_none")] + pub cookie_domain: Option, + /// Get token validity as second count + #[serde( + rename = "access_token_validity", + deserialize_with = "Option::deserialize" + )] + pub access_token_validity: Option, + /// When enabled, this provider will intercept the authorization header and authenticate + /// requests based on its value. + #[serde( + rename = "intercept_header_auth", + skip_serializing_if = "Option::is_none" + )] + pub intercept_header_auth: Option, + /// Get all the scope names the outpost should request, including custom-defined ones + #[serde(rename = "scopes_to_request")] + pub scopes_to_request: Vec, + /// Internal application name, used in URLs. + #[serde(rename = "assigned_application_slug")] + pub assigned_application_slug: String, + /// Application's display Name. + #[serde(rename = "assigned_application_name")] + pub assigned_application_name: String, +} + +impl ProxyOutpostConfig { + /// Proxy provider serializer for outposts + pub fn new( + pk: i32, + name: String, + external_host: String, + oidc_configuration: models::OpenIdConnectConfiguration, + access_token_validity: Option, + scopes_to_request: Vec, + assigned_application_slug: String, + assigned_application_name: String, + ) -> ProxyOutpostConfig { + ProxyOutpostConfig { + pk, + name, + internal_host: None, + external_host, + internal_host_ssl_validation: None, + client_id: None, + client_secret: None, + oidc_configuration, + cookie_secret: None, + certificate: None, + skip_path_regex: None, + basic_auth_enabled: None, + basic_auth_password_attribute: None, + basic_auth_user_attribute: None, + mode: None, + cookie_domain: None, + access_token_validity, + intercept_header_auth: None, + scopes_to_request, + assigned_application_slug, + assigned_application_name, + } + } +} diff --git a/packages/client-rust/src/models/proxy_provider.rs b/packages/client-rust/src/models/proxy_provider.rs new file mode 100644 index 0000000000..6c23d5a290 --- /dev/null +++ b/packages/client-rust/src/models/proxy_provider.rs @@ -0,0 +1,210 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ProxyProvider : ProxyProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ProxyProvider { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow")] + pub authorization_flow: uuid::Uuid, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow")] + pub invalidation_flow: uuid::Uuid, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_name: Option, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_backchannel_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_backchannel_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_name: Option, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "client_id")] + pub client_id: String, + #[serde(rename = "internal_host", skip_serializing_if = "Option::is_none")] + pub internal_host: Option, + #[serde(rename = "external_host")] + pub external_host: String, + /// Validate SSL Certificates of upstream servers + #[serde( + rename = "internal_host_ssl_validation", + skip_serializing_if = "Option::is_none" + )] + pub internal_host_ssl_validation: Option, + #[serde( + rename = "certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub certificate: Option>, + /// Regular expressions for which authentication is not required. Each new line is interpreted + /// as a new Regular Expression. + #[serde(rename = "skip_path_regex", skip_serializing_if = "Option::is_none")] + pub skip_path_regex: Option, + /// Set a custom HTTP-Basic Authentication header based on values from authentik. + #[serde(rename = "basic_auth_enabled", skip_serializing_if = "Option::is_none")] + pub basic_auth_enabled: Option, + /// User/Group Attribute used for the password part of the HTTP-Basic Header. + #[serde( + rename = "basic_auth_password_attribute", + skip_serializing_if = "Option::is_none" + )] + pub basic_auth_password_attribute: Option, + /// User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the + /// user's Email address is used. + #[serde( + rename = "basic_auth_user_attribute", + skip_serializing_if = "Option::is_none" + )] + pub basic_auth_user_attribute: Option, + /// Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with + /// internal_host. + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// When enabled, this provider will intercept the authorization header and authenticate + /// requests based on its value. + #[serde( + rename = "intercept_header_auth", + skip_serializing_if = "Option::is_none" + )] + pub intercept_header_auth: Option, + #[serde(rename = "redirect_uris")] + pub redirect_uris: Vec, + #[serde(rename = "cookie_domain", skip_serializing_if = "Option::is_none")] + pub cookie_domain: Option, + #[serde( + rename = "jwt_federation_sources", + skip_serializing_if = "Option::is_none" + )] + pub jwt_federation_sources: Option>, + #[serde( + rename = "jwt_federation_providers", + skip_serializing_if = "Option::is_none" + )] + pub jwt_federation_providers: Option>, + /// Tokens not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "access_token_validity", + skip_serializing_if = "Option::is_none" + )] + pub access_token_validity: Option, + /// Tokens not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "refresh_token_validity", + skip_serializing_if = "Option::is_none" + )] + pub refresh_token_validity: Option, + #[serde(rename = "outpost_set")] + pub outpost_set: Vec, +} + +impl ProxyProvider { + /// ProxyProvider Serializer + pub fn new( + pk: i32, + name: String, + authorization_flow: uuid::Uuid, + invalidation_flow: uuid::Uuid, + component: String, + assigned_application_slug: Option, + assigned_application_name: Option, + assigned_backchannel_application_slug: Option, + assigned_backchannel_application_name: Option, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + client_id: String, + external_host: String, + redirect_uris: Vec, + outpost_set: Vec, + ) -> ProxyProvider { + ProxyProvider { + pk, + name, + authentication_flow: None, + authorization_flow, + invalidation_flow, + property_mappings: None, + component, + assigned_application_slug, + assigned_application_name, + assigned_backchannel_application_slug, + assigned_backchannel_application_name, + verbose_name, + verbose_name_plural, + meta_model_name, + client_id, + internal_host: None, + external_host, + internal_host_ssl_validation: None, + certificate: None, + skip_path_regex: None, + basic_auth_enabled: None, + basic_auth_password_attribute: None, + basic_auth_user_attribute: None, + mode: None, + intercept_header_auth: None, + redirect_uris, + cookie_domain: None, + jwt_federation_sources: None, + jwt_federation_providers: None, + access_token_validity: None, + refresh_token_validity: None, + outpost_set, + } + } +} diff --git a/packages/client-rust/src/models/proxy_provider_request.rs b/packages/client-rust/src/models/proxy_provider_request.rs new file mode 100644 index 0000000000..d13f7c46c7 --- /dev/null +++ b/packages/client-rust/src/models/proxy_provider_request.rs @@ -0,0 +1,142 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ProxyProviderRequest : ProxyProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ProxyProviderRequest { + #[serde(rename = "name")] + pub name: String, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow")] + pub authorization_flow: uuid::Uuid, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow")] + pub invalidation_flow: uuid::Uuid, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + #[serde(rename = "internal_host", skip_serializing_if = "Option::is_none")] + pub internal_host: Option, + #[serde(rename = "external_host")] + pub external_host: String, + /// Validate SSL Certificates of upstream servers + #[serde( + rename = "internal_host_ssl_validation", + skip_serializing_if = "Option::is_none" + )] + pub internal_host_ssl_validation: Option, + #[serde( + rename = "certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub certificate: Option>, + /// Regular expressions for which authentication is not required. Each new line is interpreted + /// as a new Regular Expression. + #[serde(rename = "skip_path_regex", skip_serializing_if = "Option::is_none")] + pub skip_path_regex: Option, + /// Set a custom HTTP-Basic Authentication header based on values from authentik. + #[serde(rename = "basic_auth_enabled", skip_serializing_if = "Option::is_none")] + pub basic_auth_enabled: Option, + /// User/Group Attribute used for the password part of the HTTP-Basic Header. + #[serde( + rename = "basic_auth_password_attribute", + skip_serializing_if = "Option::is_none" + )] + pub basic_auth_password_attribute: Option, + /// User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the + /// user's Email address is used. + #[serde( + rename = "basic_auth_user_attribute", + skip_serializing_if = "Option::is_none" + )] + pub basic_auth_user_attribute: Option, + /// Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with + /// internal_host. + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// When enabled, this provider will intercept the authorization header and authenticate + /// requests based on its value. + #[serde( + rename = "intercept_header_auth", + skip_serializing_if = "Option::is_none" + )] + pub intercept_header_auth: Option, + #[serde(rename = "cookie_domain", skip_serializing_if = "Option::is_none")] + pub cookie_domain: Option, + #[serde( + rename = "jwt_federation_sources", + skip_serializing_if = "Option::is_none" + )] + pub jwt_federation_sources: Option>, + #[serde( + rename = "jwt_federation_providers", + skip_serializing_if = "Option::is_none" + )] + pub jwt_federation_providers: Option>, + /// Tokens not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "access_token_validity", + skip_serializing_if = "Option::is_none" + )] + pub access_token_validity: Option, + /// Tokens not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "refresh_token_validity", + skip_serializing_if = "Option::is_none" + )] + pub refresh_token_validity: Option, +} + +impl ProxyProviderRequest { + /// ProxyProvider Serializer + pub fn new( + name: String, + authorization_flow: uuid::Uuid, + invalidation_flow: uuid::Uuid, + external_host: String, + ) -> ProxyProviderRequest { + ProxyProviderRequest { + name, + authentication_flow: None, + authorization_flow, + invalidation_flow, + property_mappings: None, + internal_host: None, + external_host, + internal_host_ssl_validation: None, + certificate: None, + skip_path_regex: None, + basic_auth_enabled: None, + basic_auth_password_attribute: None, + basic_auth_user_attribute: None, + mode: None, + intercept_header_auth: None, + cookie_domain: None, + jwt_federation_sources: None, + jwt_federation_providers: None, + access_token_validity: None, + refresh_token_validity: None, + } + } +} diff --git a/packages/client-rust/src/models/rac_property_mapping.rs b/packages/client-rust/src/models/rac_property_mapping.rs new file mode 100644 index 0000000000..46aacbecdb --- /dev/null +++ b/packages/client-rust/src/models/rac_property_mapping.rs @@ -0,0 +1,71 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RacPropertyMapping : RACPropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RacPropertyMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, + /// Get object's component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "static_settings")] + pub static_settings: std::collections::HashMap, +} + +impl RacPropertyMapping { + /// RACPropertyMapping Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + static_settings: std::collections::HashMap, + ) -> RacPropertyMapping { + RacPropertyMapping { + pk, + managed: None, + name, + expression: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + static_settings, + } + } +} diff --git a/packages/client-rust/src/models/rac_property_mapping_request.rs b/packages/client-rust/src/models/rac_property_mapping_request.rs new file mode 100644 index 0000000000..2119ce09e2 --- /dev/null +++ b/packages/client-rust/src/models/rac_property_mapping_request.rs @@ -0,0 +1,47 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RacPropertyMappingRequest : RACPropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RacPropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, + #[serde(rename = "static_settings")] + pub static_settings: std::collections::HashMap, +} + +impl RacPropertyMappingRequest { + /// RACPropertyMapping Serializer + pub fn new( + name: String, + static_settings: std::collections::HashMap, + ) -> RacPropertyMappingRequest { + RacPropertyMappingRequest { + managed: None, + name, + expression: None, + static_settings, + } + } +} diff --git a/packages/client-rust/src/models/rac_provider.rs b/packages/client-rust/src/models/rac_provider.rs new file mode 100644 index 0000000000..7b51ae0ab9 --- /dev/null +++ b/packages/client-rust/src/models/rac_provider.rs @@ -0,0 +1,122 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RacProvider : RACProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RacProvider { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow")] + pub authorization_flow: uuid::Uuid, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_name: Option, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_backchannel_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_backchannel_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_name: Option, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "settings", skip_serializing_if = "Option::is_none")] + pub settings: Option>, + #[serde(rename = "outpost_set")] + pub outpost_set: Vec, + /// Determines how long a session lasts. Default of 0 means that the sessions lasts until the + /// browser is closed. (Format: hours=-1;minutes=-2;seconds=-3) + #[serde(rename = "connection_expiry", skip_serializing_if = "Option::is_none")] + pub connection_expiry: Option, + /// When set to true, connection tokens will be deleted upon disconnect. + #[serde( + rename = "delete_token_on_disconnect", + skip_serializing_if = "Option::is_none" + )] + pub delete_token_on_disconnect: Option, +} + +impl RacProvider { + /// RACProvider Serializer + pub fn new( + pk: i32, + name: String, + authorization_flow: uuid::Uuid, + component: String, + assigned_application_slug: Option, + assigned_application_name: Option, + assigned_backchannel_application_slug: Option, + assigned_backchannel_application_name: Option, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + outpost_set: Vec, + ) -> RacProvider { + RacProvider { + pk, + name, + authentication_flow: None, + authorization_flow, + property_mappings: None, + component, + assigned_application_slug, + assigned_application_name, + assigned_backchannel_application_slug, + assigned_backchannel_application_name, + verbose_name, + verbose_name_plural, + meta_model_name, + settings: None, + outpost_set, + connection_expiry: None, + delete_token_on_disconnect: None, + } + } +} diff --git a/packages/client-rust/src/models/rac_provider_request.rs b/packages/client-rust/src/models/rac_provider_request.rs new file mode 100644 index 0000000000..b610f7125a --- /dev/null +++ b/packages/client-rust/src/models/rac_provider_request.rs @@ -0,0 +1,59 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RacProviderRequest : RACProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RacProviderRequest { + #[serde(rename = "name")] + pub name: String, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow")] + pub authorization_flow: uuid::Uuid, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + #[serde(rename = "settings", skip_serializing_if = "Option::is_none")] + pub settings: Option>, + /// Determines how long a session lasts. Default of 0 means that the sessions lasts until the + /// browser is closed. (Format: hours=-1;minutes=-2;seconds=-3) + #[serde(rename = "connection_expiry", skip_serializing_if = "Option::is_none")] + pub connection_expiry: Option, + /// When set to true, connection tokens will be deleted upon disconnect. + #[serde( + rename = "delete_token_on_disconnect", + skip_serializing_if = "Option::is_none" + )] + pub delete_token_on_disconnect: Option, +} + +impl RacProviderRequest { + /// RACProvider Serializer + pub fn new(name: String, authorization_flow: uuid::Uuid) -> RacProviderRequest { + RacProviderRequest { + name, + authentication_flow: None, + authorization_flow, + property_mappings: None, + settings: None, + connection_expiry: None, + delete_token_on_disconnect: None, + } + } +} diff --git a/packages/client-rust/src/models/radius_check_access.rs b/packages/client-rust/src/models/radius_check_access.rs new file mode 100644 index 0000000000..65eeea2c2e --- /dev/null +++ b/packages/client-rust/src/models/radius_check_access.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RadiusCheckAccess : Base serializer class which doesn't implement create/update methods +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RadiusCheckAccess { + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option, + #[serde(rename = "access")] + pub access: models::PolicyTestResult, +} + +impl RadiusCheckAccess { + /// Base serializer class which doesn't implement create/update methods + pub fn new(access: models::PolicyTestResult) -> RadiusCheckAccess { + RadiusCheckAccess { + attributes: None, + access, + } + } +} diff --git a/packages/client-rust/src/models/radius_outpost_config.rs b/packages/client-rust/src/models/radius_outpost_config.rs new file mode 100644 index 0000000000..e1cb5e9b4b --- /dev/null +++ b/packages/client-rust/src/models/radius_outpost_config.rs @@ -0,0 +1,65 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RadiusOutpostConfig : RadiusProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RadiusOutpostConfig { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "application_slug")] + pub application_slug: String, + #[serde(rename = "auth_flow_slug")] + pub auth_flow_slug: String, + /// List of CIDRs (comma-separated) that clients can connect from. A more specific CIDR will + /// match before a looser one. Clients connecting from a non-specified CIDR will be dropped. + #[serde(rename = "client_networks", skip_serializing_if = "Option::is_none")] + pub client_networks: Option, + /// Shared secret between clients and server to hash packets. + #[serde(rename = "shared_secret", skip_serializing_if = "Option::is_none")] + pub shared_secret: Option, + /// When enabled, code-based multi-factor authentication can be used by appending a semicolon + /// and the TOTP code to the password. This should only be enabled if all users that will bind + /// to this provider have a TOTP device configured, as otherwise a password may incorrectly be + /// rejected if it contains a semicolon. + #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")] + pub mfa_support: Option, + #[serde( + rename = "certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub certificate: Option>, +} + +impl RadiusOutpostConfig { + /// RadiusProvider Serializer + pub fn new( + pk: i32, + name: String, + application_slug: String, + auth_flow_slug: String, + ) -> RadiusOutpostConfig { + RadiusOutpostConfig { + pk, + name, + application_slug, + auth_flow_slug, + client_networks: None, + shared_secret: None, + mfa_support: None, + certificate: None, + } + } +} diff --git a/packages/client-rust/src/models/radius_provider.rs b/packages/client-rust/src/models/radius_provider.rs new file mode 100644 index 0000000000..ee645e7bad --- /dev/null +++ b/packages/client-rust/src/models/radius_provider.rs @@ -0,0 +1,136 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RadiusProvider : RadiusProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RadiusProvider { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow")] + pub authorization_flow: uuid::Uuid, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow")] + pub invalidation_flow: uuid::Uuid, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_name: Option, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_backchannel_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_backchannel_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_name: Option, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// List of CIDRs (comma-separated) that clients can connect from. A more specific CIDR will + /// match before a looser one. Clients connecting from a non-specified CIDR will be dropped. + #[serde(rename = "client_networks", skip_serializing_if = "Option::is_none")] + pub client_networks: Option, + /// Shared secret between clients and server to hash packets. + #[serde(rename = "shared_secret", skip_serializing_if = "Option::is_none")] + pub shared_secret: Option, + #[serde(rename = "outpost_set")] + pub outpost_set: Vec, + /// When enabled, code-based multi-factor authentication can be used by appending a semicolon + /// and the TOTP code to the password. This should only be enabled if all users that will bind + /// to this provider have a TOTP device configured, as otherwise a password may incorrectly be + /// rejected if it contains a semicolon. + #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")] + pub mfa_support: Option, + #[serde( + rename = "certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub certificate: Option>, +} + +impl RadiusProvider { + /// RadiusProvider Serializer + pub fn new( + pk: i32, + name: String, + authorization_flow: uuid::Uuid, + invalidation_flow: uuid::Uuid, + component: String, + assigned_application_slug: Option, + assigned_application_name: Option, + assigned_backchannel_application_slug: Option, + assigned_backchannel_application_name: Option, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + outpost_set: Vec, + ) -> RadiusProvider { + RadiusProvider { + pk, + name, + authentication_flow: None, + authorization_flow, + invalidation_flow, + property_mappings: None, + component, + assigned_application_slug, + assigned_application_name, + assigned_backchannel_application_slug, + assigned_backchannel_application_name, + verbose_name, + verbose_name_plural, + meta_model_name, + client_networks: None, + shared_secret: None, + outpost_set, + mfa_support: None, + certificate: None, + } + } +} diff --git a/packages/client-rust/src/models/radius_provider_property_mapping.rs b/packages/client-rust/src/models/radius_provider_property_mapping.rs new file mode 100644 index 0000000000..2ae88dd841 --- /dev/null +++ b/packages/client-rust/src/models/radius_provider_property_mapping.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RadiusProviderPropertyMapping : RadiusProviderPropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RadiusProviderPropertyMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + /// Get object's component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl RadiusProviderPropertyMapping { + /// RadiusProviderPropertyMapping Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + expression: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> RadiusProviderPropertyMapping { + RadiusProviderPropertyMapping { + pk, + managed: None, + name, + expression, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/radius_provider_property_mapping_request.rs b/packages/client-rust/src/models/radius_provider_property_mapping_request.rs new file mode 100644 index 0000000000..40eab7201d --- /dev/null +++ b/packages/client-rust/src/models/radius_provider_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RadiusProviderPropertyMappingRequest : RadiusProviderPropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RadiusProviderPropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, +} + +impl RadiusProviderPropertyMappingRequest { + /// RadiusProviderPropertyMapping Serializer + pub fn new(name: String, expression: String) -> RadiusProviderPropertyMappingRequest { + RadiusProviderPropertyMappingRequest { + managed: None, + name, + expression, + } + } +} diff --git a/packages/client-rust/src/models/radius_provider_request.rs b/packages/client-rust/src/models/radius_provider_request.rs new file mode 100644 index 0000000000..a845077c1b --- /dev/null +++ b/packages/client-rust/src/models/radius_provider_request.rs @@ -0,0 +1,76 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RadiusProviderRequest : RadiusProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RadiusProviderRequest { + #[serde(rename = "name")] + pub name: String, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow")] + pub authorization_flow: uuid::Uuid, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow")] + pub invalidation_flow: uuid::Uuid, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// List of CIDRs (comma-separated) that clients can connect from. A more specific CIDR will + /// match before a looser one. Clients connecting from a non-specified CIDR will be dropped. + #[serde(rename = "client_networks", skip_serializing_if = "Option::is_none")] + pub client_networks: Option, + /// Shared secret between clients and server to hash packets. + #[serde(rename = "shared_secret", skip_serializing_if = "Option::is_none")] + pub shared_secret: Option, + /// When enabled, code-based multi-factor authentication can be used by appending a semicolon + /// and the TOTP code to the password. This should only be enabled if all users that will bind + /// to this provider have a TOTP device configured, as otherwise a password may incorrectly be + /// rejected if it contains a semicolon. + #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")] + pub mfa_support: Option, + #[serde( + rename = "certificate", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub certificate: Option>, +} + +impl RadiusProviderRequest { + /// RadiusProvider Serializer + pub fn new( + name: String, + authorization_flow: uuid::Uuid, + invalidation_flow: uuid::Uuid, + ) -> RadiusProviderRequest { + RadiusProviderRequest { + name, + authentication_flow: None, + authorization_flow, + invalidation_flow, + property_mappings: None, + client_networks: None, + shared_secret: None, + mfa_support: None, + certificate: None, + } + } +} diff --git a/packages/client-rust/src/models/redirect_challenge.rs b/packages/client-rust/src/models/redirect_challenge.rs new file mode 100644 index 0000000000..20bda026f6 --- /dev/null +++ b/packages/client-rust/src/models/redirect_challenge.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RedirectChallenge : Challenge type to redirect the client +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RedirectChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "to")] + pub to: String, +} + +impl RedirectChallenge { + /// Challenge type to redirect the client + pub fn new(to: String) -> RedirectChallenge { + RedirectChallenge { + flow_info: None, + component: None, + response_errors: None, + to, + } + } +} diff --git a/packages/client-rust/src/models/redirect_challenge_response_request.rs b/packages/client-rust/src/models/redirect_challenge_response_request.rs new file mode 100644 index 0000000000..0323bc9609 --- /dev/null +++ b/packages/client-rust/src/models/redirect_challenge_response_request.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RedirectChallengeResponseRequest : Redirect challenge response +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RedirectChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "to")] + pub to: String, +} + +impl RedirectChallengeResponseRequest { + /// Redirect challenge response + pub fn new(to: String) -> RedirectChallengeResponseRequest { + RedirectChallengeResponseRequest { + component: None, + to, + } + } +} diff --git a/packages/client-rust/src/models/redirect_stage.rs b/packages/client-rust/src/models/redirect_stage.rs new file mode 100644 index 0000000000..707626ba04 --- /dev/null +++ b/packages/client-rust/src/models/redirect_stage.rs @@ -0,0 +1,75 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RedirectStage : RedirectStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RedirectStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + #[serde(rename = "keep_context", skip_serializing_if = "Option::is_none")] + pub keep_context: Option, + #[serde(rename = "mode")] + pub mode: models::RedirectStageModeEnum, + #[serde(rename = "target_static", skip_serializing_if = "Option::is_none")] + pub target_static: Option, + #[serde( + rename = "target_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub target_flow: Option>, +} + +impl RedirectStage { + /// RedirectStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + mode: models::RedirectStageModeEnum, + ) -> RedirectStage { + RedirectStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + keep_context: None, + mode, + target_static: None, + target_flow: None, + } + } +} diff --git a/packages/client-rust/src/models/redirect_stage_mode_enum.rs b/packages/client-rust/src/models/redirect_stage_mode_enum.rs new file mode 100644 index 0000000000..566490a0ef --- /dev/null +++ b/packages/client-rust/src/models/redirect_stage_mode_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RedirectStageModeEnum { + #[serde(rename = "static")] + Static, + #[serde(rename = "flow")] + Flow, +} + +impl std::fmt::Display for RedirectStageModeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Static => write!(f, "static"), + Self::Flow => write!(f, "flow"), + } + } +} + +impl Default for RedirectStageModeEnum { + fn default() -> RedirectStageModeEnum { + Self::Static + } +} diff --git a/packages/client-rust/src/models/redirect_stage_request.rs b/packages/client-rust/src/models/redirect_stage_request.rs new file mode 100644 index 0000000000..a1cfa643fd --- /dev/null +++ b/packages/client-rust/src/models/redirect_stage_request.rs @@ -0,0 +1,44 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RedirectStageRequest : RedirectStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RedirectStageRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "keep_context", skip_serializing_if = "Option::is_none")] + pub keep_context: Option, + #[serde(rename = "mode")] + pub mode: models::RedirectStageModeEnum, + #[serde(rename = "target_static", skip_serializing_if = "Option::is_none")] + pub target_static: Option, + #[serde( + rename = "target_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub target_flow: Option>, +} + +impl RedirectStageRequest { + /// RedirectStage Serializer + pub fn new(name: String, mode: models::RedirectStageModeEnum) -> RedirectStageRequest { + RedirectStageRequest { + name, + keep_context: None, + mode, + target_static: None, + target_flow: None, + } + } +} diff --git a/packages/client-rust/src/models/redirect_uri.rs b/packages/client-rust/src/models/redirect_uri.rs new file mode 100644 index 0000000000..d8eb4054c6 --- /dev/null +++ b/packages/client-rust/src/models/redirect_uri.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RedirectUri : A single allowed redirect URI entry +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RedirectUri { + #[serde(rename = "matching_mode")] + pub matching_mode: models::MatchingModeEnum, + #[serde(rename = "url")] + pub url: String, +} + +impl RedirectUri { + /// A single allowed redirect URI entry + pub fn new(matching_mode: models::MatchingModeEnum, url: String) -> RedirectUri { + RedirectUri { matching_mode, url } + } +} diff --git a/packages/client-rust/src/models/redirect_uri_request.rs b/packages/client-rust/src/models/redirect_uri_request.rs new file mode 100644 index 0000000000..a08f425538 --- /dev/null +++ b/packages/client-rust/src/models/redirect_uri_request.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RedirectUriRequest : A single allowed redirect URI entry +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RedirectUriRequest { + #[serde(rename = "matching_mode")] + pub matching_mode: models::MatchingModeEnum, + #[serde(rename = "url")] + pub url: String, +} + +impl RedirectUriRequest { + /// A single allowed redirect URI entry + pub fn new(matching_mode: models::MatchingModeEnum, url: String) -> RedirectUriRequest { + RedirectUriRequest { matching_mode, url } + } +} diff --git a/packages/client-rust/src/models/related_group.rs b/packages/client-rust/src/models/related_group.rs new file mode 100644 index 0000000000..3617ee0174 --- /dev/null +++ b/packages/client-rust/src/models/related_group.rs @@ -0,0 +1,40 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RelatedGroup : Stripped down group serializer to show relevant children/parents for groups +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RelatedGroup { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Users added to this group will be superusers. + #[serde(rename = "is_superuser", skip_serializing_if = "Option::is_none")] + pub is_superuser: Option, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, + #[serde(rename = "group_uuid")] + pub group_uuid: uuid::Uuid, +} + +impl RelatedGroup { + /// Stripped down group serializer to show relevant children/parents for groups + pub fn new(pk: uuid::Uuid, name: String, group_uuid: uuid::Uuid) -> RelatedGroup { + RelatedGroup { + pk, + name, + is_superuser: None, + attributes: None, + group_uuid, + } + } +} diff --git a/packages/client-rust/src/models/reputation.rs b/packages/client-rust/src/models/reputation.rs new file mode 100644 index 0000000000..889d217037 --- /dev/null +++ b/packages/client-rust/src/models/reputation.rs @@ -0,0 +1,45 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Reputation : Reputation Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Reputation { + #[serde(rename = "pk", skip_serializing_if = "Option::is_none")] + pub pk: Option, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "ip")] + pub ip: String, + #[serde(rename = "ip_geo_data", skip_serializing_if = "Option::is_none")] + pub ip_geo_data: Option>, + #[serde(rename = "ip_asn_data", skip_serializing_if = "Option::is_none")] + pub ip_asn_data: Option>, + #[serde(rename = "score", skip_serializing_if = "Option::is_none")] + pub score: Option, + #[serde(rename = "updated")] + pub updated: String, +} + +impl Reputation { + /// Reputation Serializer + pub fn new(identifier: String, ip: String, updated: String) -> Reputation { + Reputation { + pk: None, + identifier, + ip, + ip_geo_data: None, + ip_asn_data: None, + score: None, + updated, + } + } +} diff --git a/packages/client-rust/src/models/reputation_policy.rs b/packages/client-rust/src/models/reputation_policy.rs new file mode 100644 index 0000000000..50c4aa5f8d --- /dev/null +++ b/packages/client-rust/src/models/reputation_policy.rs @@ -0,0 +1,72 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ReputationPolicy : Reputation Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ReputationPolicy { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Return objects policy is bound to + #[serde(rename = "bound_to")] + pub bound_to: i32, + #[serde(rename = "check_ip", skip_serializing_if = "Option::is_none")] + pub check_ip: Option, + #[serde(rename = "check_username", skip_serializing_if = "Option::is_none")] + pub check_username: Option, + #[serde(rename = "threshold", skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +impl ReputationPolicy { + /// Reputation Policy Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + bound_to: i32, + ) -> ReputationPolicy { + ReputationPolicy { + pk, + name, + execution_logging: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + bound_to, + check_ip: None, + check_username: None, + threshold: None, + } + } +} diff --git a/packages/client-rust/src/models/reputation_policy_request.rs b/packages/client-rust/src/models/reputation_policy_request.rs new file mode 100644 index 0000000000..a28b2971a4 --- /dev/null +++ b/packages/client-rust/src/models/reputation_policy_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ReputationPolicyRequest : Reputation Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ReputationPolicyRequest { + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + #[serde(rename = "check_ip", skip_serializing_if = "Option::is_none")] + pub check_ip: Option, + #[serde(rename = "check_username", skip_serializing_if = "Option::is_none")] + pub check_username: Option, + #[serde(rename = "threshold", skip_serializing_if = "Option::is_none")] + pub threshold: Option, +} + +impl ReputationPolicyRequest { + /// Reputation Policy Serializer + pub fn new(name: String) -> ReputationPolicyRequest { + ReputationPolicyRequest { + name, + execution_logging: None, + check_ip: None, + check_username: None, + threshold: None, + } + } +} diff --git a/packages/client-rust/src/models/resident_key_requirement_enum.rs b/packages/client-rust/src/models/resident_key_requirement_enum.rs new file mode 100644 index 0000000000..0287f52b9c --- /dev/null +++ b/packages/client-rust/src/models/resident_key_requirement_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ResidentKeyRequirementEnum { + #[serde(rename = "discouraged")] + Discouraged, + #[serde(rename = "preferred")] + Preferred, + #[serde(rename = "required")] + Required, +} + +impl std::fmt::Display for ResidentKeyRequirementEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Discouraged => write!(f, "discouraged"), + Self::Preferred => write!(f, "preferred"), + Self::Required => write!(f, "required"), + } + } +} + +impl Default for ResidentKeyRequirementEnum { + fn default() -> ResidentKeyRequirementEnum { + Self::Discouraged + } +} diff --git a/packages/client-rust/src/models/review.rs b/packages/client-rust/src/models/review.rs new file mode 100644 index 0000000000..1e32259f29 --- /dev/null +++ b/packages/client-rust/src/models/review.rs @@ -0,0 +1,50 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Review : Mixin to validate that a valid enterprise license exists before allowing to save the +/// object +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Review { + #[serde(rename = "id")] + pub id: uuid::Uuid, + #[serde(rename = "iteration")] + pub iteration: uuid::Uuid, + #[serde(rename = "reviewer")] + pub reviewer: models::ReviewerUser, + #[serde(rename = "timestamp")] + pub timestamp: String, + #[serde( + rename = "note", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub note: Option>, +} + +impl Review { + /// Mixin to validate that a valid enterprise license exists before allowing to save the object + pub fn new( + id: uuid::Uuid, + iteration: uuid::Uuid, + reviewer: models::ReviewerUser, + timestamp: String, + ) -> Review { + Review { + id, + iteration, + reviewer, + timestamp, + note: None, + } + } +} diff --git a/packages/client-rust/src/models/review_request.rs b/packages/client-rust/src/models/review_request.rs new file mode 100644 index 0000000000..7ec38166b9 --- /dev/null +++ b/packages/client-rust/src/models/review_request.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ReviewRequest : Mixin to validate that a valid enterprise license exists before allowing to save +/// the object +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ReviewRequest { + #[serde(rename = "iteration")] + pub iteration: uuid::Uuid, + #[serde( + rename = "note", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub note: Option>, +} + +impl ReviewRequest { + /// Mixin to validate that a valid enterprise license exists before allowing to save the object + pub fn new(iteration: uuid::Uuid) -> ReviewRequest { + ReviewRequest { + iteration, + note: None, + } + } +} diff --git a/packages/client-rust/src/models/reviewer_group.rs b/packages/client-rust/src/models/reviewer_group.rs new file mode 100644 index 0000000000..28dadef802 --- /dev/null +++ b/packages/client-rust/src/models/reviewer_group.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ReviewerGroup { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, +} + +impl ReviewerGroup { + pub fn new(pk: uuid::Uuid, name: String) -> ReviewerGroup { + ReviewerGroup { pk, name } + } +} diff --git a/packages/client-rust/src/models/reviewer_user.rs b/packages/client-rust/src/models/reviewer_user.rs new file mode 100644 index 0000000000..a4c69f347f --- /dev/null +++ b/packages/client-rust/src/models/reviewer_user.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ReviewerUser { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "uuid")] + pub uuid: uuid::Uuid, + /// Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + #[serde(rename = "username")] + pub username: String, + /// User's display name. + #[serde(rename = "name")] + pub name: String, +} + +impl ReviewerUser { + pub fn new(pk: i32, uuid: uuid::Uuid, username: String, name: String) -> ReviewerUser { + ReviewerUser { + pk, + uuid, + username, + name, + } + } +} diff --git a/packages/client-rust/src/models/role.rs b/packages/client-rust/src/models/role.rs new file mode 100644 index 0000000000..5323624fe1 --- /dev/null +++ b/packages/client-rust/src/models/role.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Role : Role serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Role { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, +} + +impl Role { + /// Role serializer + pub fn new(pk: uuid::Uuid, name: String) -> Role { + Role { pk, name } + } +} diff --git a/packages/client-rust/src/models/role_assigned_object_permission.rs b/packages/client-rust/src/models/role_assigned_object_permission.rs new file mode 100644 index 0000000000..3109c42460 --- /dev/null +++ b/packages/client-rust/src/models/role_assigned_object_permission.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RoleAssignedObjectPermission : Roles assigned object permission serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RoleAssignedObjectPermission { + #[serde(rename = "role_pk")] + pub role_pk: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "object_permissions")] + pub object_permissions: Vec, + #[serde(rename = "model_permissions")] + pub model_permissions: Vec, +} + +impl RoleAssignedObjectPermission { + /// Roles assigned object permission serializer + pub fn new( + role_pk: String, + name: String, + object_permissions: Vec, + model_permissions: Vec, + ) -> RoleAssignedObjectPermission { + RoleAssignedObjectPermission { + role_pk, + name, + object_permissions, + model_permissions, + } + } +} diff --git a/packages/client-rust/src/models/role_model_permission.rs b/packages/client-rust/src/models/role_model_permission.rs new file mode 100644 index 0000000000..6cf8046f43 --- /dev/null +++ b/packages/client-rust/src/models/role_model_permission.rs @@ -0,0 +1,45 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RoleModelPermission : Role-bound object level permission +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RoleModelPermission { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "codename")] + pub codename: String, + #[serde(rename = "model")] + pub model: String, + #[serde(rename = "app_label")] + pub app_label: String, + #[serde(rename = "name")] + pub name: String, +} + +impl RoleModelPermission { + /// Role-bound object level permission + pub fn new( + id: i32, + codename: String, + model: String, + app_label: String, + name: String, + ) -> RoleModelPermission { + RoleModelPermission { + id, + codename, + model, + app_label, + name, + } + } +} diff --git a/packages/client-rust/src/models/role_object_permission.rs b/packages/client-rust/src/models/role_object_permission.rs new file mode 100644 index 0000000000..ab5185fd90 --- /dev/null +++ b/packages/client-rust/src/models/role_object_permission.rs @@ -0,0 +1,49 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RoleObjectPermission : Role-bound object level permission +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RoleObjectPermission { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "codename")] + pub codename: String, + #[serde(rename = "model")] + pub model: String, + #[serde(rename = "app_label")] + pub app_label: String, + #[serde(rename = "object_pk")] + pub object_pk: String, + #[serde(rename = "name")] + pub name: String, +} + +impl RoleObjectPermission { + /// Role-bound object level permission + pub fn new( + id: i32, + codename: String, + model: String, + app_label: String, + object_pk: String, + name: String, + ) -> RoleObjectPermission { + RoleObjectPermission { + id, + codename, + model, + app_label, + object_pk, + name, + } + } +} diff --git a/packages/client-rust/src/models/role_request.rs b/packages/client-rust/src/models/role_request.rs new file mode 100644 index 0000000000..8c8c080e20 --- /dev/null +++ b/packages/client-rust/src/models/role_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// RoleRequest : Role serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct RoleRequest { + #[serde(rename = "name")] + pub name: String, +} + +impl RoleRequest { + /// Role serializer + pub fn new(name: String) -> RoleRequest { + RoleRequest { name } + } +} diff --git a/packages/client-rust/src/models/saml_bindings_enum.rs b/packages/client-rust/src/models/saml_bindings_enum.rs new file mode 100644 index 0000000000..b76af9495f --- /dev/null +++ b/packages/client-rust/src/models/saml_bindings_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum SamlBindingsEnum { + #[serde(rename = "redirect")] + Redirect, + #[serde(rename = "post")] + Post, +} + +impl std::fmt::Display for SamlBindingsEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Redirect => write!(f, "redirect"), + Self::Post => write!(f, "post"), + } + } +} + +impl Default for SamlBindingsEnum { + fn default() -> SamlBindingsEnum { + Self::Redirect + } +} diff --git a/packages/client-rust/src/models/saml_logout_methods.rs b/packages/client-rust/src/models/saml_logout_methods.rs new file mode 100644 index 0000000000..d5f6e2a3ea --- /dev/null +++ b/packages/client-rust/src/models/saml_logout_methods.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum SamlLogoutMethods { + #[serde(rename = "frontchannel_iframe")] + FrontchannelIframe, + #[serde(rename = "frontchannel_native")] + FrontchannelNative, + #[serde(rename = "backchannel")] + Backchannel, +} + +impl std::fmt::Display for SamlLogoutMethods { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::FrontchannelIframe => write!(f, "frontchannel_iframe"), + Self::FrontchannelNative => write!(f, "frontchannel_native"), + Self::Backchannel => write!(f, "backchannel"), + } + } +} + +impl Default for SamlLogoutMethods { + fn default() -> SamlLogoutMethods { + Self::FrontchannelIframe + } +} diff --git a/packages/client-rust/src/models/saml_metadata.rs b/packages/client-rust/src/models/saml_metadata.rs new file mode 100644 index 0000000000..9b7ffa0b74 --- /dev/null +++ b/packages/client-rust/src/models/saml_metadata.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SamlMetadata : SAML Provider Metadata serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SamlMetadata { + #[serde(rename = "metadata")] + pub metadata: String, + #[serde(rename = "download_url")] + pub download_url: String, +} + +impl SamlMetadata { + /// SAML Provider Metadata serializer + pub fn new(metadata: String, download_url: String) -> SamlMetadata { + SamlMetadata { + metadata, + download_url, + } + } +} diff --git a/packages/client-rust/src/models/saml_name_id_policy_enum.rs b/packages/client-rust/src/models/saml_name_id_policy_enum.rs new file mode 100644 index 0000000000..35547440ff --- /dev/null +++ b/packages/client-rust/src/models/saml_name_id_policy_enum.rs @@ -0,0 +1,47 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum SamlNameIdPolicyEnum { + #[serde(rename = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress")] + UrnColonOasisColonNamesColonTcColonSamlColon11ColonNameidFormatColonEmailAddress, + #[serde(rename = "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent")] + UrnColonOasisColonNamesColonTcColonSamlColon20ColonNameidFormatColonPersistent, + #[serde(rename = "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName")] + UrnColonOasisColonNamesColonTcColonSamlColon11ColonNameidFormatColonX509SubjectName, + #[serde(rename = "urn:oasis:names:tc:SAML:2.0:nameid-format:WindowsDomainQualifiedName")] + UrnColonOasisColonNamesColonTcColonSamlColon20ColonNameidFormatColonWindowsDomainQualifiedName, + #[serde(rename = "urn:oasis:names:tc:SAML:2.0:nameid-format:transient")] + UrnColonOasisColonNamesColonTcColonSamlColon20ColonNameidFormatColonTransient, + #[serde(rename = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified")] + UrnColonOasisColonNamesColonTcColonSamlColon11ColonNameidFormatColonUnspecified, +} + +impl std::fmt::Display for SamlNameIdPolicyEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::UrnColonOasisColonNamesColonTcColonSamlColon11ColonNameidFormatColonEmailAddress => write!(f, "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"), + Self::UrnColonOasisColonNamesColonTcColonSamlColon20ColonNameidFormatColonPersistent => write!(f, "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"), + Self::UrnColonOasisColonNamesColonTcColonSamlColon11ColonNameidFormatColonX509SubjectName => write!(f, "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName"), + Self::UrnColonOasisColonNamesColonTcColonSamlColon20ColonNameidFormatColonWindowsDomainQualifiedName => write!(f, "urn:oasis:names:tc:SAML:2.0:nameid-format:WindowsDomainQualifiedName"), + Self::UrnColonOasisColonNamesColonTcColonSamlColon20ColonNameidFormatColonTransient => write!(f, "urn:oasis:names:tc:SAML:2.0:nameid-format:transient"), + Self::UrnColonOasisColonNamesColonTcColonSamlColon11ColonNameidFormatColonUnspecified => write!(f, "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"), + } + } +} + +impl Default for SamlNameIdPolicyEnum { + fn default() -> SamlNameIdPolicyEnum { + Self::UrnColonOasisColonNamesColonTcColonSamlColon11ColonNameidFormatColonEmailAddress + } +} diff --git a/packages/client-rust/src/models/saml_property_mapping.rs b/packages/client-rust/src/models/saml_property_mapping.rs new file mode 100644 index 0000000000..83c5822f42 --- /dev/null +++ b/packages/client-rust/src/models/saml_property_mapping.rs @@ -0,0 +1,80 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SamlPropertyMapping : SAMLPropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SamlPropertyMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + /// Get object's component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "saml_name")] + pub saml_name: String, + #[serde( + rename = "friendly_name", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option>, +} + +impl SamlPropertyMapping { + /// SAMLPropertyMapping Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + expression: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + saml_name: String, + ) -> SamlPropertyMapping { + SamlPropertyMapping { + pk, + managed: None, + name, + expression, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + saml_name, + friendly_name: None, + } + } +} diff --git a/packages/client-rust/src/models/saml_property_mapping_request.rs b/packages/client-rust/src/models/saml_property_mapping_request.rs new file mode 100644 index 0000000000..bd72e535c7 --- /dev/null +++ b/packages/client-rust/src/models/saml_property_mapping_request.rs @@ -0,0 +1,52 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SamlPropertyMappingRequest : SAMLPropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SamlPropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + #[serde(rename = "saml_name")] + pub saml_name: String, + #[serde( + rename = "friendly_name", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub friendly_name: Option>, +} + +impl SamlPropertyMappingRequest { + /// SAMLPropertyMapping Serializer + pub fn new(name: String, expression: String, saml_name: String) -> SamlPropertyMappingRequest { + SamlPropertyMappingRequest { + managed: None, + name, + expression, + saml_name, + friendly_name: None, + } + } +} diff --git a/packages/client-rust/src/models/saml_provider.rs b/packages/client-rust/src/models/saml_provider.rs new file mode 100644 index 0000000000..8649bd6ccc --- /dev/null +++ b/packages/client-rust/src/models/saml_provider.rs @@ -0,0 +1,284 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SamlProvider : SAMLProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SamlProvider { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow")] + pub authorization_flow: uuid::Uuid, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow")] + pub invalidation_flow: uuid::Uuid, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_name: Option, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_backchannel_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_backchannel_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_name: Option, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "acs_url")] + pub acs_url: String, + /// Single Logout Service URL where the logout response should be sent. + #[serde(rename = "sls_url", skip_serializing_if = "Option::is_none")] + pub sls_url: Option, + /// Value of the audience restriction field of the assertion. When left empty, no audience + /// restriction will be added. + #[serde(rename = "audience", skip_serializing_if = "Option::is_none")] + pub audience: Option, + /// Also known as EntityID + #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// Assertion valid not before current time + this value (Format: + /// hours=-1;minutes=-2;seconds=-3). + #[serde( + rename = "assertion_valid_not_before", + skip_serializing_if = "Option::is_none" + )] + pub assertion_valid_not_before: Option, + /// Assertion not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "assertion_valid_not_on_or_after", + skip_serializing_if = "Option::is_none" + )] + pub assertion_valid_not_on_or_after: Option, + /// Session not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "session_valid_not_on_or_after", + skip_serializing_if = "Option::is_none" + )] + pub session_valid_not_on_or_after: Option, + /// Configure how the NameID value will be created. When left empty, the NameIDPolicy of the + /// incoming request will be considered + #[serde( + rename = "name_id_mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub name_id_mapping: Option>, + /// Configure how the AuthnContextClassRef value will be created. When left empty, the + /// AuthnContextClassRef will be set based on which authentication methods the user used to + /// authenticate. + #[serde( + rename = "authn_context_class_ref_mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authn_context_class_ref_mapping: Option>, + #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] + pub digest_algorithm: Option, + #[serde( + rename = "signature_algorithm", + skip_serializing_if = "Option::is_none" + )] + pub signature_algorithm: Option, + /// Keypair used to sign outgoing Responses going to the Service Provider. + #[serde( + rename = "signing_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub signing_kp: Option>, + /// When selected, incoming assertion's Signatures will be validated against this certificate. + /// To allow unsigned Requests, leave on default. + #[serde( + rename = "verification_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub verification_kp: Option>, + /// When selected, incoming assertions are encrypted by the IdP using the public key of the + /// encryption keypair. The assertion is decrypted by the SP using the the private key. + #[serde( + rename = "encryption_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub encryption_kp: Option>, + #[serde(rename = "sign_assertion", skip_serializing_if = "Option::is_none")] + pub sign_assertion: Option, + #[serde(rename = "sign_response", skip_serializing_if = "Option::is_none")] + pub sign_response: Option, + #[serde( + rename = "sign_logout_request", + skip_serializing_if = "Option::is_none" + )] + pub sign_logout_request: Option, + #[serde( + rename = "sign_logout_response", + skip_serializing_if = "Option::is_none" + )] + pub sign_logout_response: Option, + /// This determines how authentik sends the response back to the Service Provider. + #[serde(rename = "sp_binding", skip_serializing_if = "Option::is_none")] + pub sp_binding: Option, + /// This determines how authentik sends the logout response back to the Service Provider. + #[serde(rename = "sls_binding", skip_serializing_if = "Option::is_none")] + pub sls_binding: Option, + /// Method to use for logout. Front-channel iframe loads all logout URLs simultaneously in + /// hidden iframes. Front-channel native uses your active browser tab to send post requests and + /// redirect to providers. Back-channel sends logout requests directly from the server without + /// user interaction (requires POST SLS binding). + #[serde(rename = "logout_method", skip_serializing_if = "Option::is_none")] + pub logout_method: Option, + /// Default relay_state value for IDP-initiated logins + #[serde( + rename = "default_relay_state", + skip_serializing_if = "Option::is_none" + )] + pub default_relay_state: Option, + #[serde( + rename = "default_name_id_policy", + skip_serializing_if = "Option::is_none" + )] + pub default_name_id_policy: Option, + /// Get metadata download URL + #[serde(rename = "url_download_metadata")] + pub url_download_metadata: String, + /// Get SSO Post URL + #[serde(rename = "url_sso_post")] + pub url_sso_post: String, + /// Get SSO Redirect URL + #[serde(rename = "url_sso_redirect")] + pub url_sso_redirect: String, + /// Get SSO IDP-Initiated URL + #[serde(rename = "url_sso_init")] + pub url_sso_init: String, + /// Get SLO POST URL + #[serde(rename = "url_slo_post")] + pub url_slo_post: String, + /// Get SLO redirect URL + #[serde(rename = "url_slo_redirect")] + pub url_slo_redirect: String, +} + +impl SamlProvider { + /// SAMLProvider Serializer + pub fn new( + pk: i32, + name: String, + authorization_flow: uuid::Uuid, + invalidation_flow: uuid::Uuid, + component: String, + assigned_application_slug: Option, + assigned_application_name: Option, + assigned_backchannel_application_slug: Option, + assigned_backchannel_application_name: Option, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + acs_url: String, + url_download_metadata: String, + url_sso_post: String, + url_sso_redirect: String, + url_sso_init: String, + url_slo_post: String, + url_slo_redirect: String, + ) -> SamlProvider { + SamlProvider { + pk, + name, + authentication_flow: None, + authorization_flow, + invalidation_flow, + property_mappings: None, + component, + assigned_application_slug, + assigned_application_name, + assigned_backchannel_application_slug, + assigned_backchannel_application_name, + verbose_name, + verbose_name_plural, + meta_model_name, + acs_url, + sls_url: None, + audience: None, + issuer: None, + assertion_valid_not_before: None, + assertion_valid_not_on_or_after: None, + session_valid_not_on_or_after: None, + name_id_mapping: None, + authn_context_class_ref_mapping: None, + digest_algorithm: None, + signature_algorithm: None, + signing_kp: None, + verification_kp: None, + encryption_kp: None, + sign_assertion: None, + sign_response: None, + sign_logout_request: None, + sign_logout_response: None, + sp_binding: None, + sls_binding: None, + logout_method: None, + default_relay_state: None, + default_name_id_policy: None, + url_download_metadata, + url_sso_post, + url_sso_redirect, + url_sso_init, + url_slo_post, + url_slo_redirect, + } + } +} diff --git a/packages/client-rust/src/models/saml_provider_request.rs b/packages/client-rust/src/models/saml_provider_request.rs new file mode 100644 index 0000000000..8f943fed86 --- /dev/null +++ b/packages/client-rust/src/models/saml_provider_request.rs @@ -0,0 +1,198 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SamlProviderRequest : SAMLProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SamlProviderRequest { + #[serde(rename = "name")] + pub name: String, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow")] + pub authorization_flow: uuid::Uuid, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow")] + pub invalidation_flow: uuid::Uuid, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + #[serde(rename = "acs_url")] + pub acs_url: String, + /// Single Logout Service URL where the logout response should be sent. + #[serde(rename = "sls_url", skip_serializing_if = "Option::is_none")] + pub sls_url: Option, + /// Value of the audience restriction field of the assertion. When left empty, no audience + /// restriction will be added. + #[serde(rename = "audience", skip_serializing_if = "Option::is_none")] + pub audience: Option, + /// Also known as EntityID + #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// Assertion valid not before current time + this value (Format: + /// hours=-1;minutes=-2;seconds=-3). + #[serde( + rename = "assertion_valid_not_before", + skip_serializing_if = "Option::is_none" + )] + pub assertion_valid_not_before: Option, + /// Assertion not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "assertion_valid_not_on_or_after", + skip_serializing_if = "Option::is_none" + )] + pub assertion_valid_not_on_or_after: Option, + /// Session not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "session_valid_not_on_or_after", + skip_serializing_if = "Option::is_none" + )] + pub session_valid_not_on_or_after: Option, + /// Configure how the NameID value will be created. When left empty, the NameIDPolicy of the + /// incoming request will be considered + #[serde( + rename = "name_id_mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub name_id_mapping: Option>, + /// Configure how the AuthnContextClassRef value will be created. When left empty, the + /// AuthnContextClassRef will be set based on which authentication methods the user used to + /// authenticate. + #[serde( + rename = "authn_context_class_ref_mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authn_context_class_ref_mapping: Option>, + #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] + pub digest_algorithm: Option, + #[serde( + rename = "signature_algorithm", + skip_serializing_if = "Option::is_none" + )] + pub signature_algorithm: Option, + /// Keypair used to sign outgoing Responses going to the Service Provider. + #[serde( + rename = "signing_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub signing_kp: Option>, + /// When selected, incoming assertion's Signatures will be validated against this certificate. + /// To allow unsigned Requests, leave on default. + #[serde( + rename = "verification_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub verification_kp: Option>, + /// When selected, incoming assertions are encrypted by the IdP using the public key of the + /// encryption keypair. The assertion is decrypted by the SP using the the private key. + #[serde( + rename = "encryption_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub encryption_kp: Option>, + #[serde(rename = "sign_assertion", skip_serializing_if = "Option::is_none")] + pub sign_assertion: Option, + #[serde(rename = "sign_response", skip_serializing_if = "Option::is_none")] + pub sign_response: Option, + #[serde( + rename = "sign_logout_request", + skip_serializing_if = "Option::is_none" + )] + pub sign_logout_request: Option, + #[serde( + rename = "sign_logout_response", + skip_serializing_if = "Option::is_none" + )] + pub sign_logout_response: Option, + /// This determines how authentik sends the response back to the Service Provider. + #[serde(rename = "sp_binding", skip_serializing_if = "Option::is_none")] + pub sp_binding: Option, + /// This determines how authentik sends the logout response back to the Service Provider. + #[serde(rename = "sls_binding", skip_serializing_if = "Option::is_none")] + pub sls_binding: Option, + /// Method to use for logout. Front-channel iframe loads all logout URLs simultaneously in + /// hidden iframes. Front-channel native uses your active browser tab to send post requests and + /// redirect to providers. Back-channel sends logout requests directly from the server without + /// user interaction (requires POST SLS binding). + #[serde(rename = "logout_method", skip_serializing_if = "Option::is_none")] + pub logout_method: Option, + /// Default relay_state value for IDP-initiated logins + #[serde( + rename = "default_relay_state", + skip_serializing_if = "Option::is_none" + )] + pub default_relay_state: Option, + #[serde( + rename = "default_name_id_policy", + skip_serializing_if = "Option::is_none" + )] + pub default_name_id_policy: Option, +} + +impl SamlProviderRequest { + /// SAMLProvider Serializer + pub fn new( + name: String, + authorization_flow: uuid::Uuid, + invalidation_flow: uuid::Uuid, + acs_url: String, + ) -> SamlProviderRequest { + SamlProviderRequest { + name, + authentication_flow: None, + authorization_flow, + invalidation_flow, + property_mappings: None, + acs_url, + sls_url: None, + audience: None, + issuer: None, + assertion_valid_not_before: None, + assertion_valid_not_on_or_after: None, + session_valid_not_on_or_after: None, + name_id_mapping: None, + authn_context_class_ref_mapping: None, + digest_algorithm: None, + signature_algorithm: None, + signing_kp: None, + verification_kp: None, + encryption_kp: None, + sign_assertion: None, + sign_response: None, + sign_logout_request: None, + sign_logout_response: None, + sp_binding: None, + sls_binding: None, + logout_method: None, + default_relay_state: None, + default_name_id_policy: None, + } + } +} diff --git a/packages/client-rust/src/models/saml_source.rs b/packages/client-rust/src/models/saml_source.rs new file mode 100644 index 0000000000..34daa886bf --- /dev/null +++ b/packages/client-rust/src/models/saml_source.rs @@ -0,0 +1,224 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SamlSource : SAMLSource Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SamlSource { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Source's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal source name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde(rename = "managed", deserialize_with = "Option::deserialize")] + pub managed: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + #[serde(rename = "icon_url")] + pub icon_url: String, + #[serde(rename = "icon_themed_urls", deserialize_with = "Option::deserialize")] + pub icon_themed_urls: Option, + /// How the source determines if an existing group should be used or a new group created. + #[serde( + rename = "group_matching_mode", + skip_serializing_if = "Option::is_none" + )] + pub group_matching_mode: Option, + /// Flow used before authentication. + #[serde(rename = "pre_authentication_flow")] + pub pre_authentication_flow: uuid::Uuid, + /// Also known as Entity ID. Defaults the Metadata URL. + #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// URL that the initial Login request is sent to. + #[serde(rename = "sso_url")] + pub sso_url: String, + /// Optional URL if your IDP supports Single-Logout. + #[serde( + rename = "slo_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub slo_url: Option>, + /// Allows authentication flows initiated by the IdP. This can be a security risk, as no + /// validation of the request ID is done. + #[serde( + rename = "allow_idp_initiated", + skip_serializing_if = "Option::is_none" + )] + pub allow_idp_initiated: Option, + /// NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent. + #[serde(rename = "name_id_policy", skip_serializing_if = "Option::is_none")] + pub name_id_policy: Option, + #[serde(rename = "binding_type", skip_serializing_if = "Option::is_none")] + pub binding_type: Option, + /// When selected, incoming assertion's Signatures will be validated against this certificate. + /// To allow unsigned Requests, leave on default. + #[serde( + rename = "verification_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub verification_kp: Option>, + /// Keypair used to sign outgoing Responses going to the Identity Provider. + #[serde( + rename = "signing_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub signing_kp: Option>, + #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] + pub digest_algorithm: Option, + #[serde( + rename = "signature_algorithm", + skip_serializing_if = "Option::is_none" + )] + pub signature_algorithm: Option, + /// Time offset when temporary users should be deleted. This only applies if your IDP uses the + /// NameID Format 'transient', and the user doesn't log out manually. (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "temporary_user_delete_after", + skip_serializing_if = "Option::is_none" + )] + pub temporary_user_delete_after: Option, + /// When selected, incoming assertions are encrypted by the IdP using the public key of the + /// encryption keypair. The assertion is decrypted by the SP using the the private key. + #[serde( + rename = "encryption_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub encryption_kp: Option>, + #[serde(rename = "signed_assertion", skip_serializing_if = "Option::is_none")] + pub signed_assertion: Option, + #[serde(rename = "signed_response", skip_serializing_if = "Option::is_none")] + pub signed_response: Option, +} + +impl SamlSource { + /// SAMLSource Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + slug: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + managed: Option, + icon_url: String, + icon_themed_urls: Option, + pre_authentication_flow: uuid::Uuid, + sso_url: String, + ) -> SamlSource { + SamlSource { + pk, + name, + slug, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + policy_engine_mode: None, + user_matching_mode: None, + managed, + user_path_template: None, + icon: None, + icon_url, + icon_themed_urls, + group_matching_mode: None, + pre_authentication_flow, + issuer: None, + sso_url, + slo_url: None, + allow_idp_initiated: None, + name_id_policy: None, + binding_type: None, + verification_kp: None, + signing_kp: None, + digest_algorithm: None, + signature_algorithm: None, + temporary_user_delete_after: None, + encryption_kp: None, + signed_assertion: None, + signed_response: None, + } + } +} diff --git a/packages/client-rust/src/models/saml_source_property_mapping.rs b/packages/client-rust/src/models/saml_source_property_mapping.rs new file mode 100644 index 0000000000..ed1b109b97 --- /dev/null +++ b/packages/client-rust/src/models/saml_source_property_mapping.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SamlSourcePropertyMapping : SAMLSourcePropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SamlSourcePropertyMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + /// Get object's component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl SamlSourcePropertyMapping { + /// SAMLSourcePropertyMapping Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + expression: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> SamlSourcePropertyMapping { + SamlSourcePropertyMapping { + pk, + managed: None, + name, + expression, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/saml_source_property_mapping_request.rs b/packages/client-rust/src/models/saml_source_property_mapping_request.rs new file mode 100644 index 0000000000..7fc15156f7 --- /dev/null +++ b/packages/client-rust/src/models/saml_source_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SamlSourcePropertyMappingRequest : SAMLSourcePropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SamlSourcePropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, +} + +impl SamlSourcePropertyMappingRequest { + /// SAMLSourcePropertyMapping Serializer + pub fn new(name: String, expression: String) -> SamlSourcePropertyMappingRequest { + SamlSourcePropertyMappingRequest { + managed: None, + name, + expression, + } + } +} diff --git a/packages/client-rust/src/models/saml_source_request.rs b/packages/client-rust/src/models/saml_source_request.rs new file mode 100644 index 0000000000..499fb874d1 --- /dev/null +++ b/packages/client-rust/src/models/saml_source_request.rs @@ -0,0 +1,185 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SamlSourceRequest : SAMLSource Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SamlSourceRequest { + /// Source's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal source name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + /// How the source determines if an existing group should be used or a new group created. + #[serde( + rename = "group_matching_mode", + skip_serializing_if = "Option::is_none" + )] + pub group_matching_mode: Option, + /// Flow used before authentication. + #[serde(rename = "pre_authentication_flow")] + pub pre_authentication_flow: uuid::Uuid, + /// Also known as Entity ID. Defaults the Metadata URL. + #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// URL that the initial Login request is sent to. + #[serde(rename = "sso_url")] + pub sso_url: String, + /// Optional URL if your IDP supports Single-Logout. + #[serde( + rename = "slo_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub slo_url: Option>, + /// Allows authentication flows initiated by the IdP. This can be a security risk, as no + /// validation of the request ID is done. + #[serde( + rename = "allow_idp_initiated", + skip_serializing_if = "Option::is_none" + )] + pub allow_idp_initiated: Option, + /// NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent. + #[serde(rename = "name_id_policy", skip_serializing_if = "Option::is_none")] + pub name_id_policy: Option, + #[serde(rename = "binding_type", skip_serializing_if = "Option::is_none")] + pub binding_type: Option, + /// When selected, incoming assertion's Signatures will be validated against this certificate. + /// To allow unsigned Requests, leave on default. + #[serde( + rename = "verification_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub verification_kp: Option>, + /// Keypair used to sign outgoing Responses going to the Identity Provider. + #[serde( + rename = "signing_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub signing_kp: Option>, + #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] + pub digest_algorithm: Option, + #[serde( + rename = "signature_algorithm", + skip_serializing_if = "Option::is_none" + )] + pub signature_algorithm: Option, + /// Time offset when temporary users should be deleted. This only applies if your IDP uses the + /// NameID Format 'transient', and the user doesn't log out manually. (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "temporary_user_delete_after", + skip_serializing_if = "Option::is_none" + )] + pub temporary_user_delete_after: Option, + /// When selected, incoming assertions are encrypted by the IdP using the public key of the + /// encryption keypair. The assertion is decrypted by the SP using the the private key. + #[serde( + rename = "encryption_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub encryption_kp: Option>, + #[serde(rename = "signed_assertion", skip_serializing_if = "Option::is_none")] + pub signed_assertion: Option, + #[serde(rename = "signed_response", skip_serializing_if = "Option::is_none")] + pub signed_response: Option, +} + +impl SamlSourceRequest { + /// SAMLSource Serializer + pub fn new( + name: String, + slug: String, + pre_authentication_flow: uuid::Uuid, + sso_url: String, + ) -> SamlSourceRequest { + SamlSourceRequest { + name, + slug, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + policy_engine_mode: None, + user_matching_mode: None, + user_path_template: None, + icon: None, + group_matching_mode: None, + pre_authentication_flow, + issuer: None, + sso_url, + slo_url: None, + allow_idp_initiated: None, + name_id_policy: None, + binding_type: None, + verification_kp: None, + signing_kp: None, + digest_algorithm: None, + signature_algorithm: None, + temporary_user_delete_after: None, + encryption_kp: None, + signed_assertion: None, + signed_response: None, + } + } +} diff --git a/packages/client-rust/src/models/schedule.rs b/packages/client-rust/src/models/schedule.rs new file mode 100644 index 0000000000..77774c91b0 --- /dev/null +++ b/packages/client-rust/src/models/schedule.rs @@ -0,0 +1,78 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Schedule { + #[serde(rename = "id")] + pub id: uuid::Uuid, + /// Unique schedule identifier + #[serde(rename = "identifier", deserialize_with = "Option::deserialize")] + pub identifier: Option, + #[serde(rename = "uid")] + pub uid: String, + /// Dramatiq actor to call + #[serde(rename = "actor_name")] + pub actor_name: String, + #[serde(rename = "rel_obj_app_label")] + pub rel_obj_app_label: String, + #[serde(rename = "rel_obj_model")] + pub rel_obj_model: String, + #[serde( + rename = "rel_obj_id", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub rel_obj_id: Option>, + /// When to schedule tasks + #[serde(rename = "crontab")] + pub crontab: String, + /// Pause this schedule + #[serde(rename = "paused", skip_serializing_if = "Option::is_none")] + pub paused: Option, + #[serde(rename = "next_run")] + pub next_run: String, + #[serde(rename = "description", deserialize_with = "Option::deserialize")] + pub description: Option, + #[serde(rename = "last_task_status", deserialize_with = "Option::deserialize")] + pub last_task_status: Option, +} + +impl Schedule { + pub fn new( + id: uuid::Uuid, + identifier: Option, + uid: String, + actor_name: String, + rel_obj_app_label: String, + rel_obj_model: String, + crontab: String, + next_run: String, + description: Option, + last_task_status: Option, + ) -> Schedule { + Schedule { + id, + identifier, + uid, + actor_name, + rel_obj_app_label, + rel_obj_model, + rel_obj_id: None, + crontab, + paused: None, + next_run, + description, + last_task_status, + } + } +} diff --git a/packages/client-rust/src/models/schedule_request.rs b/packages/client-rust/src/models/schedule_request.rs new file mode 100644 index 0000000000..022e3094c6 --- /dev/null +++ b/packages/client-rust/src/models/schedule_request.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScheduleRequest { + #[serde( + rename = "rel_obj_id", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub rel_obj_id: Option>, + /// When to schedule tasks + #[serde(rename = "crontab")] + pub crontab: String, + /// Pause this schedule + #[serde(rename = "paused", skip_serializing_if = "Option::is_none")] + pub paused: Option, +} + +impl ScheduleRequest { + pub fn new(crontab: String) -> ScheduleRequest { + ScheduleRequest { + rel_obj_id: None, + crontab, + paused: None, + } + } +} diff --git a/packages/client-rust/src/models/scim_authentication_mode_enum.rs b/packages/client-rust/src/models/scim_authentication_mode_enum.rs new file mode 100644 index 0000000000..37dbf08062 --- /dev/null +++ b/packages/client-rust/src/models/scim_authentication_mode_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ScimAuthenticationModeEnum { + #[serde(rename = "token")] + Token, + #[serde(rename = "oauth")] + Oauth, +} + +impl std::fmt::Display for ScimAuthenticationModeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Token => write!(f, "token"), + Self::Oauth => write!(f, "oauth"), + } + } +} + +impl Default for ScimAuthenticationModeEnum { + fn default() -> ScimAuthenticationModeEnum { + Self::Token + } +} diff --git a/packages/client-rust/src/models/scim_mapping.rs b/packages/client-rust/src/models/scim_mapping.rs new file mode 100644 index 0000000000..018fbcff9a --- /dev/null +++ b/packages/client-rust/src/models/scim_mapping.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimMapping : SCIMMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + /// Get object's component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl ScimMapping { + /// SCIMMapping Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + expression: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> ScimMapping { + ScimMapping { + pk, + managed: None, + name, + expression, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/scim_mapping_request.rs b/packages/client-rust/src/models/scim_mapping_request.rs new file mode 100644 index 0000000000..aafe0a3603 --- /dev/null +++ b/packages/client-rust/src/models/scim_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimMappingRequest : SCIMMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, +} + +impl ScimMappingRequest { + /// SCIMMapping Serializer + pub fn new(name: String, expression: String) -> ScimMappingRequest { + ScimMappingRequest { + managed: None, + name, + expression, + } + } +} diff --git a/packages/client-rust/src/models/scim_provider.rs b/packages/client-rust/src/models/scim_provider.rs new file mode 100644 index 0000000000..78da7926b7 --- /dev/null +++ b/packages/client-rust/src/models/scim_provider.rs @@ -0,0 +1,143 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimProvider : SCIMProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimProvider { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Property mappings used for group creation/updating. + #[serde( + rename = "property_mappings_group", + skip_serializing_if = "Option::is_none" + )] + pub property_mappings_group: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_backchannel_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_backchannel_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_name: Option, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Base URL to SCIM requests, usually ends in /v2 + #[serde(rename = "url")] + pub url: String, + #[serde( + rename = "verify_certificates", + skip_serializing_if = "Option::is_none" + )] + pub verify_certificates: Option, + /// Authentication token + #[serde(rename = "token", skip_serializing_if = "Option::is_none")] + pub token: Option, + #[serde(rename = "auth_mode", skip_serializing_if = "Option::is_none")] + pub auth_mode: Option, + /// OAuth Source used for authentication + #[serde( + rename = "auth_oauth", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub auth_oauth: Option>, + /// Additional OAuth parameters, such as grant_type + #[serde(rename = "auth_oauth_params", skip_serializing_if = "Option::is_none")] + pub auth_oauth_params: Option>, + /// Alter authentik behavior for vendor-specific SCIM implementations. + #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")] + pub compatibility_mode: Option, + /// Cache duration for ServiceProviderConfig responses. Set minutes=0 to disable. + #[serde( + rename = "service_provider_config_cache_timeout", + skip_serializing_if = "Option::is_none" + )] + pub service_provider_config_cache_timeout: Option, + #[serde( + rename = "exclude_users_service_account", + skip_serializing_if = "Option::is_none" + )] + pub exclude_users_service_account: Option, + /// Controls the number of objects synced in a single task + #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] + pub sync_page_size: Option, + /// Timeout for synchronization of a single page + #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] + pub sync_page_timeout: Option, + /// Group filters used to define sync-scope for groups. + #[serde(rename = "group_filters", skip_serializing_if = "Option::is_none")] + pub group_filters: Option>, + /// When enabled, provider will not modify or create objects in the remote system. + #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] + pub dry_run: Option, +} + +impl ScimProvider { + /// SCIMProvider Serializer + pub fn new( + pk: i32, + name: String, + component: String, + assigned_backchannel_application_slug: Option, + assigned_backchannel_application_name: Option, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + url: String, + ) -> ScimProvider { + ScimProvider { + pk, + name, + property_mappings: None, + property_mappings_group: None, + component, + assigned_backchannel_application_slug, + assigned_backchannel_application_name, + verbose_name, + verbose_name_plural, + meta_model_name, + url, + verify_certificates: None, + token: None, + auth_mode: None, + auth_oauth: None, + auth_oauth_params: None, + compatibility_mode: None, + service_provider_config_cache_timeout: None, + exclude_users_service_account: None, + sync_page_size: None, + sync_page_timeout: None, + group_filters: None, + dry_run: None, + } + } +} diff --git a/packages/client-rust/src/models/scim_provider_group.rs b/packages/client-rust/src/models/scim_provider_group.rs new file mode 100644 index 0000000000..831107dd69 --- /dev/null +++ b/packages/client-rust/src/models/scim_provider_group.rs @@ -0,0 +1,49 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimProviderGroup : SCIMProviderGroup Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimProviderGroup { + #[serde(rename = "id")] + pub id: uuid::Uuid, + #[serde(rename = "scim_id")] + pub scim_id: String, + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "group_obj")] + pub group_obj: models::PartialGroup, + #[serde(rename = "provider")] + pub provider: i32, + #[serde(rename = "attributes")] + pub attributes: std::collections::HashMap, +} + +impl ScimProviderGroup { + /// SCIMProviderGroup Serializer + pub fn new( + id: uuid::Uuid, + scim_id: String, + group: uuid::Uuid, + group_obj: models::PartialGroup, + provider: i32, + attributes: std::collections::HashMap, + ) -> ScimProviderGroup { + ScimProviderGroup { + id, + scim_id, + group, + group_obj, + provider, + attributes, + } + } +} diff --git a/packages/client-rust/src/models/scim_provider_group_request.rs b/packages/client-rust/src/models/scim_provider_group_request.rs new file mode 100644 index 0000000000..362a7c37b3 --- /dev/null +++ b/packages/client-rust/src/models/scim_provider_group_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimProviderGroupRequest : SCIMProviderGroup Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimProviderGroupRequest { + #[serde(rename = "scim_id")] + pub scim_id: String, + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "provider")] + pub provider: i32, +} + +impl ScimProviderGroupRequest { + /// SCIMProviderGroup Serializer + pub fn new(scim_id: String, group: uuid::Uuid, provider: i32) -> ScimProviderGroupRequest { + ScimProviderGroupRequest { + scim_id, + group, + provider, + } + } +} diff --git a/packages/client-rust/src/models/scim_provider_request.rs b/packages/client-rust/src/models/scim_provider_request.rs new file mode 100644 index 0000000000..0d206dcf4f --- /dev/null +++ b/packages/client-rust/src/models/scim_provider_request.rs @@ -0,0 +1,100 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimProviderRequest : SCIMProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimProviderRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Property mappings used for group creation/updating. + #[serde( + rename = "property_mappings_group", + skip_serializing_if = "Option::is_none" + )] + pub property_mappings_group: Option>, + /// Base URL to SCIM requests, usually ends in /v2 + #[serde(rename = "url")] + pub url: String, + #[serde( + rename = "verify_certificates", + skip_serializing_if = "Option::is_none" + )] + pub verify_certificates: Option, + /// Authentication token + #[serde(rename = "token", skip_serializing_if = "Option::is_none")] + pub token: Option, + #[serde(rename = "auth_mode", skip_serializing_if = "Option::is_none")] + pub auth_mode: Option, + /// OAuth Source used for authentication + #[serde( + rename = "auth_oauth", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub auth_oauth: Option>, + /// Additional OAuth parameters, such as grant_type + #[serde(rename = "auth_oauth_params", skip_serializing_if = "Option::is_none")] + pub auth_oauth_params: Option>, + /// Alter authentik behavior for vendor-specific SCIM implementations. + #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")] + pub compatibility_mode: Option, + /// Cache duration for ServiceProviderConfig responses. Set minutes=0 to disable. + #[serde( + rename = "service_provider_config_cache_timeout", + skip_serializing_if = "Option::is_none" + )] + pub service_provider_config_cache_timeout: Option, + #[serde( + rename = "exclude_users_service_account", + skip_serializing_if = "Option::is_none" + )] + pub exclude_users_service_account: Option, + /// Controls the number of objects synced in a single task + #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] + pub sync_page_size: Option, + /// Timeout for synchronization of a single page + #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] + pub sync_page_timeout: Option, + /// Group filters used to define sync-scope for groups. + #[serde(rename = "group_filters", skip_serializing_if = "Option::is_none")] + pub group_filters: Option>, + /// When enabled, provider will not modify or create objects in the remote system. + #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] + pub dry_run: Option, +} + +impl ScimProviderRequest { + /// SCIMProvider Serializer + pub fn new(name: String, url: String) -> ScimProviderRequest { + ScimProviderRequest { + name, + property_mappings: None, + property_mappings_group: None, + url, + verify_certificates: None, + token: None, + auth_mode: None, + auth_oauth: None, + auth_oauth_params: None, + compatibility_mode: None, + service_provider_config_cache_timeout: None, + exclude_users_service_account: None, + sync_page_size: None, + sync_page_timeout: None, + group_filters: None, + dry_run: None, + } + } +} diff --git a/packages/client-rust/src/models/scim_provider_user.rs b/packages/client-rust/src/models/scim_provider_user.rs new file mode 100644 index 0000000000..98cc6bad7e --- /dev/null +++ b/packages/client-rust/src/models/scim_provider_user.rs @@ -0,0 +1,49 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimProviderUser : SCIMProviderUser Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimProviderUser { + #[serde(rename = "id")] + pub id: uuid::Uuid, + #[serde(rename = "scim_id")] + pub scim_id: String, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "user_obj")] + pub user_obj: models::PartialUser, + #[serde(rename = "provider")] + pub provider: i32, + #[serde(rename = "attributes")] + pub attributes: std::collections::HashMap, +} + +impl ScimProviderUser { + /// SCIMProviderUser Serializer + pub fn new( + id: uuid::Uuid, + scim_id: String, + user: i32, + user_obj: models::PartialUser, + provider: i32, + attributes: std::collections::HashMap, + ) -> ScimProviderUser { + ScimProviderUser { + id, + scim_id, + user, + user_obj, + provider, + attributes, + } + } +} diff --git a/packages/client-rust/src/models/scim_provider_user_request.rs b/packages/client-rust/src/models/scim_provider_user_request.rs new file mode 100644 index 0000000000..8cb904ac29 --- /dev/null +++ b/packages/client-rust/src/models/scim_provider_user_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimProviderUserRequest : SCIMProviderUser Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimProviderUserRequest { + #[serde(rename = "scim_id")] + pub scim_id: String, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "provider")] + pub provider: i32, +} + +impl ScimProviderUserRequest { + /// SCIMProviderUser Serializer + pub fn new(scim_id: String, user: i32, provider: i32) -> ScimProviderUserRequest { + ScimProviderUserRequest { + scim_id, + user, + provider, + } + } +} diff --git a/packages/client-rust/src/models/scim_source.rs b/packages/client-rust/src/models/scim_source.rs new file mode 100644 index 0000000000..417e9c2b6a --- /dev/null +++ b/packages/client-rust/src/models/scim_source.rs @@ -0,0 +1,93 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimSource : SCIMSource Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimSource { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Source's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal source name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde(rename = "managed", deserialize_with = "Option::deserialize")] + pub managed: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + /// Get Root URL + #[serde(rename = "root_url")] + pub root_url: String, + #[serde(rename = "token_obj")] + pub token_obj: models::Token, +} + +impl ScimSource { + /// SCIMSource Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + slug: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + managed: Option, + root_url: String, + token_obj: models::Token, + ) -> ScimSource { + ScimSource { + pk, + name, + slug, + enabled: None, + user_property_mappings: None, + group_property_mappings: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + managed, + user_path_template: None, + root_url, + token_obj, + } + } +} diff --git a/packages/client-rust/src/models/scim_source_group.rs b/packages/client-rust/src/models/scim_source_group.rs new file mode 100644 index 0000000000..f821e350ef --- /dev/null +++ b/packages/client-rust/src/models/scim_source_group.rs @@ -0,0 +1,47 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimSourceGroup : SCIMSourceGroup Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimSourceGroup { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "external_id")] + pub external_id: String, + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "group_obj")] + pub group_obj: models::PartialGroup, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl ScimSourceGroup { + /// SCIMSourceGroup Serializer + pub fn new( + external_id: String, + group: uuid::Uuid, + group_obj: models::PartialGroup, + source: uuid::Uuid, + ) -> ScimSourceGroup { + ScimSourceGroup { + id: None, + external_id, + group, + group_obj, + source, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/scim_source_group_request.rs b/packages/client-rust/src/models/scim_source_group_request.rs new file mode 100644 index 0000000000..1ed9cebaae --- /dev/null +++ b/packages/client-rust/src/models/scim_source_group_request.rs @@ -0,0 +1,43 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimSourceGroupRequest : SCIMSourceGroup Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimSourceGroupRequest { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "external_id")] + pub external_id: String, + #[serde(rename = "group")] + pub group: uuid::Uuid, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl ScimSourceGroupRequest { + /// SCIMSourceGroup Serializer + pub fn new( + external_id: String, + group: uuid::Uuid, + source: uuid::Uuid, + ) -> ScimSourceGroupRequest { + ScimSourceGroupRequest { + id: None, + external_id, + group, + source, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/scim_source_property_mapping.rs b/packages/client-rust/src/models/scim_source_property_mapping.rs new file mode 100644 index 0000000000..2fca1c50d7 --- /dev/null +++ b/packages/client-rust/src/models/scim_source_property_mapping.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimSourcePropertyMapping : SCIMSourcePropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimSourcePropertyMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + /// Get object's component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl ScimSourcePropertyMapping { + /// SCIMSourcePropertyMapping Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + expression: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> ScimSourcePropertyMapping { + ScimSourcePropertyMapping { + pk, + managed: None, + name, + expression, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/scim_source_property_mapping_request.rs b/packages/client-rust/src/models/scim_source_property_mapping_request.rs new file mode 100644 index 0000000000..0a87386847 --- /dev/null +++ b/packages/client-rust/src/models/scim_source_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimSourcePropertyMappingRequest : SCIMSourcePropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimSourcePropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, +} + +impl ScimSourcePropertyMappingRequest { + /// SCIMSourcePropertyMapping Serializer + pub fn new(name: String, expression: String) -> ScimSourcePropertyMappingRequest { + ScimSourcePropertyMappingRequest { + managed: None, + name, + expression, + } + } +} diff --git a/packages/client-rust/src/models/scim_source_request.rs b/packages/client-rust/src/models/scim_source_request.rs new file mode 100644 index 0000000000..875e685de2 --- /dev/null +++ b/packages/client-rust/src/models/scim_source_request.rs @@ -0,0 +1,50 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimSourceRequest : SCIMSource Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimSourceRequest { + /// Source's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal source name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, +} + +impl ScimSourceRequest { + /// SCIMSource Serializer + pub fn new(name: String, slug: String) -> ScimSourceRequest { + ScimSourceRequest { + name, + slug, + enabled: None, + user_property_mappings: None, + group_property_mappings: None, + user_path_template: None, + } + } +} diff --git a/packages/client-rust/src/models/scim_source_user.rs b/packages/client-rust/src/models/scim_source_user.rs new file mode 100644 index 0000000000..4de23363e2 --- /dev/null +++ b/packages/client-rust/src/models/scim_source_user.rs @@ -0,0 +1,47 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimSourceUser : SCIMSourceUser Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimSourceUser { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "external_id")] + pub external_id: String, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "user_obj")] + pub user_obj: models::PartialUser, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl ScimSourceUser { + /// SCIMSourceUser Serializer + pub fn new( + external_id: String, + user: i32, + user_obj: models::PartialUser, + source: uuid::Uuid, + ) -> ScimSourceUser { + ScimSourceUser { + id: None, + external_id, + user, + user_obj, + source, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/scim_source_user_request.rs b/packages/client-rust/src/models/scim_source_user_request.rs new file mode 100644 index 0000000000..de2e8b61f8 --- /dev/null +++ b/packages/client-rust/src/models/scim_source_user_request.rs @@ -0,0 +1,39 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScimSourceUserRequest : SCIMSourceUser Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScimSourceUserRequest { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "external_id")] + pub external_id: String, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, +} + +impl ScimSourceUserRequest { + /// SCIMSourceUser Serializer + pub fn new(external_id: String, user: i32, source: uuid::Uuid) -> ScimSourceUserRequest { + ScimSourceUserRequest { + id: None, + external_id, + user, + source, + attributes: None, + } + } +} diff --git a/packages/client-rust/src/models/scope_mapping.rs b/packages/client-rust/src/models/scope_mapping.rs new file mode 100644 index 0000000000..0760a4df45 --- /dev/null +++ b/packages/client-rust/src/models/scope_mapping.rs @@ -0,0 +1,77 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScopeMapping : ScopeMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScopeMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + /// Get object's component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Scope name requested by the client + #[serde(rename = "scope_name")] + pub scope_name: String, + /// Description shown to the user when consenting. If left empty, the user won't be informed. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, +} + +impl ScopeMapping { + /// ScopeMapping Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + expression: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + scope_name: String, + ) -> ScopeMapping { + ScopeMapping { + pk, + managed: None, + name, + expression, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + scope_name, + description: None, + } + } +} diff --git a/packages/client-rust/src/models/scope_mapping_request.rs b/packages/client-rust/src/models/scope_mapping_request.rs new file mode 100644 index 0000000000..aa68047eb7 --- /dev/null +++ b/packages/client-rust/src/models/scope_mapping_request.rs @@ -0,0 +1,49 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ScopeMappingRequest : ScopeMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ScopeMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + /// Scope name requested by the client + #[serde(rename = "scope_name")] + pub scope_name: String, + /// Description shown to the user when consenting. If left empty, the user won't be informed. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, +} + +impl ScopeMappingRequest { + /// ScopeMapping Serializer + pub fn new(name: String, expression: String, scope_name: String) -> ScopeMappingRequest { + ScopeMappingRequest { + managed: None, + name, + expression, + scope_name, + description: None, + } + } +} diff --git a/packages/client-rust/src/models/selectable_stage.rs b/packages/client-rust/src/models/selectable_stage.rs new file mode 100644 index 0000000000..acba667b03 --- /dev/null +++ b/packages/client-rust/src/models/selectable_stage.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SelectableStage : Serializer for stages which can be selected by users +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SelectableStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "verbose_name")] + pub verbose_name: String, + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl SelectableStage { + /// Serializer for stages which can be selected by users + pub fn new( + pk: uuid::Uuid, + name: String, + verbose_name: String, + meta_model_name: String, + ) -> SelectableStage { + SelectableStage { + pk, + name, + verbose_name, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/service_connection.rs b/packages/client-rust/src/models/service_connection.rs new file mode 100644 index 0000000000..6677af9f74 --- /dev/null +++ b/packages/client-rust/src/models/service_connection.rs @@ -0,0 +1,57 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ServiceConnection : ServiceConnection Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServiceConnection { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// If enabled, use the local connection. Required Docker socket/Kubernetes Integration + #[serde(rename = "local", skip_serializing_if = "Option::is_none")] + pub local: Option, + /// Return component used to edit this object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl ServiceConnection { + /// ServiceConnection Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> ServiceConnection { + ServiceConnection { + pk, + name, + local: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/service_connection_state.rs b/packages/client-rust/src/models/service_connection_state.rs new file mode 100644 index 0000000000..356898be5d --- /dev/null +++ b/packages/client-rust/src/models/service_connection_state.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ServiceConnectionState : Serializer for Service connection state +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServiceConnectionState { + #[serde(rename = "healthy")] + pub healthy: bool, + #[serde(rename = "version")] + pub version: String, +} + +impl ServiceConnectionState { + /// Serializer for Service connection state + pub fn new(healthy: bool, version: String) -> ServiceConnectionState { + ServiceConnectionState { healthy, version } + } +} diff --git a/packages/client-rust/src/models/session_end_challenge.rs b/packages/client-rust/src/models/session_end_challenge.rs new file mode 100644 index 0000000000..439ffe5e6f --- /dev/null +++ b/packages/client-rust/src/models/session_end_challenge.rs @@ -0,0 +1,61 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SessionEndChallenge : Challenge for ending a session +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SessionEndChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "pending_user")] + pub pending_user: String, + #[serde(rename = "pending_user_avatar")] + pub pending_user_avatar: String, + #[serde(rename = "application_name", skip_serializing_if = "Option::is_none")] + pub application_name: Option, + #[serde( + rename = "application_launch_url", + skip_serializing_if = "Option::is_none" + )] + pub application_launch_url: Option, + #[serde( + rename = "invalidation_flow_url", + skip_serializing_if = "Option::is_none" + )] + pub invalidation_flow_url: Option, + #[serde(rename = "brand_name")] + pub brand_name: String, +} + +impl SessionEndChallenge { + /// Challenge for ending a session + pub fn new( + pending_user: String, + pending_user_avatar: String, + brand_name: String, + ) -> SessionEndChallenge { + SessionEndChallenge { + flow_info: None, + component: None, + response_errors: None, + pending_user, + pending_user_avatar, + application_name: None, + application_launch_url: None, + invalidation_flow_url: None, + brand_name, + } + } +} diff --git a/packages/client-rust/src/models/session_user.rs b/packages/client-rust/src/models/session_user.rs new file mode 100644 index 0000000000..6363a4ece5 --- /dev/null +++ b/packages/client-rust/src/models/session_user.rs @@ -0,0 +1,32 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SessionUser : Response for the /user/me endpoint, returns the currently active user (as `user` +/// property) and, if this user is being impersonated, the original user in the `original` property. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SessionUser { + #[serde(rename = "user")] + pub user: models::UserSelf, + #[serde(rename = "original", skip_serializing_if = "Option::is_none")] + pub original: Option, +} + +impl SessionUser { + /// Response for the /user/me endpoint, returns the currently active user (as `user` property) + /// and, if this user is being impersonated, the original user in the `original` property. + pub fn new(user: models::UserSelf) -> SessionUser { + SessionUser { + user, + original: None, + } + } +} diff --git a/packages/client-rust/src/models/settings.rs b/packages/client-rust/src/models/settings.rs new file mode 100644 index 0000000000..3a08eff6e0 --- /dev/null +++ b/packages/client-rust/src/models/settings.rs @@ -0,0 +1,121 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Settings : Settings Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Settings { + /// Configure how authentik should show avatars for users. + #[serde(rename = "avatars", skip_serializing_if = "Option::is_none")] + pub avatars: Option, + /// Enable the ability for users to change their name. + #[serde( + rename = "default_user_change_name", + skip_serializing_if = "Option::is_none" + )] + pub default_user_change_name: Option, + /// Enable the ability for users to change their email address. + #[serde( + rename = "default_user_change_email", + skip_serializing_if = "Option::is_none" + )] + pub default_user_change_email: Option, + /// Enable the ability for users to change their username. + #[serde( + rename = "default_user_change_username", + skip_serializing_if = "Option::is_none" + )] + pub default_user_change_username: Option, + /// Events will be deleted after this duration.(Format: weeks=3;days=2;hours=3,seconds=2). + #[serde(rename = "event_retention", skip_serializing_if = "Option::is_none")] + pub event_retention: Option, + /// Reputation cannot decrease lower than this value. Zero or negative. + #[serde( + rename = "reputation_lower_limit", + skip_serializing_if = "Option::is_none" + )] + pub reputation_lower_limit: Option, + /// Reputation cannot increase higher than this value. Zero or positive. + #[serde( + rename = "reputation_upper_limit", + skip_serializing_if = "Option::is_none" + )] + pub reputation_upper_limit: Option, + #[serde( + rename = "footer_links", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub footer_links: Option>, + /// When enabled, all the events caused by a user will be deleted upon the user's deletion. + #[serde(rename = "gdpr_compliance", skip_serializing_if = "Option::is_none")] + pub gdpr_compliance: Option, + /// Globally enable/disable impersonation. + #[serde(rename = "impersonation", skip_serializing_if = "Option::is_none")] + pub impersonation: Option, + /// Require administrators to provide a reason for impersonating a user. + #[serde( + rename = "impersonation_require_reason", + skip_serializing_if = "Option::is_none" + )] + pub impersonation_require_reason: Option, + /// Default token duration + #[serde( + rename = "default_token_duration", + skip_serializing_if = "Option::is_none" + )] + pub default_token_duration: Option, + /// Default token length + #[serde( + rename = "default_token_length", + skip_serializing_if = "Option::is_none" + )] + pub default_token_length: Option, + /// Default page size for API responses, if no size was requested. + #[serde( + rename = "pagination_default_page_size", + skip_serializing_if = "Option::is_none" + )] + pub pagination_default_page_size: Option, + /// Maximum page size + #[serde( + rename = "pagination_max_page_size", + skip_serializing_if = "Option::is_none" + )] + pub pagination_max_page_size: Option, + #[serde(rename = "flags")] + pub flags: models::PatchedSettingsRequestFlags, +} + +impl Settings { + /// Settings Serializer + pub fn new(flags: models::PatchedSettingsRequestFlags) -> Settings { + Settings { + avatars: None, + default_user_change_name: None, + default_user_change_email: None, + default_user_change_username: None, + event_retention: None, + reputation_lower_limit: None, + reputation_upper_limit: None, + footer_links: None, + gdpr_compliance: None, + impersonation: None, + impersonation_require_reason: None, + default_token_duration: None, + default_token_length: None, + pagination_default_page_size: None, + pagination_max_page_size: None, + flags, + } + } +} diff --git a/packages/client-rust/src/models/settings_request.rs b/packages/client-rust/src/models/settings_request.rs new file mode 100644 index 0000000000..11bd9e963a --- /dev/null +++ b/packages/client-rust/src/models/settings_request.rs @@ -0,0 +1,121 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SettingsRequest : Settings Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SettingsRequest { + /// Configure how authentik should show avatars for users. + #[serde(rename = "avatars", skip_serializing_if = "Option::is_none")] + pub avatars: Option, + /// Enable the ability for users to change their name. + #[serde( + rename = "default_user_change_name", + skip_serializing_if = "Option::is_none" + )] + pub default_user_change_name: Option, + /// Enable the ability for users to change their email address. + #[serde( + rename = "default_user_change_email", + skip_serializing_if = "Option::is_none" + )] + pub default_user_change_email: Option, + /// Enable the ability for users to change their username. + #[serde( + rename = "default_user_change_username", + skip_serializing_if = "Option::is_none" + )] + pub default_user_change_username: Option, + /// Events will be deleted after this duration.(Format: weeks=3;days=2;hours=3,seconds=2). + #[serde(rename = "event_retention", skip_serializing_if = "Option::is_none")] + pub event_retention: Option, + /// Reputation cannot decrease lower than this value. Zero or negative. + #[serde( + rename = "reputation_lower_limit", + skip_serializing_if = "Option::is_none" + )] + pub reputation_lower_limit: Option, + /// Reputation cannot increase higher than this value. Zero or positive. + #[serde( + rename = "reputation_upper_limit", + skip_serializing_if = "Option::is_none" + )] + pub reputation_upper_limit: Option, + #[serde( + rename = "footer_links", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub footer_links: Option>, + /// When enabled, all the events caused by a user will be deleted upon the user's deletion. + #[serde(rename = "gdpr_compliance", skip_serializing_if = "Option::is_none")] + pub gdpr_compliance: Option, + /// Globally enable/disable impersonation. + #[serde(rename = "impersonation", skip_serializing_if = "Option::is_none")] + pub impersonation: Option, + /// Require administrators to provide a reason for impersonating a user. + #[serde( + rename = "impersonation_require_reason", + skip_serializing_if = "Option::is_none" + )] + pub impersonation_require_reason: Option, + /// Default token duration + #[serde( + rename = "default_token_duration", + skip_serializing_if = "Option::is_none" + )] + pub default_token_duration: Option, + /// Default token length + #[serde( + rename = "default_token_length", + skip_serializing_if = "Option::is_none" + )] + pub default_token_length: Option, + /// Default page size for API responses, if no size was requested. + #[serde( + rename = "pagination_default_page_size", + skip_serializing_if = "Option::is_none" + )] + pub pagination_default_page_size: Option, + /// Maximum page size + #[serde( + rename = "pagination_max_page_size", + skip_serializing_if = "Option::is_none" + )] + pub pagination_max_page_size: Option, + #[serde(rename = "flags")] + pub flags: models::PatchedSettingsRequestFlags, +} + +impl SettingsRequest { + /// Settings Serializer + pub fn new(flags: models::PatchedSettingsRequestFlags) -> SettingsRequest { + SettingsRequest { + avatars: None, + default_user_change_name: None, + default_user_change_email: None, + default_user_change_username: None, + event_retention: None, + reputation_lower_limit: None, + reputation_upper_limit: None, + footer_links: None, + gdpr_compliance: None, + impersonation: None, + impersonation_require_reason: None, + default_token_duration: None, + default_token_length: None, + pagination_default_page_size: None, + pagination_max_page_size: None, + flags, + } + } +} diff --git a/packages/client-rust/src/models/severity_enum.rs b/packages/client-rust/src/models/severity_enum.rs new file mode 100644 index 0000000000..179458b97e --- /dev/null +++ b/packages/client-rust/src/models/severity_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum SeverityEnum { + #[serde(rename = "notice")] + Notice, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "alert")] + Alert, +} + +impl std::fmt::Display for SeverityEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Notice => write!(f, "notice"), + Self::Warning => write!(f, "warning"), + Self::Alert => write!(f, "alert"), + } + } +} + +impl Default for SeverityEnum { + fn default() -> SeverityEnum { + Self::Notice + } +} diff --git a/packages/client-rust/src/models/shell_challenge.rs b/packages/client-rust/src/models/shell_challenge.rs new file mode 100644 index 0000000000..487a5ef89b --- /dev/null +++ b/packages/client-rust/src/models/shell_challenge.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ShellChallenge : challenge type to render HTML as-is +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ShellChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "body")] + pub body: String, +} + +impl ShellChallenge { + /// challenge type to render HTML as-is + pub fn new(body: String) -> ShellChallenge { + ShellChallenge { + flow_info: None, + component: None, + response_errors: None, + body, + } + } +} diff --git a/packages/client-rust/src/models/signature_algorithm_enum.rs b/packages/client-rust/src/models/signature_algorithm_enum.rs new file mode 100644 index 0000000000..af9df53c7c --- /dev/null +++ b/packages/client-rust/src/models/signature_algorithm_enum.rs @@ -0,0 +1,74 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum SignatureAlgorithmEnum { + #[serde(rename = "http://www.w3.org/2000/09/xmldsig#rsa-sha1")] + HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashRsaSha1, + #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256")] + HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashRsaSha256, + #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384")] + HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashRsaSha384, + #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512")] + HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashRsaSha512, + #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1")] + HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha1, + #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256")] + HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha256, + #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384")] + HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha384, + #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512")] + HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha512, + #[serde(rename = "http://www.w3.org/2000/09/xmldsig#dsa-sha1")] + HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashDsaSha1, +} + +impl std::fmt::Display for SignatureAlgorithmEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashRsaSha1 => { + write!(f, "http://www.w3.org/2000/09/xmldsig#rsa-sha1") + } + Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashRsaSha256 => { + write!(f, "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256") + } + Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashRsaSha384 => { + write!(f, "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384") + } + Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashRsaSha512 => { + write!(f, "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512") + } + Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha1 => { + write!(f, "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1") + } + Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha256 => { + write!(f, "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256") + } + Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha384 => { + write!(f, "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384") + } + Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha512 => { + write!(f, "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512") + } + Self::HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashDsaSha1 => { + write!(f, "http://www.w3.org/2000/09/xmldsig#dsa-sha1") + } + } + } +} + +impl Default for SignatureAlgorithmEnum { + fn default() -> SignatureAlgorithmEnum { + Self::HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashRsaSha1 + } +} diff --git a/packages/client-rust/src/models/sms_device.rs b/packages/client-rust/src/models/sms_device.rs new file mode 100644 index 0000000000..0df7003db6 --- /dev/null +++ b/packages/client-rust/src/models/sms_device.rs @@ -0,0 +1,42 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SmsDevice : Serializer for sms authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SmsDevice { + /// The human-readable name of this device. + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "phone_number")] + pub phone_number: String, + #[serde(rename = "user")] + pub user: models::PartialUser, +} + +impl SmsDevice { + /// Serializer for sms authenticator devices + pub fn new( + name: String, + pk: i32, + phone_number: String, + user: models::PartialUser, + ) -> SmsDevice { + SmsDevice { + name, + pk, + phone_number, + user, + } + } +} diff --git a/packages/client-rust/src/models/sms_device_request.rs b/packages/client-rust/src/models/sms_device_request.rs new file mode 100644 index 0000000000..1af0e66446 --- /dev/null +++ b/packages/client-rust/src/models/sms_device_request.rs @@ -0,0 +1,26 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SmsDeviceRequest : Serializer for sms authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SmsDeviceRequest { + /// The human-readable name of this device. + #[serde(rename = "name")] + pub name: String, +} + +impl SmsDeviceRequest { + /// Serializer for sms authenticator devices + pub fn new(name: String) -> SmsDeviceRequest { + SmsDeviceRequest { name } + } +} diff --git a/packages/client-rust/src/models/software.rs b/packages/client-rust/src/models/software.rs new file mode 100644 index 0000000000..acce00b8fd --- /dev/null +++ b/packages/client-rust/src/models/software.rs @@ -0,0 +1,34 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Software { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + #[serde(rename = "source")] + pub source: String, + #[serde(rename = "path", skip_serializing_if = "Option::is_none")] + pub path: Option, +} + +impl Software { + pub fn new(name: String, source: String) -> Software { + Software { + name, + version: None, + source, + path: None, + } + } +} diff --git a/packages/client-rust/src/models/software_request.rs b/packages/client-rust/src/models/software_request.rs new file mode 100644 index 0000000000..4db878da35 --- /dev/null +++ b/packages/client-rust/src/models/software_request.rs @@ -0,0 +1,34 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SoftwareRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, + #[serde(rename = "source")] + pub source: String, + #[serde(rename = "path", skip_serializing_if = "Option::is_none")] + pub path: Option, +} + +impl SoftwareRequest { + pub fn new(name: String, source: String) -> SoftwareRequest { + SoftwareRequest { + name, + version: None, + source, + path: None, + } + } +} diff --git a/packages/client-rust/src/models/source.rs b/packages/client-rust/src/models/source.rs new file mode 100644 index 0000000000..b01e9d9957 --- /dev/null +++ b/packages/client-rust/src/models/source.rs @@ -0,0 +1,127 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Source : Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Source { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Source's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal source name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde(rename = "managed", deserialize_with = "Option::deserialize")] + pub managed: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + /// Get the URL to the source icon + #[serde(rename = "icon_url", deserialize_with = "Option::deserialize")] + pub icon_url: Option, + #[serde(rename = "icon_themed_urls", deserialize_with = "Option::deserialize")] + pub icon_themed_urls: Option, +} + +impl Source { + /// Source Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + slug: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + managed: Option, + icon_url: Option, + icon_themed_urls: Option, + ) -> Source { + Source { + pk, + name, + slug, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + policy_engine_mode: None, + user_matching_mode: None, + managed, + user_path_template: None, + icon: None, + icon_url, + icon_themed_urls, + } + } +} diff --git a/packages/client-rust/src/models/source_stage.rs b/packages/client-rust/src/models/source_stage.rs new file mode 100644 index 0000000000..fed8a27320 --- /dev/null +++ b/packages/client-rust/src/models/source_stage.rs @@ -0,0 +1,66 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SourceStage : SourceStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SourceStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + #[serde(rename = "source")] + pub source: uuid::Uuid, + /// Amount of time a user can take to return from the source to continue the flow (Format: + /// hours=-1;minutes=-2;seconds=-3) + #[serde(rename = "resume_timeout", skip_serializing_if = "Option::is_none")] + pub resume_timeout: Option, +} + +impl SourceStage { + /// SourceStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + source: uuid::Uuid, + ) -> SourceStage { + SourceStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + source, + resume_timeout: None, + } + } +} diff --git a/packages/client-rust/src/models/source_stage_request.rs b/packages/client-rust/src/models/source_stage_request.rs new file mode 100644 index 0000000000..48f6de2942 --- /dev/null +++ b/packages/client-rust/src/models/source_stage_request.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SourceStageRequest : SourceStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SourceStageRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "source")] + pub source: uuid::Uuid, + /// Amount of time a user can take to return from the source to continue the flow (Format: + /// hours=-1;minutes=-2;seconds=-3) + #[serde(rename = "resume_timeout", skip_serializing_if = "Option::is_none")] + pub resume_timeout: Option, +} + +impl SourceStageRequest { + /// SourceStage Serializer + pub fn new(name: String, source: uuid::Uuid) -> SourceStageRequest { + SourceStageRequest { + name, + source, + resume_timeout: None, + } + } +} diff --git a/packages/client-rust/src/models/source_type.rs b/packages/client-rust/src/models/source_type.rs new file mode 100644 index 0000000000..c5daafc8d7 --- /dev/null +++ b/packages/client-rust/src/models/source_type.rs @@ -0,0 +1,64 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SourceType : Serializer for SourceType +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SourceType { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "verbose_name")] + pub verbose_name: String, + #[serde(rename = "urls_customizable")] + pub urls_customizable: bool, + #[serde(rename = "request_token_url", deserialize_with = "Option::deserialize")] + pub request_token_url: Option, + #[serde(rename = "authorization_url", deserialize_with = "Option::deserialize")] + pub authorization_url: Option, + #[serde(rename = "access_token_url", deserialize_with = "Option::deserialize")] + pub access_token_url: Option, + #[serde(rename = "profile_url", deserialize_with = "Option::deserialize")] + pub profile_url: Option, + #[serde( + rename = "oidc_well_known_url", + deserialize_with = "Option::deserialize" + )] + pub oidc_well_known_url: Option, + #[serde(rename = "oidc_jwks_url", deserialize_with = "Option::deserialize")] + pub oidc_jwks_url: Option, +} + +impl SourceType { + /// Serializer for SourceType + pub fn new( + name: String, + verbose_name: String, + urls_customizable: bool, + request_token_url: Option, + authorization_url: Option, + access_token_url: Option, + profile_url: Option, + oidc_well_known_url: Option, + oidc_jwks_url: Option, + ) -> SourceType { + SourceType { + name, + verbose_name, + urls_customizable, + request_token_url, + authorization_url, + access_token_url, + profile_url, + oidc_well_known_url, + oidc_jwks_url, + } + } +} diff --git a/packages/client-rust/src/models/ssf_provider.rs b/packages/client-rust/src/models/ssf_provider.rs new file mode 100644 index 0000000000..e905f22f70 --- /dev/null +++ b/packages/client-rust/src/models/ssf_provider.rs @@ -0,0 +1,75 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SsfProvider : SSFProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SsfProvider { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Key used to sign the SSF Events. + #[serde(rename = "signing_key")] + pub signing_key: uuid::Uuid, + #[serde(rename = "token_obj")] + pub token_obj: models::Token, + #[serde( + rename = "oidc_auth_providers", + skip_serializing_if = "Option::is_none" + )] + pub oidc_auth_providers: Option>, + #[serde(rename = "ssf_url", deserialize_with = "Option::deserialize")] + pub ssf_url: Option, + #[serde(rename = "event_retention", skip_serializing_if = "Option::is_none")] + pub event_retention: Option, +} + +impl SsfProvider { + /// SSFProvider Serializer + pub fn new( + pk: i32, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + signing_key: uuid::Uuid, + token_obj: models::Token, + ssf_url: Option, + ) -> SsfProvider { + SsfProvider { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + signing_key, + token_obj, + oidc_auth_providers: None, + ssf_url, + event_retention: None, + } + } +} diff --git a/packages/client-rust/src/models/ssf_provider_request.rs b/packages/client-rust/src/models/ssf_provider_request.rs new file mode 100644 index 0000000000..ab0e13eb03 --- /dev/null +++ b/packages/client-rust/src/models/ssf_provider_request.rs @@ -0,0 +1,40 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SsfProviderRequest : SSFProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SsfProviderRequest { + #[serde(rename = "name")] + pub name: String, + /// Key used to sign the SSF Events. + #[serde(rename = "signing_key")] + pub signing_key: uuid::Uuid, + #[serde( + rename = "oidc_auth_providers", + skip_serializing_if = "Option::is_none" + )] + pub oidc_auth_providers: Option>, + #[serde(rename = "event_retention", skip_serializing_if = "Option::is_none")] + pub event_retention: Option, +} + +impl SsfProviderRequest { + /// SSFProvider Serializer + pub fn new(name: String, signing_key: uuid::Uuid) -> SsfProviderRequest { + SsfProviderRequest { + name, + signing_key, + oidc_auth_providers: None, + event_retention: None, + } + } +} diff --git a/packages/client-rust/src/models/ssf_stream.rs b/packages/client-rust/src/models/ssf_stream.rs new file mode 100644 index 0000000000..851d7baee3 --- /dev/null +++ b/packages/client-rust/src/models/ssf_stream.rs @@ -0,0 +1,63 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SsfStream : SSFStream Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SsfStream { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "provider")] + pub provider: i32, + #[serde(rename = "provider_obj")] + pub provider_obj: models::SsfProvider, + #[serde(rename = "delivery_method")] + pub delivery_method: models::DeliveryMethodEnum, + #[serde( + rename = "endpoint_url", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub endpoint_url: Option>, + #[serde(rename = "events_requested", skip_serializing_if = "Option::is_none")] + pub events_requested: Option>, + #[serde(rename = "format")] + pub format: String, + #[serde(rename = "aud", skip_serializing_if = "Option::is_none")] + pub aud: Option>, + #[serde(rename = "iss")] + pub iss: String, +} + +impl SsfStream { + /// SSFStream Serializer + pub fn new( + pk: uuid::Uuid, + provider: i32, + provider_obj: models::SsfProvider, + delivery_method: models::DeliveryMethodEnum, + format: String, + iss: String, + ) -> SsfStream { + SsfStream { + pk, + provider, + provider_obj, + delivery_method, + endpoint_url: None, + events_requested: None, + format, + aud: None, + iss, + } + } +} diff --git a/packages/client-rust/src/models/stage.rs b/packages/client-rust/src/models/stage.rs new file mode 100644 index 0000000000..e9f8a532ee --- /dev/null +++ b/packages/client-rust/src/models/stage.rs @@ -0,0 +1,57 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Stage : Stage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Stage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, +} + +impl Stage { + /// Stage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + ) -> Stage { + Stage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + } + } +} diff --git a/packages/client-rust/src/models/stage_mode_enum.rs b/packages/client-rust/src/models/stage_mode_enum.rs new file mode 100644 index 0000000000..b141f18e73 --- /dev/null +++ b/packages/client-rust/src/models/stage_mode_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum StageModeEnum { + #[serde(rename = "optional")] + Optional, + #[serde(rename = "required")] + Required, +} + +impl std::fmt::Display for StageModeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Optional => write!(f, "optional"), + Self::Required => write!(f, "required"), + } + } +} + +impl Default for StageModeEnum { + fn default() -> StageModeEnum { + Self::Optional + } +} diff --git a/packages/client-rust/src/models/stage_prompt.rs b/packages/client-rust/src/models/stage_prompt.rs new file mode 100644 index 0000000000..08e90d7214 --- /dev/null +++ b/packages/client-rust/src/models/stage_prompt.rs @@ -0,0 +1,61 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// StagePrompt : Serializer for a single Prompt field +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct StagePrompt { + #[serde(rename = "field_key")] + pub field_key: String, + #[serde(rename = "label")] + pub label: String, + #[serde(rename = "type")] + pub r#type: models::PromptTypeEnum, + #[serde(rename = "required")] + pub required: bool, + #[serde(rename = "placeholder")] + pub placeholder: String, + #[serde(rename = "initial_value")] + pub initial_value: String, + #[serde(rename = "order")] + pub order: i32, + #[serde(rename = "sub_text")] + pub sub_text: String, + #[serde(rename = "choices", deserialize_with = "Option::deserialize")] + pub choices: Option>, +} + +impl StagePrompt { + /// Serializer for a single Prompt field + pub fn new( + field_key: String, + label: String, + r#type: models::PromptTypeEnum, + required: bool, + placeholder: String, + initial_value: String, + order: i32, + sub_text: String, + choices: Option>, + ) -> StagePrompt { + StagePrompt { + field_key, + label, + r#type, + required, + placeholder, + initial_value, + order, + sub_text, + choices, + } + } +} diff --git a/packages/client-rust/src/models/static_device.rs b/packages/client-rust/src/models/static_device.rs new file mode 100644 index 0000000000..7362aa058a --- /dev/null +++ b/packages/client-rust/src/models/static_device.rs @@ -0,0 +1,42 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// StaticDevice : Serializer for static authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct StaticDevice { + /// The human-readable name of this device. + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "token_set")] + pub token_set: Vec, + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "user")] + pub user: models::PartialUser, +} + +impl StaticDevice { + /// Serializer for static authenticator devices + pub fn new( + name: String, + token_set: Vec, + pk: i32, + user: models::PartialUser, + ) -> StaticDevice { + StaticDevice { + name, + token_set, + pk, + user, + } + } +} diff --git a/packages/client-rust/src/models/static_device_request.rs b/packages/client-rust/src/models/static_device_request.rs new file mode 100644 index 0000000000..1d465c7542 --- /dev/null +++ b/packages/client-rust/src/models/static_device_request.rs @@ -0,0 +1,26 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// StaticDeviceRequest : Serializer for static authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct StaticDeviceRequest { + /// The human-readable name of this device. + #[serde(rename = "name")] + pub name: String, +} + +impl StaticDeviceRequest { + /// Serializer for static authenticator devices + pub fn new(name: String) -> StaticDeviceRequest { + StaticDeviceRequest { name } + } +} diff --git a/packages/client-rust/src/models/static_device_token.rs b/packages/client-rust/src/models/static_device_token.rs new file mode 100644 index 0000000000..8699312296 --- /dev/null +++ b/packages/client-rust/src/models/static_device_token.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// StaticDeviceToken : Serializer for static device's tokens +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct StaticDeviceToken { + #[serde(rename = "token")] + pub token: String, +} + +impl StaticDeviceToken { + /// Serializer for static device's tokens + pub fn new(token: String) -> StaticDeviceToken { + StaticDeviceToken { token } + } +} diff --git a/packages/client-rust/src/models/sub_mode_enum.rs b/packages/client-rust/src/models/sub_mode_enum.rs new file mode 100644 index 0000000000..5438fc532b --- /dev/null +++ b/packages/client-rust/src/models/sub_mode_enum.rs @@ -0,0 +1,47 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum SubModeEnum { + #[serde(rename = "hashed_user_id")] + HashedUserId, + #[serde(rename = "user_id")] + UserId, + #[serde(rename = "user_uuid")] + UserUuid, + #[serde(rename = "user_username")] + UserUsername, + #[serde(rename = "user_email")] + UserEmail, + #[serde(rename = "user_upn")] + UserUpn, +} + +impl std::fmt::Display for SubModeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::HashedUserId => write!(f, "hashed_user_id"), + Self::UserId => write!(f, "user_id"), + Self::UserUuid => write!(f, "user_uuid"), + Self::UserUsername => write!(f, "user_username"), + Self::UserEmail => write!(f, "user_email"), + Self::UserUpn => write!(f, "user_upn"), + } + } +} + +impl Default for SubModeEnum { + fn default() -> SubModeEnum { + Self::HashedUserId + } +} diff --git a/packages/client-rust/src/models/sync_object_model_enum.rs b/packages/client-rust/src/models/sync_object_model_enum.rs new file mode 100644 index 0000000000..d73ef4bc50 --- /dev/null +++ b/packages/client-rust/src/models/sync_object_model_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum SyncObjectModelEnum { + #[serde(rename = "authentik.core.models.User")] + AuthentikCoreModelsUser, + #[serde(rename = "authentik.core.models.Group")] + AuthentikCoreModelsGroup, +} + +impl std::fmt::Display for SyncObjectModelEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::AuthentikCoreModelsUser => write!(f, "authentik.core.models.User"), + Self::AuthentikCoreModelsGroup => write!(f, "authentik.core.models.Group"), + } + } +} + +impl Default for SyncObjectModelEnum { + fn default() -> SyncObjectModelEnum { + Self::AuthentikCoreModelsUser + } +} diff --git a/packages/client-rust/src/models/sync_object_request.rs b/packages/client-rust/src/models/sync_object_request.rs new file mode 100644 index 0000000000..fd63756c83 --- /dev/null +++ b/packages/client-rust/src/models/sync_object_request.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SyncObjectRequest : Sync object serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SyncObjectRequest { + #[serde(rename = "sync_object_model")] + pub sync_object_model: models::SyncObjectModelEnum, + #[serde(rename = "sync_object_id")] + pub sync_object_id: String, + #[serde(rename = "override_dry_run", skip_serializing_if = "Option::is_none")] + pub override_dry_run: Option, +} + +impl SyncObjectRequest { + /// Sync object serializer + pub fn new( + sync_object_model: models::SyncObjectModelEnum, + sync_object_id: String, + ) -> SyncObjectRequest { + SyncObjectRequest { + sync_object_model, + sync_object_id, + override_dry_run: None, + } + } +} diff --git a/packages/client-rust/src/models/sync_object_result.rs b/packages/client-rust/src/models/sync_object_result.rs new file mode 100644 index 0000000000..982be6cf43 --- /dev/null +++ b/packages/client-rust/src/models/sync_object_result.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SyncObjectResult : Result of a single object sync +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SyncObjectResult { + #[serde(rename = "messages")] + pub messages: Vec, +} + +impl SyncObjectResult { + /// Result of a single object sync + pub fn new(messages: Vec) -> SyncObjectResult { + SyncObjectResult { messages } + } +} diff --git a/packages/client-rust/src/models/sync_outgoing_trigger_mode_enum.rs b/packages/client-rust/src/models/sync_outgoing_trigger_mode_enum.rs new file mode 100644 index 0000000000..ad7bd1fe08 --- /dev/null +++ b/packages/client-rust/src/models/sync_outgoing_trigger_mode_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum SyncOutgoingTriggerModeEnum { + #[serde(rename = "none")] + None, + #[serde(rename = "immediate")] + Immediate, + #[serde(rename = "deferred_end")] + DeferredEnd, +} + +impl std::fmt::Display for SyncOutgoingTriggerModeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::None => write!(f, "none"), + Self::Immediate => write!(f, "immediate"), + Self::DeferredEnd => write!(f, "deferred_end"), + } + } +} + +impl Default for SyncOutgoingTriggerModeEnum { + fn default() -> SyncOutgoingTriggerModeEnum { + Self::None + } +} diff --git a/packages/client-rust/src/models/sync_status.rs b/packages/client-rust/src/models/sync_status.rs new file mode 100644 index 0000000000..8b3369e7c5 --- /dev/null +++ b/packages/client-rust/src/models/sync_status.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SyncStatus : Provider/source sync status +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SyncStatus { + #[serde(rename = "is_running")] + pub is_running: bool, + #[serde( + rename = "last_successful_sync", + skip_serializing_if = "Option::is_none" + )] + pub last_successful_sync: Option, + #[serde(rename = "last_sync_status", skip_serializing_if = "Option::is_none")] + pub last_sync_status: Option, +} + +impl SyncStatus { + /// Provider/source sync status + pub fn new(is_running: bool) -> SyncStatus { + SyncStatus { + is_running, + last_successful_sync: None, + last_sync_status: None, + } + } +} diff --git a/packages/client-rust/src/models/system_info.rs b/packages/client-rust/src/models/system_info.rs new file mode 100644 index 0000000000..ccde367a14 --- /dev/null +++ b/packages/client-rust/src/models/system_info.rs @@ -0,0 +1,64 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SystemInfo : Get system information. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SystemInfo { + /// Get HTTP Request headers + #[serde(rename = "http_headers")] + pub http_headers: std::collections::HashMap, + /// Get HTTP host + #[serde(rename = "http_host")] + pub http_host: String, + /// Get HTTP Secure flag + #[serde(rename = "http_is_secure")] + pub http_is_secure: bool, + #[serde(rename = "runtime")] + pub runtime: models::SystemInfoRuntime, + /// Currently active brand + #[serde(rename = "brand")] + pub brand: String, + /// Current server time + #[serde(rename = "server_time")] + pub server_time: String, + /// Whether the embedded outpost is disabled + #[serde(rename = "embedded_outpost_disabled")] + pub embedded_outpost_disabled: bool, + /// Get the FQDN configured on the embedded outpost + #[serde(rename = "embedded_outpost_host")] + pub embedded_outpost_host: String, +} + +impl SystemInfo { + /// Get system information. + pub fn new( + http_headers: std::collections::HashMap, + http_host: String, + http_is_secure: bool, + runtime: models::SystemInfoRuntime, + brand: String, + server_time: String, + embedded_outpost_disabled: bool, + embedded_outpost_host: String, + ) -> SystemInfo { + SystemInfo { + http_headers, + http_host, + http_is_secure, + runtime, + brand, + server_time, + embedded_outpost_disabled, + embedded_outpost_host, + } + } +} diff --git a/packages/client-rust/src/models/system_info_runtime.rs b/packages/client-rust/src/models/system_info_runtime.rs new file mode 100644 index 0000000000..018540a755 --- /dev/null +++ b/packages/client-rust/src/models/system_info_runtime.rs @@ -0,0 +1,60 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// SystemInfoRuntime : Get versions +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SystemInfoRuntime { + #[serde(rename = "python_version")] + pub python_version: String, + #[serde(rename = "environment")] + pub environment: String, + #[serde(rename = "architecture")] + pub architecture: String, + #[serde(rename = "platform")] + pub platform: String, + #[serde(rename = "uname")] + pub uname: String, + #[serde(rename = "openssl_version")] + pub openssl_version: String, + #[serde( + rename = "openssl_fips_enabled", + deserialize_with = "Option::deserialize" + )] + pub openssl_fips_enabled: Option, + #[serde(rename = "authentik_version")] + pub authentik_version: String, +} + +impl SystemInfoRuntime { + /// Get versions + pub fn new( + python_version: String, + environment: String, + architecture: String, + platform: String, + uname: String, + openssl_version: String, + openssl_fips_enabled: Option, + authentik_version: String, + ) -> SystemInfoRuntime { + SystemInfoRuntime { + python_version, + environment, + architecture, + platform, + uname, + openssl_version, + openssl_fips_enabled, + authentik_version, + } + } +} diff --git a/packages/client-rust/src/models/task.rs b/packages/client-rust/src/models/task.rs new file mode 100644 index 0000000000..c962a261e4 --- /dev/null +++ b/packages/client-rust/src/models/task.rs @@ -0,0 +1,92 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Task { + #[serde(rename = "message_id", skip_serializing_if = "Option::is_none")] + pub message_id: Option, + /// Queue name + #[serde(rename = "queue_name", skip_serializing_if = "Option::is_none")] + pub queue_name: Option, + /// Dramatiq actor name + #[serde(rename = "actor_name")] + pub actor_name: String, + /// Task status + #[serde(rename = "state", skip_serializing_if = "Option::is_none")] + pub state: Option, + /// Task last modified time + #[serde(rename = "mtime", skip_serializing_if = "Option::is_none")] + pub mtime: Option, + /// Number of retries + #[serde(rename = "retries", skip_serializing_if = "Option::is_none")] + pub retries: Option, + /// Planned execution time + #[serde( + rename = "eta", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub eta: Option>, + #[serde(rename = "rel_obj_app_label")] + pub rel_obj_app_label: String, + #[serde(rename = "rel_obj_model")] + pub rel_obj_model: String, + #[serde( + rename = "rel_obj_id", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub rel_obj_id: Option>, + #[serde(rename = "uid")] + pub uid: String, + #[serde(rename = "logs")] + pub logs: Vec, + #[serde(rename = "previous_logs")] + pub previous_logs: Vec, + #[serde(rename = "aggregated_status")] + pub aggregated_status: models::TaskAggregatedStatusEnum, + #[serde(rename = "description", deserialize_with = "Option::deserialize")] + pub description: Option, +} + +impl Task { + pub fn new( + actor_name: String, + rel_obj_app_label: String, + rel_obj_model: String, + uid: String, + logs: Vec, + previous_logs: Vec, + aggregated_status: models::TaskAggregatedStatusEnum, + description: Option, + ) -> Task { + Task { + message_id: None, + queue_name: None, + actor_name, + state: None, + mtime: None, + retries: None, + eta: None, + rel_obj_app_label, + rel_obj_model, + rel_obj_id: None, + uid, + logs, + previous_logs, + aggregated_status, + description, + } + } +} diff --git a/packages/client-rust/src/models/task_aggregated_status_enum.rs b/packages/client-rust/src/models/task_aggregated_status_enum.rs new file mode 100644 index 0000000000..59e0330136 --- /dev/null +++ b/packages/client-rust/src/models/task_aggregated_status_enum.rs @@ -0,0 +1,59 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum TaskAggregatedStatusEnum { + #[serde(rename = "queued")] + Queued, + #[serde(rename = "consumed")] + Consumed, + #[serde(rename = "preprocess")] + Preprocess, + #[serde(rename = "running")] + Running, + #[serde(rename = "postprocess")] + Postprocess, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "done")] + Done, + #[serde(rename = "info")] + Info, + #[serde(rename = "warning")] + Warning, + #[serde(rename = "error")] + Error, +} + +impl std::fmt::Display for TaskAggregatedStatusEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Queued => write!(f, "queued"), + Self::Consumed => write!(f, "consumed"), + Self::Preprocess => write!(f, "preprocess"), + Self::Running => write!(f, "running"), + Self::Postprocess => write!(f, "postprocess"), + Self::Rejected => write!(f, "rejected"), + Self::Done => write!(f, "done"), + Self::Info => write!(f, "info"), + Self::Warning => write!(f, "warning"), + Self::Error => write!(f, "error"), + } + } +} + +impl Default for TaskAggregatedStatusEnum { + fn default() -> TaskAggregatedStatusEnum { + Self::Queued + } +} diff --git a/packages/client-rust/src/models/task_state_enum.rs b/packages/client-rust/src/models/task_state_enum.rs new file mode 100644 index 0000000000..dbb4fd2d1e --- /dev/null +++ b/packages/client-rust/src/models/task_state_enum.rs @@ -0,0 +1,50 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum TaskStateEnum { + #[serde(rename = "queued")] + Queued, + #[serde(rename = "consumed")] + Consumed, + #[serde(rename = "preprocess")] + Preprocess, + #[serde(rename = "running")] + Running, + #[serde(rename = "postprocess")] + Postprocess, + #[serde(rename = "rejected")] + Rejected, + #[serde(rename = "done")] + Done, +} + +impl std::fmt::Display for TaskStateEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Queued => write!(f, "queued"), + Self::Consumed => write!(f, "consumed"), + Self::Preprocess => write!(f, "preprocess"), + Self::Running => write!(f, "running"), + Self::Postprocess => write!(f, "postprocess"), + Self::Rejected => write!(f, "rejected"), + Self::Done => write!(f, "done"), + } + } +} + +impl Default for TaskStateEnum { + fn default() -> TaskStateEnum { + Self::Queued + } +} diff --git a/packages/client-rust/src/models/telegram_auth_request.rs b/packages/client-rust/src/models/telegram_auth_request.rs new file mode 100644 index 0000000000..891f38ec63 --- /dev/null +++ b/packages/client-rust/src/models/telegram_auth_request.rs @@ -0,0 +1,43 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TelegramAuthRequest { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")] + pub first_name: Option, + #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")] + pub last_name: Option, + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde(rename = "photo_url", skip_serializing_if = "Option::is_none")] + pub photo_url: Option, + #[serde(rename = "auth_date")] + pub auth_date: i32, + #[serde(rename = "hash")] + pub hash: String, +} + +impl TelegramAuthRequest { + pub fn new(id: i32, auth_date: i32, hash: String) -> TelegramAuthRequest { + TelegramAuthRequest { + id, + first_name: None, + last_name: None, + username: None, + photo_url: None, + auth_date, + hash, + } + } +} diff --git a/packages/client-rust/src/models/telegram_challenge_response_request.rs b/packages/client-rust/src/models/telegram_challenge_response_request.rs new file mode 100644 index 0000000000..bae324006d --- /dev/null +++ b/packages/client-rust/src/models/telegram_challenge_response_request.rs @@ -0,0 +1,48 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TelegramChallengeResponseRequest : Base class for all challenge responses +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TelegramChallengeResponseRequest { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")] + pub first_name: Option, + #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")] + pub last_name: Option, + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde(rename = "photo_url", skip_serializing_if = "Option::is_none")] + pub photo_url: Option, + #[serde(rename = "auth_date")] + pub auth_date: i32, + #[serde(rename = "hash")] + pub hash: String, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, +} + +impl TelegramChallengeResponseRequest { + /// Base class for all challenge responses + pub fn new(id: i32, auth_date: i32, hash: String) -> TelegramChallengeResponseRequest { + TelegramChallengeResponseRequest { + id, + first_name: None, + last_name: None, + username: None, + photo_url: None, + auth_date, + hash, + component: None, + } + } +} diff --git a/packages/client-rust/src/models/telegram_login_challenge.rs b/packages/client-rust/src/models/telegram_login_challenge.rs new file mode 100644 index 0000000000..e213f21411 --- /dev/null +++ b/packages/client-rust/src/models/telegram_login_challenge.rs @@ -0,0 +1,40 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TelegramLoginChallenge : Base login challenge for Identification stage +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TelegramLoginChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + /// Telegram bot username + #[serde(rename = "bot_username")] + pub bot_username: String, + #[serde(rename = "request_message_access")] + pub request_message_access: bool, +} + +impl TelegramLoginChallenge { + /// Base login challenge for Identification stage + pub fn new(bot_username: String, request_message_access: bool) -> TelegramLoginChallenge { + TelegramLoginChallenge { + flow_info: None, + component: None, + response_errors: None, + bot_username, + request_message_access, + } + } +} diff --git a/packages/client-rust/src/models/telegram_source.rs b/packages/client-rust/src/models/telegram_source.rs new file mode 100644 index 0000000000..7c56f665a9 --- /dev/null +++ b/packages/client-rust/src/models/telegram_source.rs @@ -0,0 +1,143 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TelegramSource : Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TelegramSource { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Source's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal source name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde(rename = "managed", deserialize_with = "Option::deserialize")] + pub managed: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + #[serde(rename = "icon_url", deserialize_with = "Option::deserialize")] + pub icon_url: Option, + #[serde(rename = "icon_themed_urls", deserialize_with = "Option::deserialize")] + pub icon_themed_urls: Option, + /// Telegram bot username + #[serde(rename = "bot_username")] + pub bot_username: String, + /// Request access to send messages from your bot. + #[serde( + rename = "request_message_access", + skip_serializing_if = "Option::is_none" + )] + pub request_message_access: Option, + /// Flow used before authentication. + #[serde(rename = "pre_authentication_flow")] + pub pre_authentication_flow: uuid::Uuid, +} + +impl TelegramSource { + /// Source Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + slug: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + managed: Option, + icon_url: Option, + icon_themed_urls: Option, + bot_username: String, + pre_authentication_flow: uuid::Uuid, + ) -> TelegramSource { + TelegramSource { + pk, + name, + slug, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + policy_engine_mode: None, + user_matching_mode: None, + managed, + user_path_template: None, + icon: None, + icon_url, + icon_themed_urls, + bot_username, + request_message_access: None, + pre_authentication_flow, + } + } +} diff --git a/packages/client-rust/src/models/telegram_source_property_mapping.rs b/packages/client-rust/src/models/telegram_source_property_mapping.rs new file mode 100644 index 0000000000..4c6b0076e4 --- /dev/null +++ b/packages/client-rust/src/models/telegram_source_property_mapping.rs @@ -0,0 +1,68 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TelegramSourcePropertyMapping : TelegramSourcePropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TelegramSourcePropertyMapping { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, + /// Get object's component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, +} + +impl TelegramSourcePropertyMapping { + /// TelegramSourcePropertyMapping Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + expression: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + ) -> TelegramSourcePropertyMapping { + TelegramSourcePropertyMapping { + pk, + managed: None, + name, + expression, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + } + } +} diff --git a/packages/client-rust/src/models/telegram_source_property_mapping_request.rs b/packages/client-rust/src/models/telegram_source_property_mapping_request.rs new file mode 100644 index 0000000000..4b7e0ee46c --- /dev/null +++ b/packages/client-rust/src/models/telegram_source_property_mapping_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TelegramSourcePropertyMappingRequest : TelegramSourcePropertyMapping Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TelegramSourcePropertyMappingRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "expression")] + pub expression: String, +} + +impl TelegramSourcePropertyMappingRequest { + /// TelegramSourcePropertyMapping Serializer + pub fn new(name: String, expression: String) -> TelegramSourcePropertyMappingRequest { + TelegramSourcePropertyMappingRequest { + managed: None, + name, + expression, + } + } +} diff --git a/packages/client-rust/src/models/telegram_source_request.rs b/packages/client-rust/src/models/telegram_source_request.rs new file mode 100644 index 0000000000..987bbd2a86 --- /dev/null +++ b/packages/client-rust/src/models/telegram_source_request.rs @@ -0,0 +1,109 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TelegramSourceRequest : Source Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TelegramSourceRequest { + /// Source's display Name. + #[serde(rename = "name")] + pub name: String, + /// Internal source name, used in URLs. + #[serde(rename = "slug")] + pub slug: String, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// When enabled, this source will be displayed as a prominent button on the login page, + /// instead of a small icon. + #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] + pub promoted: Option, + /// Flow to use when authenticating existing users. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow to use when enrolling new users. + #[serde( + rename = "enrollment_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enrollment_flow: Option>, + #[serde( + rename = "user_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub user_property_mappings: Option>, + #[serde( + rename = "group_property_mappings", + skip_serializing_if = "Option::is_none" + )] + pub group_property_mappings: Option>, + #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] + pub policy_engine_mode: Option, + /// How the source determines if an existing user should be authenticated or a new user + /// enrolled. + #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] + pub user_matching_mode: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, + /// Telegram bot username + #[serde(rename = "bot_username")] + pub bot_username: String, + /// Telegram bot token + #[serde(rename = "bot_token")] + pub bot_token: String, + /// Request access to send messages from your bot. + #[serde( + rename = "request_message_access", + skip_serializing_if = "Option::is_none" + )] + pub request_message_access: Option, + /// Flow used before authentication. + #[serde(rename = "pre_authentication_flow")] + pub pre_authentication_flow: uuid::Uuid, +} + +impl TelegramSourceRequest { + /// Source Serializer + pub fn new( + name: String, + slug: String, + bot_username: String, + bot_token: String, + pre_authentication_flow: uuid::Uuid, + ) -> TelegramSourceRequest { + TelegramSourceRequest { + name, + slug, + enabled: None, + promoted: None, + authentication_flow: None, + enrollment_flow: None, + user_property_mappings: None, + group_property_mappings: None, + policy_engine_mode: None, + user_matching_mode: None, + user_path_template: None, + icon: None, + bot_username, + bot_token, + request_message_access: None, + pre_authentication_flow, + } + } +} diff --git a/packages/client-rust/src/models/tenant.rs b/packages/client-rust/src/models/tenant.rs new file mode 100644 index 0000000000..1777f9532e --- /dev/null +++ b/packages/client-rust/src/models/tenant.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Tenant : Tenant Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Tenant { + #[serde(rename = "tenant_uuid")] + pub tenant_uuid: uuid::Uuid, + #[serde(rename = "schema_name")] + pub schema_name: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "ready", skip_serializing_if = "Option::is_none")] + pub ready: Option, +} + +impl Tenant { + /// Tenant Serializer + pub fn new(tenant_uuid: uuid::Uuid, schema_name: String, name: String) -> Tenant { + Tenant { + tenant_uuid, + schema_name, + name, + ready: None, + } + } +} diff --git a/packages/client-rust/src/models/tenant_admin_group_request_request.rs b/packages/client-rust/src/models/tenant_admin_group_request_request.rs new file mode 100644 index 0000000000..6bbe5815f4 --- /dev/null +++ b/packages/client-rust/src/models/tenant_admin_group_request_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TenantAdminGroupRequestRequest : Tenant admin group creation request serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TenantAdminGroupRequestRequest { + #[serde(rename = "user")] + pub user: String, +} + +impl TenantAdminGroupRequestRequest { + /// Tenant admin group creation request serializer + pub fn new(user: String) -> TenantAdminGroupRequestRequest { + TenantAdminGroupRequestRequest { user } + } +} diff --git a/packages/client-rust/src/models/tenant_recovery_key_request_request.rs b/packages/client-rust/src/models/tenant_recovery_key_request_request.rs new file mode 100644 index 0000000000..4b46e7d984 --- /dev/null +++ b/packages/client-rust/src/models/tenant_recovery_key_request_request.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TenantRecoveryKeyRequestRequest : Tenant recovery key creation request serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TenantRecoveryKeyRequestRequest { + #[serde(rename = "user")] + pub user: String, + #[serde(rename = "duration_days")] + pub duration_days: i32, +} + +impl TenantRecoveryKeyRequestRequest { + /// Tenant recovery key creation request serializer + pub fn new(user: String, duration_days: i32) -> TenantRecoveryKeyRequestRequest { + TenantRecoveryKeyRequestRequest { + user, + duration_days, + } + } +} diff --git a/packages/client-rust/src/models/tenant_recovery_key_response.rs b/packages/client-rust/src/models/tenant_recovery_key_response.rs new file mode 100644 index 0000000000..5a8bcecb31 --- /dev/null +++ b/packages/client-rust/src/models/tenant_recovery_key_response.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TenantRecoveryKeyResponse : Tenant recovery key creation response serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TenantRecoveryKeyResponse { + #[serde(rename = "expiry")] + pub expiry: String, + #[serde(rename = "url")] + pub url: String, +} + +impl TenantRecoveryKeyResponse { + /// Tenant recovery key creation response serializer + pub fn new(expiry: String, url: String) -> TenantRecoveryKeyResponse { + TenantRecoveryKeyResponse { expiry, url } + } +} diff --git a/packages/client-rust/src/models/tenant_request.rs b/packages/client-rust/src/models/tenant_request.rs new file mode 100644 index 0000000000..e59c3b3fdb --- /dev/null +++ b/packages/client-rust/src/models/tenant_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TenantRequest : Tenant Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TenantRequest { + #[serde(rename = "schema_name")] + pub schema_name: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "ready", skip_serializing_if = "Option::is_none")] + pub ready: Option, +} + +impl TenantRequest { + /// Tenant Serializer + pub fn new(schema_name: String, name: String) -> TenantRequest { + TenantRequest { + schema_name, + name, + ready: None, + } + } +} diff --git a/packages/client-rust/src/models/themed_urls.rs b/packages/client-rust/src/models/themed_urls.rs new file mode 100644 index 0000000000..ee87619f7f --- /dev/null +++ b/packages/client-rust/src/models/themed_urls.rs @@ -0,0 +1,40 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ThemedUrls : Themed URLs - maps theme names to URLs for light and dark themes +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ThemedUrls { + #[serde( + rename = "light", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub light: Option>, + #[serde( + rename = "dark", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub dark: Option>, +} + +impl ThemedUrls { + /// Themed URLs - maps theme names to URLs for light and dark themes + pub fn new() -> ThemedUrls { + ThemedUrls { + light: None, + dark: None, + } + } +} diff --git a/packages/client-rust/src/models/token.rs b/packages/client-rust/src/models/token.rs new file mode 100644 index 0000000000..d52644202f --- /dev/null +++ b/packages/client-rust/src/models/token.rs @@ -0,0 +1,64 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Token : Token Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Token { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "intent", skip_serializing_if = "Option::is_none")] + pub intent: Option, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option, + #[serde(rename = "user_obj")] + pub user_obj: models::User, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, + #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] + pub expiring: Option, +} + +impl Token { + /// Token Serializer + pub fn new(pk: uuid::Uuid, identifier: String, user_obj: models::User) -> Token { + Token { + pk, + managed: None, + identifier, + intent: None, + user: None, + user_obj, + description: None, + expires: None, + expiring: None, + } + } +} diff --git a/packages/client-rust/src/models/token_model.rs b/packages/client-rust/src/models/token_model.rs new file mode 100644 index 0000000000..1e7b8cd67a --- /dev/null +++ b/packages/client-rust/src/models/token_model.rs @@ -0,0 +1,62 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TokenModel : Serializer for BaseGrantModel and RefreshToken +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TokenModel { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "provider")] + pub provider: models::OAuth2Provider, + #[serde(rename = "user")] + pub user: models::User, + /// Check if token is expired yet. + #[serde(rename = "is_expired")] + pub is_expired: bool, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, + #[serde(rename = "scope")] + pub scope: Vec, + /// Get the token's id_token as JSON String + #[serde(rename = "id_token")] + pub id_token: String, + #[serde(rename = "revoked", skip_serializing_if = "Option::is_none")] + pub revoked: Option, +} + +impl TokenModel { + /// Serializer for BaseGrantModel and RefreshToken + pub fn new( + pk: i32, + provider: models::OAuth2Provider, + user: models::User, + is_expired: bool, + scope: Vec, + id_token: String, + ) -> TokenModel { + TokenModel { + pk, + provider, + user, + is_expired, + expires: None, + scope, + id_token, + revoked: None, + } + } +} diff --git a/packages/client-rust/src/models/token_request.rs b/packages/client-rust/src/models/token_request.rs new file mode 100644 index 0000000000..10d70c8eef --- /dev/null +++ b/packages/client-rust/src/models/token_request.rs @@ -0,0 +1,58 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TokenRequest : Token Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TokenRequest { + /// Objects that are managed by authentik. These objects are created and updated automatically. + /// This flag only indicates that an object can be overwritten by migrations. You can still + /// modify the objects via the API, but expect changes to be overwritten in a later update. + #[serde( + rename = "managed", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub managed: Option>, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "intent", skip_serializing_if = "Option::is_none")] + pub intent: Option, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, + #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] + pub expiring: Option, +} + +impl TokenRequest { + /// Token Serializer + pub fn new(identifier: String) -> TokenRequest { + TokenRequest { + managed: None, + identifier, + intent: None, + user: None, + description: None, + expires: None, + expiring: None, + } + } +} diff --git a/packages/client-rust/src/models/token_set_key_request.rs b/packages/client-rust/src/models/token_set_key_request.rs new file mode 100644 index 0000000000..54fc507c03 --- /dev/null +++ b/packages/client-rust/src/models/token_set_key_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TokenSetKeyRequest : Set token's key +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TokenSetKeyRequest { + #[serde(rename = "key")] + pub key: String, +} + +impl TokenSetKeyRequest { + /// Set token's key + pub fn new(key: String) -> TokenSetKeyRequest { + TokenSetKeyRequest { key } + } +} diff --git a/packages/client-rust/src/models/token_view.rs b/packages/client-rust/src/models/token_view.rs new file mode 100644 index 0000000000..d94d5fb76f --- /dev/null +++ b/packages/client-rust/src/models/token_view.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TokenView : Show token's current key +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TokenView { + #[serde(rename = "key")] + pub key: String, +} + +impl TokenView { + /// Show token's current key + pub fn new(key: String) -> TokenView { + TokenView { key } + } +} diff --git a/packages/client-rust/src/models/totp_device.rs b/packages/client-rust/src/models/totp_device.rs new file mode 100644 index 0000000000..3c641c8a17 --- /dev/null +++ b/packages/client-rust/src/models/totp_device.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TotpDevice : Serializer for totp authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TotpDevice { + /// The human-readable name of this device. + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "user")] + pub user: models::PartialUser, +} + +impl TotpDevice { + /// Serializer for totp authenticator devices + pub fn new(name: String, pk: i32, user: models::PartialUser) -> TotpDevice { + TotpDevice { name, pk, user } + } +} diff --git a/packages/client-rust/src/models/totp_device_request.rs b/packages/client-rust/src/models/totp_device_request.rs new file mode 100644 index 0000000000..be509dd9d9 --- /dev/null +++ b/packages/client-rust/src/models/totp_device_request.rs @@ -0,0 +1,26 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TotpDeviceRequest : Serializer for totp authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TotpDeviceRequest { + /// The human-readable name of this device. + #[serde(rename = "name")] + pub name: String, +} + +impl TotpDeviceRequest { + /// Serializer for totp authenticator devices + pub fn new(name: String) -> TotpDeviceRequest { + TotpDeviceRequest { name } + } +} diff --git a/packages/client-rust/src/models/transaction_application_request.rs b/packages/client-rust/src/models/transaction_application_request.rs new file mode 100644 index 0000000000..d8812255fb --- /dev/null +++ b/packages/client-rust/src/models/transaction_application_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TransactionApplicationRequest : Serializer for creating a provider and an application in one +/// transaction +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionApplicationRequest { + #[serde(rename = "app")] + pub app: models::ApplicationRequest, + #[serde(rename = "provider_model")] + pub provider_model: models::ProviderModelEnum, + #[serde(rename = "provider")] + pub provider: models::ModelRequest, + #[serde(rename = "policy_bindings", skip_serializing_if = "Option::is_none")] + pub policy_bindings: Option>, +} + +impl TransactionApplicationRequest { + /// Serializer for creating a provider and an application in one transaction + pub fn new( + app: models::ApplicationRequest, + provider_model: models::ProviderModelEnum, + provider: models::ModelRequest, + ) -> TransactionApplicationRequest { + TransactionApplicationRequest { + app, + provider_model, + provider, + policy_bindings: None, + } + } +} diff --git a/packages/client-rust/src/models/transaction_application_response.rs b/packages/client-rust/src/models/transaction_application_response.rs new file mode 100644 index 0000000000..7c2c77cf7d --- /dev/null +++ b/packages/client-rust/src/models/transaction_application_response.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TransactionApplicationResponse : Transactional creation response +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionApplicationResponse { + #[serde(rename = "applied")] + pub applied: bool, + #[serde(rename = "logs")] + pub logs: Vec, +} + +impl TransactionApplicationResponse { + /// Transactional creation response + pub fn new(applied: bool, logs: Vec) -> TransactionApplicationResponse { + TransactionApplicationResponse { applied, logs } + } +} diff --git a/packages/client-rust/src/models/transaction_policy_binding_request.rs b/packages/client-rust/src/models/transaction_policy_binding_request.rs new file mode 100644 index 0000000000..b7aefe4658 --- /dev/null +++ b/packages/client-rust/src/models/transaction_policy_binding_request.rs @@ -0,0 +1,67 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TransactionPolicyBindingRequest : PolicyBindingSerializer which does not require target as +/// target is set implicitly +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransactionPolicyBindingRequest { + #[serde( + rename = "policy", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub policy: Option>, + #[serde( + rename = "group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub group: Option>, + #[serde( + rename = "user", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub user: Option>, + /// Negates the outcome of the policy. Messages are unaffected. + #[serde(rename = "negate", skip_serializing_if = "Option::is_none")] + pub negate: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "order")] + pub order: i32, + /// Timeout after which Policy execution is terminated. + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + /// Result if the Policy execution fails. + #[serde(rename = "failure_result", skip_serializing_if = "Option::is_none")] + pub failure_result: Option, +} + +impl TransactionPolicyBindingRequest { + /// PolicyBindingSerializer which does not require target as target is set implicitly + pub fn new(order: i32) -> TransactionPolicyBindingRequest { + TransactionPolicyBindingRequest { + policy: None, + group: None, + user: None, + negate: None, + enabled: None, + order, + timeout: None, + failure_result: None, + } + } +} diff --git a/packages/client-rust/src/models/type_create.rs b/packages/client-rust/src/models/type_create.rs new file mode 100644 index 0000000000..c38da386eb --- /dev/null +++ b/packages/client-rust/src/models/type_create.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// TypeCreate : Types of an object that can be created +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct TypeCreate { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "component")] + pub component: String, + #[serde(rename = "model_name")] + pub model_name: String, + #[serde(rename = "icon_url", skip_serializing_if = "Option::is_none")] + pub icon_url: Option, + #[serde( + rename = "requires_enterprise", + skip_serializing_if = "Option::is_none" + )] + pub requires_enterprise: Option, + #[serde(rename = "deprecated", skip_serializing_if = "Option::is_none")] + pub deprecated: Option, +} + +impl TypeCreate { + /// Types of an object that can be created + pub fn new( + name: String, + description: String, + component: String, + model_name: String, + ) -> TypeCreate { + TypeCreate { + name, + description, + component, + model_name, + icon_url: None, + requires_enterprise: None, + deprecated: None, + } + } +} diff --git a/packages/client-rust/src/models/ui_theme_enum.rs b/packages/client-rust/src/models/ui_theme_enum.rs new file mode 100644 index 0000000000..961a53e099 --- /dev/null +++ b/packages/client-rust/src/models/ui_theme_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UiThemeEnum { + #[serde(rename = "automatic")] + Automatic, + #[serde(rename = "light")] + Light, + #[serde(rename = "dark")] + Dark, +} + +impl std::fmt::Display for UiThemeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Automatic => write!(f, "automatic"), + Self::Light => write!(f, "light"), + Self::Dark => write!(f, "dark"), + } + } +} + +impl Default for UiThemeEnum { + fn default() -> UiThemeEnum { + Self::Automatic + } +} diff --git a/packages/client-rust/src/models/unique_password_policy.rs b/packages/client-rust/src/models/unique_password_policy.rs new file mode 100644 index 0000000000..deb29ebb6f --- /dev/null +++ b/packages/client-rust/src/models/unique_password_policy.rs @@ -0,0 +1,74 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UniquePasswordPolicy : Password Uniqueness Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UniquePasswordPolicy { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + /// Return objects policy is bound to + #[serde(rename = "bound_to")] + pub bound_to: i32, + /// Field key to check, field keys defined in Prompt stages are available. + #[serde(rename = "password_field", skip_serializing_if = "Option::is_none")] + pub password_field: Option, + /// Number of passwords to check against. + #[serde( + rename = "num_historical_passwords", + skip_serializing_if = "Option::is_none" + )] + pub num_historical_passwords: Option, +} + +impl UniquePasswordPolicy { + /// Password Uniqueness Policy Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + bound_to: i32, + ) -> UniquePasswordPolicy { + UniquePasswordPolicy { + pk, + name, + execution_logging: None, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + bound_to, + password_field: None, + num_historical_passwords: None, + } + } +} diff --git a/packages/client-rust/src/models/unique_password_policy_request.rs b/packages/client-rust/src/models/unique_password_policy_request.rs new file mode 100644 index 0000000000..7720a98019 --- /dev/null +++ b/packages/client-rust/src/models/unique_password_policy_request.rs @@ -0,0 +1,43 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UniquePasswordPolicyRequest : Password Uniqueness Policy Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UniquePasswordPolicyRequest { + #[serde(rename = "name")] + pub name: String, + /// When this option is enabled, all executions of this policy will be logged. By default, only + /// execution errors are logged. + #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] + pub execution_logging: Option, + /// Field key to check, field keys defined in Prompt stages are available. + #[serde(rename = "password_field", skip_serializing_if = "Option::is_none")] + pub password_field: Option, + /// Number of passwords to check against. + #[serde( + rename = "num_historical_passwords", + skip_serializing_if = "Option::is_none" + )] + pub num_historical_passwords: Option, +} + +impl UniquePasswordPolicyRequest { + /// Password Uniqueness Policy Serializer + pub fn new(name: String) -> UniquePasswordPolicyRequest { + UniquePasswordPolicyRequest { + name, + execution_logging: None, + password_field: None, + num_historical_passwords: None, + } + } +} diff --git a/packages/client-rust/src/models/used_by.rs b/packages/client-rust/src/models/used_by.rs new file mode 100644 index 0000000000..b6dca32fe4 --- /dev/null +++ b/packages/client-rust/src/models/used_by.rs @@ -0,0 +1,45 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UsedBy : A list of all objects referencing the queried object +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UsedBy { + #[serde(rename = "app")] + pub app: String, + #[serde(rename = "model_name")] + pub model_name: String, + #[serde(rename = "pk")] + pub pk: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "action")] + pub action: models::UsedByActionEnum, +} + +impl UsedBy { + /// A list of all objects referencing the queried object + pub fn new( + app: String, + model_name: String, + pk: String, + name: String, + action: models::UsedByActionEnum, + ) -> UsedBy { + UsedBy { + app, + model_name, + pk, + name, + action, + } + } +} diff --git a/packages/client-rust/src/models/used_by_action_enum.rs b/packages/client-rust/src/models/used_by_action_enum.rs new file mode 100644 index 0000000000..6543a50d1a --- /dev/null +++ b/packages/client-rust/src/models/used_by_action_enum.rs @@ -0,0 +1,44 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UsedByActionEnum { + #[serde(rename = "cascade")] + Cascade, + #[serde(rename = "cascade_many")] + CascadeMany, + #[serde(rename = "set_null")] + SetNull, + #[serde(rename = "set_default")] + SetDefault, + #[serde(rename = "left_dangling")] + LeftDangling, +} + +impl std::fmt::Display for UsedByActionEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Cascade => write!(f, "cascade"), + Self::CascadeMany => write!(f, "cascade_many"), + Self::SetNull => write!(f, "set_null"), + Self::SetDefault => write!(f, "set_default"), + Self::LeftDangling => write!(f, "left_dangling"), + } + } +} + +impl Default for UsedByActionEnum { + fn default() -> UsedByActionEnum { + Self::Cascade + } +} diff --git a/packages/client-rust/src/models/user.rs b/packages/client-rust/src/models/user.rs new file mode 100644 index 0000000000..80d04fbe5e --- /dev/null +++ b/packages/client-rust/src/models/user.rs @@ -0,0 +1,106 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// User : User Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct User { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "username")] + pub username: String, + /// User's display name. + #[serde(rename = "name")] + pub name: String, + /// Designates whether this user should be treated as active. Unselect this instead of deleting + /// accounts. + #[serde(rename = "is_active", skip_serializing_if = "Option::is_none")] + pub is_active: Option, + #[serde( + rename = "last_login", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub last_login: Option>, + #[serde(rename = "date_joined")] + pub date_joined: String, + #[serde(rename = "is_superuser")] + pub is_superuser: bool, + #[serde(rename = "groups", skip_serializing_if = "Option::is_none")] + pub groups: Option>, + #[serde(rename = "groups_obj", deserialize_with = "Option::deserialize")] + pub groups_obj: Option>, + #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] + pub roles: Option>, + #[serde(rename = "roles_obj", deserialize_with = "Option::deserialize")] + pub roles_obj: Option>, + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + /// User's avatar, either a http/https URL or a data URI + #[serde(rename = "avatar")] + pub avatar: String, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, + #[serde(rename = "uid")] + pub uid: String, + #[serde(rename = "path", skip_serializing_if = "Option::is_none")] + pub path: Option, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "uuid")] + pub uuid: uuid::Uuid, + #[serde(rename = "password_change_date")] + pub password_change_date: String, + #[serde(rename = "last_updated")] + pub last_updated: String, +} + +impl User { + /// User Serializer + pub fn new( + pk: i32, + username: String, + name: String, + date_joined: String, + is_superuser: bool, + groups_obj: Option>, + roles_obj: Option>, + avatar: String, + uid: String, + uuid: uuid::Uuid, + password_change_date: String, + last_updated: String, + ) -> User { + User { + pk, + username, + name, + is_active: None, + last_login: None, + date_joined, + is_superuser, + groups: None, + groups_obj, + roles: None, + roles_obj, + email: None, + avatar, + attributes: None, + uid, + path: None, + r#type: None, + uuid, + password_change_date, + last_updated, + } + } +} diff --git a/packages/client-rust/src/models/user_account_request.rs b/packages/client-rust/src/models/user_account_request.rs new file mode 100644 index 0000000000..97de2c081a --- /dev/null +++ b/packages/client-rust/src/models/user_account_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserAccountRequest : Account adding/removing operations +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserAccountRequest { + #[serde(rename = "pk")] + pub pk: i32, +} + +impl UserAccountRequest { + /// Account adding/removing operations + pub fn new(pk: i32) -> UserAccountRequest { + UserAccountRequest { pk } + } +} diff --git a/packages/client-rust/src/models/user_account_serializer_for_role_request.rs b/packages/client-rust/src/models/user_account_serializer_for_role_request.rs new file mode 100644 index 0000000000..6d5a3936f5 --- /dev/null +++ b/packages/client-rust/src/models/user_account_serializer_for_role_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserAccountSerializerForRoleRequest : Account adding/removing operations +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserAccountSerializerForRoleRequest { + #[serde(rename = "pk")] + pub pk: i32, +} + +impl UserAccountSerializerForRoleRequest { + /// Account adding/removing operations + pub fn new(pk: i32) -> UserAccountSerializerForRoleRequest { + UserAccountSerializerForRoleRequest { pk } + } +} diff --git a/packages/client-rust/src/models/user_attribute_enum.rs b/packages/client-rust/src/models/user_attribute_enum.rs new file mode 100644 index 0000000000..9a99c3bb7e --- /dev/null +++ b/packages/client-rust/src/models/user_attribute_enum.rs @@ -0,0 +1,35 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UserAttributeEnum { + #[serde(rename = "username")] + Username, + #[serde(rename = "email")] + Email, +} + +impl std::fmt::Display for UserAttributeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Username => write!(f, "username"), + Self::Email => write!(f, "email"), + } + } +} + +impl Default for UserAttributeEnum { + fn default() -> UserAttributeEnum { + Self::Username + } +} diff --git a/packages/client-rust/src/models/user_consent.rs b/packages/client-rust/src/models/user_consent.rs new file mode 100644 index 0000000000..16d91365c3 --- /dev/null +++ b/packages/client-rust/src/models/user_consent.rs @@ -0,0 +1,47 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserConsent : UserConsent Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserConsent { + #[serde(rename = "pk")] + pub pk: i32, + #[serde( + rename = "expires", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub expires: Option>, + #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] + pub expiring: Option, + #[serde(rename = "user")] + pub user: models::User, + #[serde(rename = "application")] + pub application: models::Application, + #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] + pub permissions: Option, +} + +impl UserConsent { + /// UserConsent Serializer + pub fn new(pk: i32, user: models::User, application: models::Application) -> UserConsent { + UserConsent { + pk, + expires: None, + expiring: None, + user, + application, + permissions: None, + } + } +} diff --git a/packages/client-rust/src/models/user_creation_mode_enum.rs b/packages/client-rust/src/models/user_creation_mode_enum.rs new file mode 100644 index 0000000000..41e581df88 --- /dev/null +++ b/packages/client-rust/src/models/user_creation_mode_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UserCreationModeEnum { + #[serde(rename = "never_create")] + NeverCreate, + #[serde(rename = "create_when_required")] + CreateWhenRequired, + #[serde(rename = "always_create")] + AlwaysCreate, +} + +impl std::fmt::Display for UserCreationModeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::NeverCreate => write!(f, "never_create"), + Self::CreateWhenRequired => write!(f, "create_when_required"), + Self::AlwaysCreate => write!(f, "always_create"), + } + } +} + +impl Default for UserCreationModeEnum { + fn default() -> UserCreationModeEnum { + Self::NeverCreate + } +} diff --git a/packages/client-rust/src/models/user_delete_stage.rs b/packages/client-rust/src/models/user_delete_stage.rs new file mode 100644 index 0000000000..731c7d30f2 --- /dev/null +++ b/packages/client-rust/src/models/user_delete_stage.rs @@ -0,0 +1,57 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserDeleteStage : UserDeleteStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserDeleteStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, +} + +impl UserDeleteStage { + /// UserDeleteStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + ) -> UserDeleteStage { + UserDeleteStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + } + } +} diff --git a/packages/client-rust/src/models/user_delete_stage_request.rs b/packages/client-rust/src/models/user_delete_stage_request.rs new file mode 100644 index 0000000000..9c1412cd57 --- /dev/null +++ b/packages/client-rust/src/models/user_delete_stage_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserDeleteStageRequest : UserDeleteStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserDeleteStageRequest { + #[serde(rename = "name")] + pub name: String, +} + +impl UserDeleteStageRequest { + /// UserDeleteStage Serializer + pub fn new(name: String) -> UserDeleteStageRequest { + UserDeleteStageRequest { name } + } +} diff --git a/packages/client-rust/src/models/user_fields_enum.rs b/packages/client-rust/src/models/user_fields_enum.rs new file mode 100644 index 0000000000..23454ac978 --- /dev/null +++ b/packages/client-rust/src/models/user_fields_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UserFieldsEnum { + #[serde(rename = "email")] + Email, + #[serde(rename = "username")] + Username, + #[serde(rename = "upn")] + Upn, +} + +impl std::fmt::Display for UserFieldsEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Email => write!(f, "email"), + Self::Username => write!(f, "username"), + Self::Upn => write!(f, "upn"), + } + } +} + +impl Default for UserFieldsEnum { + fn default() -> UserFieldsEnum { + Self::Email + } +} diff --git a/packages/client-rust/src/models/user_kerberos_source_connection.rs b/packages/client-rust/src/models/user_kerberos_source_connection.rs new file mode 100644 index 0000000000..eb48a1580a --- /dev/null +++ b/packages/client-rust/src/models/user_kerberos_source_connection.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserKerberosSourceConnection : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserKerberosSourceConnection { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "source_obj")] + pub source_obj: models::Source, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "last_updated")] + pub last_updated: String, +} + +impl UserKerberosSourceConnection { + /// User source connection + pub fn new( + pk: i32, + user: i32, + source: uuid::Uuid, + source_obj: models::Source, + identifier: String, + created: String, + last_updated: String, + ) -> UserKerberosSourceConnection { + UserKerberosSourceConnection { + pk, + user, + source, + source_obj, + identifier, + created, + last_updated, + } + } +} diff --git a/packages/client-rust/src/models/user_kerberos_source_connection_request.rs b/packages/client-rust/src/models/user_kerberos_source_connection_request.rs new file mode 100644 index 0000000000..3e2350f268 --- /dev/null +++ b/packages/client-rust/src/models/user_kerberos_source_connection_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserKerberosSourceConnectionRequest : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserKerberosSourceConnectionRequest { + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "identifier")] + pub identifier: String, +} + +impl UserKerberosSourceConnectionRequest { + /// User source connection + pub fn new( + user: i32, + source: uuid::Uuid, + identifier: String, + ) -> UserKerberosSourceConnectionRequest { + UserKerberosSourceConnectionRequest { + user, + source, + identifier, + } + } +} diff --git a/packages/client-rust/src/models/user_ldap_source_connection.rs b/packages/client-rust/src/models/user_ldap_source_connection.rs new file mode 100644 index 0000000000..9a8ff08a2a --- /dev/null +++ b/packages/client-rust/src/models/user_ldap_source_connection.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserLdapSourceConnection : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserLdapSourceConnection { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "source_obj")] + pub source_obj: models::Source, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "last_updated")] + pub last_updated: String, +} + +impl UserLdapSourceConnection { + /// User source connection + pub fn new( + pk: i32, + user: i32, + source: uuid::Uuid, + source_obj: models::Source, + identifier: String, + created: String, + last_updated: String, + ) -> UserLdapSourceConnection { + UserLdapSourceConnection { + pk, + user, + source, + source_obj, + identifier, + created, + last_updated, + } + } +} diff --git a/packages/client-rust/src/models/user_ldap_source_connection_request.rs b/packages/client-rust/src/models/user_ldap_source_connection_request.rs new file mode 100644 index 0000000000..f311f4ddd2 --- /dev/null +++ b/packages/client-rust/src/models/user_ldap_source_connection_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserLdapSourceConnectionRequest : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserLdapSourceConnectionRequest { + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "identifier")] + pub identifier: String, +} + +impl UserLdapSourceConnectionRequest { + /// User source connection + pub fn new( + user: i32, + source: uuid::Uuid, + identifier: String, + ) -> UserLdapSourceConnectionRequest { + UserLdapSourceConnectionRequest { + user, + source, + identifier, + } + } +} diff --git a/packages/client-rust/src/models/user_login_challenge.rs b/packages/client-rust/src/models/user_login_challenge.rs new file mode 100644 index 0000000000..576152536a --- /dev/null +++ b/packages/client-rust/src/models/user_login_challenge.rs @@ -0,0 +1,39 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserLoginChallenge : Empty challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserLoginChallenge { + #[serde(rename = "flow_info", skip_serializing_if = "Option::is_none")] + pub flow_info: Option, + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "response_errors", skip_serializing_if = "Option::is_none")] + pub response_errors: Option>>, + #[serde(rename = "pending_user")] + pub pending_user: String, + #[serde(rename = "pending_user_avatar")] + pub pending_user_avatar: String, +} + +impl UserLoginChallenge { + /// Empty challenge + pub fn new(pending_user: String, pending_user_avatar: String) -> UserLoginChallenge { + UserLoginChallenge { + flow_info: None, + component: None, + response_errors: None, + pending_user, + pending_user_avatar, + } + } +} diff --git a/packages/client-rust/src/models/user_login_challenge_response_request.rs b/packages/client-rust/src/models/user_login_challenge_response_request.rs new file mode 100644 index 0000000000..dc202635b7 --- /dev/null +++ b/packages/client-rust/src/models/user_login_challenge_response_request.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserLoginChallengeResponseRequest : User login challenge +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserLoginChallengeResponseRequest { + #[serde(rename = "component", skip_serializing_if = "Option::is_none")] + pub component: Option, + #[serde(rename = "remember_me")] + pub remember_me: bool, +} + +impl UserLoginChallengeResponseRequest { + /// User login challenge + pub fn new(remember_me: bool) -> UserLoginChallengeResponseRequest { + UserLoginChallengeResponseRequest { + component: None, + remember_me, + } + } +} diff --git a/packages/client-rust/src/models/user_login_stage.rs b/packages/client-rust/src/models/user_login_stage.rs new file mode 100644 index 0000000000..0d22b91ae2 --- /dev/null +++ b/packages/client-rust/src/models/user_login_stage.rs @@ -0,0 +1,88 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserLoginStage : UserLoginStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserLoginStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + /// Determines how long a session lasts. Default of 0 means that the sessions lasts until the + /// browser is closed. (Format: hours=-1;minutes=-2;seconds=-3) + #[serde(rename = "session_duration", skip_serializing_if = "Option::is_none")] + pub session_duration: Option, + /// Terminate all other sessions of the user logging in. + #[serde( + rename = "terminate_other_sessions", + skip_serializing_if = "Option::is_none" + )] + pub terminate_other_sessions: Option, + /// Offset the session will be extended by when the user picks the remember me option. Default + /// of 0 means that the remember me option will not be shown. (Format: + /// hours=-1;minutes=-2;seconds=-3) + #[serde(rename = "remember_me_offset", skip_serializing_if = "Option::is_none")] + pub remember_me_offset: Option, + /// Bind sessions created by this stage to the configured network + #[serde(rename = "network_binding", skip_serializing_if = "Option::is_none")] + pub network_binding: Option, + /// Bind sessions created by this stage to the configured GeoIP location + #[serde(rename = "geoip_binding", skip_serializing_if = "Option::is_none")] + pub geoip_binding: Option, + /// When set to a non-zero value, authentik will save a cookie with a longer expiry,to remember + /// the device the user is logging in from. (Format: hours=-1;minutes=-2;seconds=-3) + #[serde(rename = "remember_device", skip_serializing_if = "Option::is_none")] + pub remember_device: Option, +} + +impl UserLoginStage { + /// UserLoginStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + ) -> UserLoginStage { + UserLoginStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + session_duration: None, + terminate_other_sessions: None, + remember_me_offset: None, + network_binding: None, + geoip_binding: None, + remember_device: None, + } + } +} diff --git a/packages/client-rust/src/models/user_login_stage_request.rs b/packages/client-rust/src/models/user_login_stage_request.rs new file mode 100644 index 0000000000..ace35d9acc --- /dev/null +++ b/packages/client-rust/src/models/user_login_stage_request.rs @@ -0,0 +1,58 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserLoginStageRequest : UserLoginStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserLoginStageRequest { + #[serde(rename = "name")] + pub name: String, + /// Determines how long a session lasts. Default of 0 means that the sessions lasts until the + /// browser is closed. (Format: hours=-1;minutes=-2;seconds=-3) + #[serde(rename = "session_duration", skip_serializing_if = "Option::is_none")] + pub session_duration: Option, + /// Terminate all other sessions of the user logging in. + #[serde( + rename = "terminate_other_sessions", + skip_serializing_if = "Option::is_none" + )] + pub terminate_other_sessions: Option, + /// Offset the session will be extended by when the user picks the remember me option. Default + /// of 0 means that the remember me option will not be shown. (Format: + /// hours=-1;minutes=-2;seconds=-3) + #[serde(rename = "remember_me_offset", skip_serializing_if = "Option::is_none")] + pub remember_me_offset: Option, + /// Bind sessions created by this stage to the configured network + #[serde(rename = "network_binding", skip_serializing_if = "Option::is_none")] + pub network_binding: Option, + /// Bind sessions created by this stage to the configured GeoIP location + #[serde(rename = "geoip_binding", skip_serializing_if = "Option::is_none")] + pub geoip_binding: Option, + /// When set to a non-zero value, authentik will save a cookie with a longer expiry,to remember + /// the device the user is logging in from. (Format: hours=-1;minutes=-2;seconds=-3) + #[serde(rename = "remember_device", skip_serializing_if = "Option::is_none")] + pub remember_device: Option, +} + +impl UserLoginStageRequest { + /// UserLoginStage Serializer + pub fn new(name: String) -> UserLoginStageRequest { + UserLoginStageRequest { + name, + session_duration: None, + terminate_other_sessions: None, + remember_me_offset: None, + network_binding: None, + geoip_binding: None, + remember_device: None, + } + } +} diff --git a/packages/client-rust/src/models/user_logout_stage.rs b/packages/client-rust/src/models/user_logout_stage.rs new file mode 100644 index 0000000000..43366a6b0c --- /dev/null +++ b/packages/client-rust/src/models/user_logout_stage.rs @@ -0,0 +1,57 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserLogoutStage : UserLogoutStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserLogoutStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, +} + +impl UserLogoutStage { + /// UserLogoutStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + ) -> UserLogoutStage { + UserLogoutStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + } + } +} diff --git a/packages/client-rust/src/models/user_logout_stage_request.rs b/packages/client-rust/src/models/user_logout_stage_request.rs new file mode 100644 index 0000000000..c31b273008 --- /dev/null +++ b/packages/client-rust/src/models/user_logout_stage_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserLogoutStageRequest : UserLogoutStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserLogoutStageRequest { + #[serde(rename = "name")] + pub name: String, +} + +impl UserLogoutStageRequest { + /// UserLogoutStage Serializer + pub fn new(name: String) -> UserLogoutStageRequest { + UserLogoutStageRequest { name } + } +} diff --git a/packages/client-rust/src/models/user_matching_mode_enum.rs b/packages/client-rust/src/models/user_matching_mode_enum.rs new file mode 100644 index 0000000000..abc8b90f5f --- /dev/null +++ b/packages/client-rust/src/models/user_matching_mode_enum.rs @@ -0,0 +1,44 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UserMatchingModeEnum { + #[serde(rename = "identifier")] + Identifier, + #[serde(rename = "email_link")] + EmailLink, + #[serde(rename = "email_deny")] + EmailDeny, + #[serde(rename = "username_link")] + UsernameLink, + #[serde(rename = "username_deny")] + UsernameDeny, +} + +impl std::fmt::Display for UserMatchingModeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Identifier => write!(f, "identifier"), + Self::EmailLink => write!(f, "email_link"), + Self::EmailDeny => write!(f, "email_deny"), + Self::UsernameLink => write!(f, "username_link"), + Self::UsernameDeny => write!(f, "username_deny"), + } + } +} + +impl Default for UserMatchingModeEnum { + fn default() -> UserMatchingModeEnum { + Self::Identifier + } +} diff --git a/packages/client-rust/src/models/user_o_auth_source_connection.rs b/packages/client-rust/src/models/user_o_auth_source_connection.rs new file mode 100644 index 0000000000..acce0747fc --- /dev/null +++ b/packages/client-rust/src/models/user_o_auth_source_connection.rs @@ -0,0 +1,56 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserOAuthSourceConnection : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserOAuthSourceConnection { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "source_obj")] + pub source_obj: models::Source, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "last_updated")] + pub last_updated: String, + #[serde(rename = "expires", skip_serializing_if = "Option::is_none")] + pub expires: Option, +} + +impl UserOAuthSourceConnection { + /// User source connection + pub fn new( + pk: i32, + user: i32, + source: uuid::Uuid, + source_obj: models::Source, + identifier: String, + created: String, + last_updated: String, + ) -> UserOAuthSourceConnection { + UserOAuthSourceConnection { + pk, + user, + source, + source_obj, + identifier, + created, + last_updated, + expires: None, + } + } +} diff --git a/packages/client-rust/src/models/user_o_auth_source_connection_request.rs b/packages/client-rust/src/models/user_o_auth_source_connection_request.rs new file mode 100644 index 0000000000..1624fb30b7 --- /dev/null +++ b/packages/client-rust/src/models/user_o_auth_source_connection_request.rs @@ -0,0 +1,48 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserOAuthSourceConnectionRequest : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserOAuthSourceConnectionRequest { + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde( + rename = "access_token", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub access_token: Option>, + #[serde(rename = "expires", skip_serializing_if = "Option::is_none")] + pub expires: Option, +} + +impl UserOAuthSourceConnectionRequest { + /// User source connection + pub fn new( + user: i32, + source: uuid::Uuid, + identifier: String, + ) -> UserOAuthSourceConnectionRequest { + UserOAuthSourceConnectionRequest { + user, + source, + identifier, + access_token: None, + expires: None, + } + } +} diff --git a/packages/client-rust/src/models/user_password_set_request.rs b/packages/client-rust/src/models/user_password_set_request.rs new file mode 100644 index 0000000000..061064a9ee --- /dev/null +++ b/packages/client-rust/src/models/user_password_set_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserPasswordSetRequest : Payload to set a users' password directly +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserPasswordSetRequest { + #[serde(rename = "password")] + pub password: String, +} + +impl UserPasswordSetRequest { + /// Payload to set a users' password directly + pub fn new(password: String) -> UserPasswordSetRequest { + UserPasswordSetRequest { password } + } +} diff --git a/packages/client-rust/src/models/user_path.rs b/packages/client-rust/src/models/user_path.rs new file mode 100644 index 0000000000..8e31fa7dee --- /dev/null +++ b/packages/client-rust/src/models/user_path.rs @@ -0,0 +1,23 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserPath { + #[serde(rename = "paths")] + pub paths: Vec, +} + +impl UserPath { + pub fn new(paths: Vec) -> UserPath { + UserPath { paths } + } +} diff --git a/packages/client-rust/src/models/user_plex_source_connection.rs b/packages/client-rust/src/models/user_plex_source_connection.rs new file mode 100644 index 0000000000..b9374091a7 --- /dev/null +++ b/packages/client-rust/src/models/user_plex_source_connection.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserPlexSourceConnection : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserPlexSourceConnection { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "source_obj")] + pub source_obj: models::Source, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "last_updated")] + pub last_updated: String, +} + +impl UserPlexSourceConnection { + /// User source connection + pub fn new( + pk: i32, + user: i32, + source: uuid::Uuid, + source_obj: models::Source, + identifier: String, + created: String, + last_updated: String, + ) -> UserPlexSourceConnection { + UserPlexSourceConnection { + pk, + user, + source, + source_obj, + identifier, + created, + last_updated, + } + } +} diff --git a/packages/client-rust/src/models/user_plex_source_connection_request.rs b/packages/client-rust/src/models/user_plex_source_connection_request.rs new file mode 100644 index 0000000000..5d4ef8fc9a --- /dev/null +++ b/packages/client-rust/src/models/user_plex_source_connection_request.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserPlexSourceConnectionRequest : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserPlexSourceConnectionRequest { + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "plex_token")] + pub plex_token: String, +} + +impl UserPlexSourceConnectionRequest { + /// User source connection + pub fn new( + user: i32, + source: uuid::Uuid, + identifier: String, + plex_token: String, + ) -> UserPlexSourceConnectionRequest { + UserPlexSourceConnectionRequest { + user, + source, + identifier, + plex_token, + } + } +} diff --git a/packages/client-rust/src/models/user_recovery_email_request.rs b/packages/client-rust/src/models/user_recovery_email_request.rs new file mode 100644 index 0000000000..e3d64062f3 --- /dev/null +++ b/packages/client-rust/src/models/user_recovery_email_request.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserRecoveryEmailRequest : Payload to create and email a recovery link +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserRecoveryEmailRequest { + #[serde(rename = "token_duration", skip_serializing_if = "Option::is_none")] + pub token_duration: Option, + #[serde(rename = "email_stage")] + pub email_stage: uuid::Uuid, +} + +impl UserRecoveryEmailRequest { + /// Payload to create and email a recovery link + pub fn new(email_stage: uuid::Uuid) -> UserRecoveryEmailRequest { + UserRecoveryEmailRequest { + token_duration: None, + email_stage, + } + } +} diff --git a/packages/client-rust/src/models/user_recovery_link_request.rs b/packages/client-rust/src/models/user_recovery_link_request.rs new file mode 100644 index 0000000000..6aa28544d8 --- /dev/null +++ b/packages/client-rust/src/models/user_recovery_link_request.rs @@ -0,0 +1,27 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserRecoveryLinkRequest : Payload to create a recovery link +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserRecoveryLinkRequest { + #[serde(rename = "token_duration", skip_serializing_if = "Option::is_none")] + pub token_duration: Option, +} + +impl UserRecoveryLinkRequest { + /// Payload to create a recovery link + pub fn new() -> UserRecoveryLinkRequest { + UserRecoveryLinkRequest { + token_duration: None, + } + } +} diff --git a/packages/client-rust/src/models/user_request.rs b/packages/client-rust/src/models/user_request.rs new file mode 100644 index 0000000000..ce26ee070c --- /dev/null +++ b/packages/client-rust/src/models/user_request.rs @@ -0,0 +1,62 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserRequest : User Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserRequest { + #[serde(rename = "username")] + pub username: String, + /// User's display name. + #[serde(rename = "name")] + pub name: String, + /// Designates whether this user should be treated as active. Unselect this instead of deleting + /// accounts. + #[serde(rename = "is_active", skip_serializing_if = "Option::is_none")] + pub is_active: Option, + #[serde( + rename = "last_login", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub last_login: Option>, + #[serde(rename = "groups", skip_serializing_if = "Option::is_none")] + pub groups: Option>, + #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] + pub roles: Option>, + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub attributes: Option>, + #[serde(rename = "path", skip_serializing_if = "Option::is_none")] + pub path: Option, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, +} + +impl UserRequest { + /// User Serializer + pub fn new(username: String, name: String) -> UserRequest { + UserRequest { + username, + name, + is_active: None, + last_login: None, + groups: None, + roles: None, + email: None, + attributes: None, + path: None, + r#type: None, + } + } +} diff --git a/packages/client-rust/src/models/user_saml_source_connection.rs b/packages/client-rust/src/models/user_saml_source_connection.rs new file mode 100644 index 0000000000..6e62431e8f --- /dev/null +++ b/packages/client-rust/src/models/user_saml_source_connection.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserSamlSourceConnection : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserSamlSourceConnection { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "source_obj")] + pub source_obj: models::Source, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "last_updated")] + pub last_updated: String, +} + +impl UserSamlSourceConnection { + /// User source connection + pub fn new( + pk: i32, + user: i32, + source: uuid::Uuid, + source_obj: models::Source, + identifier: String, + created: String, + last_updated: String, + ) -> UserSamlSourceConnection { + UserSamlSourceConnection { + pk, + user, + source, + source_obj, + identifier, + created, + last_updated, + } + } +} diff --git a/packages/client-rust/src/models/user_saml_source_connection_request.rs b/packages/client-rust/src/models/user_saml_source_connection_request.rs new file mode 100644 index 0000000000..cd55324ead --- /dev/null +++ b/packages/client-rust/src/models/user_saml_source_connection_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserSamlSourceConnectionRequest : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserSamlSourceConnectionRequest { + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "identifier")] + pub identifier: String, +} + +impl UserSamlSourceConnectionRequest { + /// User source connection + pub fn new( + user: i32, + source: uuid::Uuid, + identifier: String, + ) -> UserSamlSourceConnectionRequest { + UserSamlSourceConnectionRequest { + user, + source, + identifier, + } + } +} diff --git a/packages/client-rust/src/models/user_self.rs b/packages/client-rust/src/models/user_self.rs new file mode 100644 index 0000000000..f05c8eaccf --- /dev/null +++ b/packages/client-rust/src/models/user_self.rs @@ -0,0 +1,82 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserSelf : User Serializer for information a user can retrieve about themselves +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserSelf { + #[serde(rename = "pk")] + pub pk: i32, + /// Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + #[serde(rename = "username")] + pub username: String, + /// User's display name. + #[serde(rename = "name")] + pub name: String, + /// Designates whether this user should be treated as active. Unselect this instead of deleting + /// accounts. + #[serde(rename = "is_active")] + pub is_active: bool, + #[serde(rename = "is_superuser")] + pub is_superuser: bool, + #[serde(rename = "groups")] + pub groups: Vec, + #[serde(rename = "roles")] + pub roles: Vec, + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + /// User's avatar, either a http/https URL or a data URI + #[serde(rename = "avatar")] + pub avatar: String, + #[serde(rename = "uid")] + pub uid: String, + /// Get user settings with brand and group settings applied + #[serde(rename = "settings")] + pub settings: std::collections::HashMap, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + /// Get all system permissions assigned to the user + #[serde(rename = "system_permissions")] + pub system_permissions: Vec, +} + +impl UserSelf { + /// User Serializer for information a user can retrieve about themselves + pub fn new( + pk: i32, + username: String, + name: String, + is_active: bool, + is_superuser: bool, + groups: Vec, + roles: Vec, + avatar: String, + uid: String, + settings: std::collections::HashMap, + system_permissions: Vec, + ) -> UserSelf { + UserSelf { + pk, + username, + name, + is_active, + is_superuser, + groups, + roles, + email: None, + avatar, + uid, + settings, + r#type: None, + system_permissions, + } + } +} diff --git a/packages/client-rust/src/models/user_self_groups.rs b/packages/client-rust/src/models/user_self_groups.rs new file mode 100644 index 0000000000..d377d2da2f --- /dev/null +++ b/packages/client-rust/src/models/user_self_groups.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserSelfGroups { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "pk")] + pub pk: String, +} + +impl UserSelfGroups { + pub fn new(name: String, pk: String) -> UserSelfGroups { + UserSelfGroups { name, pk } + } +} diff --git a/packages/client-rust/src/models/user_self_roles.rs b/packages/client-rust/src/models/user_self_roles.rs new file mode 100644 index 0000000000..f0a1d78799 --- /dev/null +++ b/packages/client-rust/src/models/user_self_roles.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserSelfRoles { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "pk")] + pub pk: String, +} + +impl UserSelfRoles { + pub fn new(name: String, pk: String) -> UserSelfRoles { + UserSelfRoles { name, pk } + } +} diff --git a/packages/client-rust/src/models/user_service_account_request.rs b/packages/client-rust/src/models/user_service_account_request.rs new file mode 100644 index 0000000000..70930a20d0 --- /dev/null +++ b/packages/client-rust/src/models/user_service_account_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserServiceAccountRequest : Payload to create a service account +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserServiceAccountRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "create_group", skip_serializing_if = "Option::is_none")] + pub create_group: Option, + #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] + pub expiring: Option, + /// If not provided, valid for 360 days + #[serde(rename = "expires", skip_serializing_if = "Option::is_none")] + pub expires: Option, +} + +impl UserServiceAccountRequest { + /// Payload to create a service account + pub fn new(name: String) -> UserServiceAccountRequest { + UserServiceAccountRequest { + name, + create_group: None, + expiring: None, + expires: None, + } + } +} diff --git a/packages/client-rust/src/models/user_service_account_response.rs b/packages/client-rust/src/models/user_service_account_response.rs new file mode 100644 index 0000000000..8a6245dd35 --- /dev/null +++ b/packages/client-rust/src/models/user_service_account_response.rs @@ -0,0 +1,42 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserServiceAccountResponse { + #[serde(rename = "username")] + pub username: String, + #[serde(rename = "token")] + pub token: String, + #[serde(rename = "user_uid")] + pub user_uid: String, + #[serde(rename = "user_pk")] + pub user_pk: i32, + #[serde(rename = "group_pk", skip_serializing_if = "Option::is_none")] + pub group_pk: Option, +} + +impl UserServiceAccountResponse { + pub fn new( + username: String, + token: String, + user_uid: String, + user_pk: i32, + ) -> UserServiceAccountResponse { + UserServiceAccountResponse { + username, + token, + user_uid, + user_pk, + group_pk: None, + } + } +} diff --git a/packages/client-rust/src/models/user_setting.rs b/packages/client-rust/src/models/user_setting.rs new file mode 100644 index 0000000000..834fff5966 --- /dev/null +++ b/packages/client-rust/src/models/user_setting.rs @@ -0,0 +1,39 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserSetting : Serializer for User settings for stages and sources +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserSetting { + #[serde(rename = "object_uid")] + pub object_uid: String, + #[serde(rename = "component")] + pub component: String, + #[serde(rename = "title")] + pub title: String, + #[serde(rename = "configure_url", skip_serializing_if = "Option::is_none")] + pub configure_url: Option, + #[serde(rename = "icon_url", skip_serializing_if = "Option::is_none")] + pub icon_url: Option, +} + +impl UserSetting { + /// Serializer for User settings for stages and sources + pub fn new(object_uid: String, component: String, title: String) -> UserSetting { + UserSetting { + object_uid, + component, + title, + configure_url: None, + icon_url: None, + } + } +} diff --git a/packages/client-rust/src/models/user_source_connection.rs b/packages/client-rust/src/models/user_source_connection.rs new file mode 100644 index 0000000000..2109ac3efe --- /dev/null +++ b/packages/client-rust/src/models/user_source_connection.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserSourceConnection : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserSourceConnection { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "source_obj")] + pub source_obj: models::Source, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "last_updated")] + pub last_updated: String, +} + +impl UserSourceConnection { + /// User source connection + pub fn new( + pk: i32, + user: i32, + source: uuid::Uuid, + source_obj: models::Source, + identifier: String, + created: String, + last_updated: String, + ) -> UserSourceConnection { + UserSourceConnection { + pk, + user, + source, + source_obj, + identifier, + created, + last_updated, + } + } +} diff --git a/packages/client-rust/src/models/user_source_connection_request.rs b/packages/client-rust/src/models/user_source_connection_request.rs new file mode 100644 index 0000000000..4c691ed4ce --- /dev/null +++ b/packages/client-rust/src/models/user_source_connection_request.rs @@ -0,0 +1,33 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserSourceConnectionRequest : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserSourceConnectionRequest { + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "identifier")] + pub identifier: String, +} + +impl UserSourceConnectionRequest { + /// User source connection + pub fn new(user: i32, source: uuid::Uuid, identifier: String) -> UserSourceConnectionRequest { + UserSourceConnectionRequest { + user, + source, + identifier, + } + } +} diff --git a/packages/client-rust/src/models/user_telegram_source_connection.rs b/packages/client-rust/src/models/user_telegram_source_connection.rs new file mode 100644 index 0000000000..8a5792294f --- /dev/null +++ b/packages/client-rust/src/models/user_telegram_source_connection.rs @@ -0,0 +1,53 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserTelegramSourceConnection : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserTelegramSourceConnection { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "source_obj")] + pub source_obj: models::Source, + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "created")] + pub created: String, + #[serde(rename = "last_updated")] + pub last_updated: String, +} + +impl UserTelegramSourceConnection { + /// User source connection + pub fn new( + pk: i32, + user: i32, + source: uuid::Uuid, + source_obj: models::Source, + identifier: String, + created: String, + last_updated: String, + ) -> UserTelegramSourceConnection { + UserTelegramSourceConnection { + pk, + user, + source, + source_obj, + identifier, + created, + last_updated, + } + } +} diff --git a/packages/client-rust/src/models/user_telegram_source_connection_request.rs b/packages/client-rust/src/models/user_telegram_source_connection_request.rs new file mode 100644 index 0000000000..3a3ecc2bbf --- /dev/null +++ b/packages/client-rust/src/models/user_telegram_source_connection_request.rs @@ -0,0 +1,37 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserTelegramSourceConnectionRequest : User source connection +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserTelegramSourceConnectionRequest { + #[serde(rename = "user")] + pub user: i32, + #[serde(rename = "source")] + pub source: uuid::Uuid, + #[serde(rename = "identifier")] + pub identifier: String, +} + +impl UserTelegramSourceConnectionRequest { + /// User source connection + pub fn new( + user: i32, + source: uuid::Uuid, + identifier: String, + ) -> UserTelegramSourceConnectionRequest { + UserTelegramSourceConnectionRequest { + user, + source, + identifier, + } + } +} diff --git a/packages/client-rust/src/models/user_type_enum.rs b/packages/client-rust/src/models/user_type_enum.rs new file mode 100644 index 0000000000..011d8cbea5 --- /dev/null +++ b/packages/client-rust/src/models/user_type_enum.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UserTypeEnum { + #[serde(rename = "internal")] + Internal, + #[serde(rename = "external")] + External, + #[serde(rename = "service_account")] + ServiceAccount, + #[serde(rename = "internal_service_account")] + InternalServiceAccount, +} + +impl std::fmt::Display for UserTypeEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Internal => write!(f, "internal"), + Self::External => write!(f, "external"), + Self::ServiceAccount => write!(f, "service_account"), + Self::InternalServiceAccount => write!(f, "internal_service_account"), + } + } +} + +impl Default for UserTypeEnum { + fn default() -> UserTypeEnum { + Self::Internal + } +} diff --git a/packages/client-rust/src/models/user_verification_enum.rs b/packages/client-rust/src/models/user_verification_enum.rs new file mode 100644 index 0000000000..4a78efe8a3 --- /dev/null +++ b/packages/client-rust/src/models/user_verification_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UserVerificationEnum { + #[serde(rename = "required")] + Required, + #[serde(rename = "preferred")] + Preferred, + #[serde(rename = "discouraged")] + Discouraged, +} + +impl std::fmt::Display for UserVerificationEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Required => write!(f, "required"), + Self::Preferred => write!(f, "preferred"), + Self::Discouraged => write!(f, "discouraged"), + } + } +} + +impl Default for UserVerificationEnum { + fn default() -> UserVerificationEnum { + Self::Required + } +} diff --git a/packages/client-rust/src/models/user_write_stage.rs b/packages/client-rust/src/models/user_write_stage.rs new file mode 100644 index 0000000000..dcd752c49d --- /dev/null +++ b/packages/client-rust/src/models/user_write_stage.rs @@ -0,0 +1,82 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserWriteStage : UserWriteStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserWriteStage { + #[serde(rename = "pk")] + pub pk: uuid::Uuid, + #[serde(rename = "name")] + pub name: String, + /// Get object type so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "flow_set")] + pub flow_set: Vec, + #[serde(rename = "user_creation_mode", skip_serializing_if = "Option::is_none")] + pub user_creation_mode: Option, + /// When set, newly created users are inactive and cannot login. + #[serde( + rename = "create_users_as_inactive", + skip_serializing_if = "Option::is_none" + )] + pub create_users_as_inactive: Option, + /// Optionally add newly created users to this group. + #[serde( + rename = "create_users_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub create_users_group: Option>, + #[serde(rename = "user_type", skip_serializing_if = "Option::is_none")] + pub user_type: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, +} + +impl UserWriteStage { + /// UserWriteStage Serializer + pub fn new( + pk: uuid::Uuid, + name: String, + component: String, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + flow_set: Vec, + ) -> UserWriteStage { + UserWriteStage { + pk, + name, + component, + verbose_name, + verbose_name_plural, + meta_model_name, + flow_set, + user_creation_mode: None, + create_users_as_inactive: None, + create_users_group: None, + user_type: None, + user_path_template: None, + } + } +} diff --git a/packages/client-rust/src/models/user_write_stage_request.rs b/packages/client-rust/src/models/user_write_stage_request.rs new file mode 100644 index 0000000000..42d262a459 --- /dev/null +++ b/packages/client-rust/src/models/user_write_stage_request.rs @@ -0,0 +1,52 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// UserWriteStageRequest : UserWriteStage Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct UserWriteStageRequest { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "user_creation_mode", skip_serializing_if = "Option::is_none")] + pub user_creation_mode: Option, + /// When set, newly created users are inactive and cannot login. + #[serde( + rename = "create_users_as_inactive", + skip_serializing_if = "Option::is_none" + )] + pub create_users_as_inactive: Option, + /// Optionally add newly created users to this group. + #[serde( + rename = "create_users_group", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub create_users_group: Option>, + #[serde(rename = "user_type", skip_serializing_if = "Option::is_none")] + pub user_type: Option, + #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] + pub user_path_template: Option, +} + +impl UserWriteStageRequest { + /// UserWriteStage Serializer + pub fn new(name: String) -> UserWriteStageRequest { + UserWriteStageRequest { + name, + user_creation_mode: None, + create_users_as_inactive: None, + create_users_group: None, + user_type: None, + user_path_template: None, + } + } +} diff --git a/packages/client-rust/src/models/validation_error.rs b/packages/client-rust/src/models/validation_error.rs new file mode 100644 index 0000000000..ce0db262b4 --- /dev/null +++ b/packages/client-rust/src/models/validation_error.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// ValidationError : Validation Error +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ValidationError { + #[serde(rename = "non_field_errors", skip_serializing_if = "Option::is_none")] + pub non_field_errors: Option>, + #[serde(rename = "code", skip_serializing_if = "Option::is_none")] + pub code: Option, +} + +impl ValidationError { + /// Validation Error + pub fn new() -> ValidationError { + ValidationError { + non_field_errors: None, + code: None, + } + } +} diff --git a/packages/client-rust/src/models/vendor_enum.rs b/packages/client-rust/src/models/vendor_enum.rs new file mode 100644 index 0000000000..9170412a19 --- /dev/null +++ b/packages/client-rust/src/models/vendor_enum.rs @@ -0,0 +1,41 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum VendorEnum { + #[serde(rename = "goauthentik.io/@merged")] + GoauthentikIoSlashAtMerged, + #[serde(rename = "goauthentik.io/platform")] + GoauthentikIoSlashPlatform, + #[serde(rename = "fleetdm.com")] + FleetdmCom, + #[serde(rename = "chrome.google.com")] + ChromeGoogleCom, +} + +impl std::fmt::Display for VendorEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::GoauthentikIoSlashAtMerged => write!(f, "goauthentik.io/@merged"), + Self::GoauthentikIoSlashPlatform => write!(f, "goauthentik.io/platform"), + Self::FleetdmCom => write!(f, "fleetdm.com"), + Self::ChromeGoogleCom => write!(f, "chrome.google.com"), + } + } +} + +impl Default for VendorEnum { + fn default() -> VendorEnum { + Self::GoauthentikIoSlashAtMerged + } +} diff --git a/packages/client-rust/src/models/version.rs b/packages/client-rust/src/models/version.rs new file mode 100644 index 0000000000..95de7901cc --- /dev/null +++ b/packages/client-rust/src/models/version.rs @@ -0,0 +1,55 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// Version : Get running and latest version. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Version { + /// Get current version + #[serde(rename = "version_current")] + pub version_current: String, + /// Get latest version from cache + #[serde(rename = "version_latest")] + pub version_latest: String, + /// Check if latest version is valid + #[serde(rename = "version_latest_valid")] + pub version_latest_valid: bool, + /// Get build hash, if version is not latest or released + #[serde(rename = "build_hash")] + pub build_hash: String, + /// Check if we're running the latest version + #[serde(rename = "outdated")] + pub outdated: bool, + /// Check if any outpost is outdated/has a version mismatch + #[serde(rename = "outpost_outdated")] + pub outpost_outdated: bool, +} + +impl Version { + /// Get running and latest version. + pub fn new( + version_current: String, + version_latest: String, + version_latest_valid: bool, + build_hash: String, + outdated: bool, + outpost_outdated: bool, + ) -> Version { + Version { + version_current, + version_latest, + version_latest_valid, + build_hash, + outdated, + outpost_outdated, + } + } +} diff --git a/packages/client-rust/src/models/version_history.rs b/packages/client-rust/src/models/version_history.rs new file mode 100644 index 0000000000..72447c699e --- /dev/null +++ b/packages/client-rust/src/models/version_history.rs @@ -0,0 +1,36 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// VersionHistory : VersionHistory Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct VersionHistory { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "timestamp")] + pub timestamp: String, + #[serde(rename = "version")] + pub version: String, + #[serde(rename = "build")] + pub build: String, +} + +impl VersionHistory { + /// VersionHistory Serializer + pub fn new(id: i32, timestamp: String, version: String, build: String) -> VersionHistory { + VersionHistory { + id, + timestamp, + version, + build, + } + } +} diff --git a/packages/client-rust/src/models/web_authn_device.rs b/packages/client-rust/src/models/web_authn_device.rs new file mode 100644 index 0000000000..524863acde --- /dev/null +++ b/packages/client-rust/src/models/web_authn_device.rs @@ -0,0 +1,49 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// WebAuthnDevice : Serializer for WebAuthn authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebAuthnDevice { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "created_on")] + pub created_on: String, + #[serde(rename = "device_type", deserialize_with = "Option::deserialize")] + pub device_type: Option, + #[serde(rename = "aaguid")] + pub aaguid: String, + #[serde(rename = "user")] + pub user: models::PartialUser, +} + +impl WebAuthnDevice { + /// Serializer for WebAuthn authenticator devices + pub fn new( + pk: i32, + name: String, + created_on: String, + device_type: Option, + aaguid: String, + user: models::PartialUser, + ) -> WebAuthnDevice { + WebAuthnDevice { + pk, + name, + created_on, + device_type, + aaguid, + user, + } + } +} diff --git a/packages/client-rust/src/models/web_authn_device_request.rs b/packages/client-rust/src/models/web_authn_device_request.rs new file mode 100644 index 0000000000..3e7b58d653 --- /dev/null +++ b/packages/client-rust/src/models/web_authn_device_request.rs @@ -0,0 +1,25 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// WebAuthnDeviceRequest : Serializer for WebAuthn authenticator devices +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebAuthnDeviceRequest { + #[serde(rename = "name")] + pub name: String, +} + +impl WebAuthnDeviceRequest { + /// Serializer for WebAuthn authenticator devices + pub fn new(name: String) -> WebAuthnDeviceRequest { + WebAuthnDeviceRequest { name } + } +} diff --git a/packages/client-rust/src/models/web_authn_device_type.rs b/packages/client-rust/src/models/web_authn_device_type.rs new file mode 100644 index 0000000000..10f9ece44c --- /dev/null +++ b/packages/client-rust/src/models/web_authn_device_type.rs @@ -0,0 +1,30 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// WebAuthnDeviceType : WebAuthnDeviceType Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebAuthnDeviceType { + #[serde(rename = "aaguid")] + pub aaguid: uuid::Uuid, + #[serde(rename = "description")] + pub description: String, +} + +impl WebAuthnDeviceType { + /// WebAuthnDeviceType Serializer + pub fn new(aaguid: uuid::Uuid, description: String) -> WebAuthnDeviceType { + WebAuthnDeviceType { + aaguid, + description, + } + } +} diff --git a/packages/client-rust/src/models/web_authn_hint_enum.rs b/packages/client-rust/src/models/web_authn_hint_enum.rs new file mode 100644 index 0000000000..d16373715a --- /dev/null +++ b/packages/client-rust/src/models/web_authn_hint_enum.rs @@ -0,0 +1,38 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum WebAuthnHintEnum { + #[serde(rename = "security-key")] + SecurityKey, + #[serde(rename = "client-device")] + ClientDevice, + #[serde(rename = "hybrid")] + Hybrid, +} + +impl std::fmt::Display for WebAuthnHintEnum { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::SecurityKey => write!(f, "security-key"), + Self::ClientDevice => write!(f, "client-device"), + Self::Hybrid => write!(f, "hybrid"), + } + } +} + +impl Default for WebAuthnHintEnum { + fn default() -> WebAuthnHintEnum { + Self::SecurityKey + } +} diff --git a/packages/client-rust/src/models/worker.rs b/packages/client-rust/src/models/worker.rs new file mode 100644 index 0000000000..3a9143e0f5 --- /dev/null +++ b/packages/client-rust/src/models/worker.rs @@ -0,0 +1,31 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Worker { + #[serde(rename = "worker_id")] + pub worker_id: String, + #[serde(rename = "version")] + pub version: String, + #[serde(rename = "version_matching")] + pub version_matching: bool, +} + +impl Worker { + pub fn new(worker_id: String, version: String, version_matching: bool) -> Worker { + Worker { + worker_id, + version, + version_matching, + } + } +} diff --git a/packages/client-rust/src/models/ws_federation_provider.rs b/packages/client-rust/src/models/ws_federation_provider.rs new file mode 100644 index 0000000000..96c7fe3d25 --- /dev/null +++ b/packages/client-rust/src/models/ws_federation_provider.rs @@ -0,0 +1,214 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// WsFederationProvider : WSFederationProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WsFederationProvider { + #[serde(rename = "pk")] + pub pk: i32, + #[serde(rename = "name")] + pub name: String, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow")] + pub authorization_flow: uuid::Uuid, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow")] + pub invalidation_flow: uuid::Uuid, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + /// Get object component so that we know how to edit the object + #[serde(rename = "component")] + pub component: String, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_application_name: Option, + /// Internal application name, used in URLs. + #[serde( + rename = "assigned_backchannel_application_slug", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_slug: Option, + /// Application's display Name. + #[serde( + rename = "assigned_backchannel_application_name", + deserialize_with = "Option::deserialize" + )] + pub assigned_backchannel_application_name: Option, + /// Return object's verbose_name + #[serde(rename = "verbose_name")] + pub verbose_name: String, + /// Return object's plural verbose_name + #[serde(rename = "verbose_name_plural")] + pub verbose_name_plural: String, + /// Return internal model name + #[serde(rename = "meta_model_name")] + pub meta_model_name: String, + #[serde(rename = "reply_url")] + pub reply_url: String, + #[serde(rename = "wtrealm")] + pub wtrealm: String, + /// Assertion valid not before current time + this value (Format: + /// hours=-1;minutes=-2;seconds=-3). + #[serde( + rename = "assertion_valid_not_before", + skip_serializing_if = "Option::is_none" + )] + pub assertion_valid_not_before: Option, + /// Assertion not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "assertion_valid_not_on_or_after", + skip_serializing_if = "Option::is_none" + )] + pub assertion_valid_not_on_or_after: Option, + /// Session not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "session_valid_not_on_or_after", + skip_serializing_if = "Option::is_none" + )] + pub session_valid_not_on_or_after: Option, + /// Configure how the NameID value will be created. When left empty, the NameIDPolicy of the + /// incoming request will be considered + #[serde( + rename = "name_id_mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub name_id_mapping: Option>, + /// Configure how the AuthnContextClassRef value will be created. When left empty, the + /// AuthnContextClassRef will be set based on which authentication methods the user used to + /// authenticate. + #[serde( + rename = "authn_context_class_ref_mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authn_context_class_ref_mapping: Option>, + #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] + pub digest_algorithm: Option, + #[serde( + rename = "signature_algorithm", + skip_serializing_if = "Option::is_none" + )] + pub signature_algorithm: Option, + /// Keypair used to sign outgoing Responses going to the Service Provider. + #[serde( + rename = "signing_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub signing_kp: Option>, + /// When selected, incoming assertions are encrypted by the IdP using the public key of the + /// encryption keypair. The assertion is decrypted by the SP using the the private key. + #[serde( + rename = "encryption_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub encryption_kp: Option>, + #[serde(rename = "sign_assertion", skip_serializing_if = "Option::is_none")] + pub sign_assertion: Option, + #[serde( + rename = "sign_logout_request", + skip_serializing_if = "Option::is_none" + )] + pub sign_logout_request: Option, + #[serde( + rename = "default_name_id_policy", + skip_serializing_if = "Option::is_none" + )] + pub default_name_id_policy: Option, + /// Get metadata download URL + #[serde(rename = "url_download_metadata")] + pub url_download_metadata: String, + /// Get WS-Fed url + #[serde(rename = "url_wsfed")] + pub url_wsfed: String, +} + +impl WsFederationProvider { + /// WSFederationProvider Serializer + pub fn new( + pk: i32, + name: String, + authorization_flow: uuid::Uuid, + invalidation_flow: uuid::Uuid, + component: String, + assigned_application_slug: Option, + assigned_application_name: Option, + assigned_backchannel_application_slug: Option, + assigned_backchannel_application_name: Option, + verbose_name: String, + verbose_name_plural: String, + meta_model_name: String, + reply_url: String, + wtrealm: String, + url_download_metadata: String, + url_wsfed: String, + ) -> WsFederationProvider { + WsFederationProvider { + pk, + name, + authentication_flow: None, + authorization_flow, + invalidation_flow, + property_mappings: None, + component, + assigned_application_slug, + assigned_application_name, + assigned_backchannel_application_slug, + assigned_backchannel_application_name, + verbose_name, + verbose_name_plural, + meta_model_name, + reply_url, + wtrealm, + assertion_valid_not_before: None, + assertion_valid_not_on_or_after: None, + session_valid_not_on_or_after: None, + name_id_mapping: None, + authn_context_class_ref_mapping: None, + digest_algorithm: None, + signature_algorithm: None, + signing_kp: None, + encryption_kp: None, + sign_assertion: None, + sign_logout_request: None, + default_name_id_policy: None, + url_download_metadata, + url_wsfed, + } + } +} diff --git a/packages/client-rust/src/models/ws_federation_provider_request.rs b/packages/client-rust/src/models/ws_federation_provider_request.rs new file mode 100644 index 0000000000..300682a804 --- /dev/null +++ b/packages/client-rust/src/models/ws_federation_provider_request.rs @@ -0,0 +1,148 @@ +// authentik +// +// Making authentication simple. +// +// The version of the OpenAPI document: 2026.5.0-rc1 +// Contact: hello@goauthentik.io +// Generated by: https://openapi-generator.tech + +use serde::{Deserialize, Serialize}; + +use crate::models; + +/// WsFederationProviderRequest : WSFederationProvider Serializer +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct WsFederationProviderRequest { + #[serde(rename = "name")] + pub name: String, + /// Flow used for authentication when the associated application is accessed by an + /// un-authenticated user. + #[serde( + rename = "authentication_flow", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authentication_flow: Option>, + /// Flow used when authorizing this provider. + #[serde(rename = "authorization_flow")] + pub authorization_flow: uuid::Uuid, + /// Flow used ending the session from a provider. + #[serde(rename = "invalidation_flow")] + pub invalidation_flow: uuid::Uuid, + #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] + pub property_mappings: Option>, + #[serde(rename = "reply_url")] + pub reply_url: String, + #[serde(rename = "wtrealm")] + pub wtrealm: String, + /// Assertion valid not before current time + this value (Format: + /// hours=-1;minutes=-2;seconds=-3). + #[serde( + rename = "assertion_valid_not_before", + skip_serializing_if = "Option::is_none" + )] + pub assertion_valid_not_before: Option, + /// Assertion not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "assertion_valid_not_on_or_after", + skip_serializing_if = "Option::is_none" + )] + pub assertion_valid_not_on_or_after: Option, + /// Session not valid on or after current time + this value (Format: + /// hours=1;minutes=2;seconds=3). + #[serde( + rename = "session_valid_not_on_or_after", + skip_serializing_if = "Option::is_none" + )] + pub session_valid_not_on_or_after: Option, + /// Configure how the NameID value will be created. When left empty, the NameIDPolicy of the + /// incoming request will be considered + #[serde( + rename = "name_id_mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub name_id_mapping: Option>, + /// Configure how the AuthnContextClassRef value will be created. When left empty, the + /// AuthnContextClassRef will be set based on which authentication methods the user used to + /// authenticate. + #[serde( + rename = "authn_context_class_ref_mapping", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub authn_context_class_ref_mapping: Option>, + #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] + pub digest_algorithm: Option, + #[serde( + rename = "signature_algorithm", + skip_serializing_if = "Option::is_none" + )] + pub signature_algorithm: Option, + /// Keypair used to sign outgoing Responses going to the Service Provider. + #[serde( + rename = "signing_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub signing_kp: Option>, + /// When selected, incoming assertions are encrypted by the IdP using the public key of the + /// encryption keypair. The assertion is decrypted by the SP using the the private key. + #[serde( + rename = "encryption_kp", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub encryption_kp: Option>, + #[serde(rename = "sign_assertion", skip_serializing_if = "Option::is_none")] + pub sign_assertion: Option, + #[serde( + rename = "sign_logout_request", + skip_serializing_if = "Option::is_none" + )] + pub sign_logout_request: Option, + #[serde( + rename = "default_name_id_policy", + skip_serializing_if = "Option::is_none" + )] + pub default_name_id_policy: Option, +} + +impl WsFederationProviderRequest { + /// WSFederationProvider Serializer + pub fn new( + name: String, + authorization_flow: uuid::Uuid, + invalidation_flow: uuid::Uuid, + reply_url: String, + wtrealm: String, + ) -> WsFederationProviderRequest { + WsFederationProviderRequest { + name, + authentication_flow: None, + authorization_flow, + invalidation_flow, + property_mappings: None, + reply_url, + wtrealm, + assertion_valid_not_before: None, + assertion_valid_not_on_or_after: None, + session_valid_not_on_or_after: None, + name_id_mapping: None, + authn_context_class_ref_mapping: None, + digest_algorithm: None, + signature_algorithm: None, + signing_kp: None, + encryption_kp: None, + sign_assertion: None, + sign_logout_request: None, + default_name_id_policy: None, + } + } +}