diff --git a/Cargo.lock b/Cargo.lock index b2728124b..6b1bd3669 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -186,17 +186,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - [[package]] name = "async-compat" version = "0.2.3" @@ -216,7 +205,7 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener 4.0.3", + "event-listener", "event-listener-strategy", "pin-project-lite", ] @@ -253,12 +242,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -348,24 +331,24 @@ checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" name = "bitwarden" version = "0.4.0" dependencies = [ - "base64 0.21.7", + "base64", "bitwarden-api-api", "bitwarden-api-identity", "bitwarden-crypto", "bitwarden-exporters", "bitwarden-generators", "chrono", - "getrandom 0.2.12", + "getrandom", "hmac", "log", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "reqwest", "rustls-platform-verifier", "schemars", "serde", "serde_json", - "serde_qs 0.12.0", + "serde_qs", "serde_repr", "sha1", "sha2", @@ -429,7 +412,7 @@ version = "0.1.0" dependencies = [ "aes", "argon2", - "base64 0.21.7", + "base64", "cbc", "generic-array", "hkdf", @@ -437,8 +420,9 @@ dependencies = [ "num-bigint", "num-traits", "pbkdf2", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", + "rayon", "rsa", "schemars", "serde", @@ -456,6 +440,8 @@ dependencies = [ name = "bitwarden-exporters" version = "0.1.0" dependencies = [ + "base64", + "bitwarden-crypto", "chrono", "csv", "serde", @@ -469,8 +455,8 @@ name = "bitwarden-generators" version = "0.1.0" dependencies = [ "bitwarden-crypto", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "reqwest", "schemars", "serde", @@ -485,6 +471,7 @@ dependencies = [ name = "bitwarden-json" version = "0.3.0" dependencies = [ + "async-lock", "bitwarden", "log", "schemars", @@ -625,7 +612,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "toml 0.8.9", + "toml 0.8.10", "uuid", ] @@ -717,9 +704,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ "android-tzdata", "iana-time-zone", @@ -958,6 +945,25 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.19" @@ -1080,14 +1086,13 @@ dependencies = [ [[package]] name = "deadpool" -version = "0.9.5" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421fe0f90f2ab22016f32a9881be5134fdd71c65298917084b0c7477cbc3856e" +checksum = "fb84100978c1c7b37f09ed3ce3e5f843af02c2a2c431bae5b19230dad2c1b490" dependencies = [ "async-trait", "deadpool-runtime", "num_cpus", - "retain_mut", "tokio", ] @@ -1247,12 +1252,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - [[package]] name = "event-listener" version = "4.0.3" @@ -1270,7 +1269,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "event-listener 4.0.3", + "event-listener", "pin-project-lite", ] @@ -1294,15 +1293,6 @@ dependencies = [ "regex", ] -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.0.1" @@ -1391,21 +1381,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - [[package]] name = "futures-macro" version = "0.3.30" @@ -1429,12 +1404,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" -[[package]] -name = "futures-timer" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" - [[package]] name = "futures-util" version = "0.3.30" @@ -1464,17 +1433,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - [[package]] name = "getrandom" version = "0.2.12" @@ -1484,7 +1442,7 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] @@ -1535,7 +1493,26 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.11", + "indexmap 2.2.2", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31d030e59af851932b72ceebadf4a2b5986dba4c3b99dd2493f8273a0f151943" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 1.0.0", "indexmap 2.2.2", "slab", "tokio", @@ -1605,6 +1582,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http-body" version = "0.4.6" @@ -1612,29 +1600,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.11", "pin-project-lite", ] [[package]] -name = "http-types" -version = "2.12.0" +name = "http-body" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ - "anyhow", - "async-channel", - "base64 0.13.1", - "futures-lite", - "http", - "infer", + "bytes", + "http 1.0.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840" +dependencies = [ + "bytes", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", "pin-project-lite", - "rand 0.7.3", - "serde", - "serde_json", - "serde_qs 0.8.5", - "serde_urlencoded", - "url", ] [[package]] @@ -1665,9 +1655,9 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", - "http", - "http-body", + "h2 0.3.24", + "http 0.2.11", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -1679,6 +1669,26 @@ dependencies = [ "want", ] +[[package]] +name = "hyper" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5aa53871fc917b1a9ed87b683a5d86db645e23acb32c2e0785a353e522fb75" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.2", + "http 1.0.0", + "http-body 1.0.0", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "tokio", + "want", +] + [[package]] name = "hyper-rustls" version = "0.24.2" @@ -1686,13 +1696,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http", - "hyper", + "http 0.2.11", + "hyper 0.14.28", "rustls", "tokio", "tokio-rustls", ] +[[package]] +name = "hyper-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +dependencies = [ + "bytes", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", + "hyper 1.1.0", + "pin-project-lite", + "socket2", + "tokio", +] + [[package]] name = "iana-time-zone" version = "0.1.60" @@ -1765,12 +1791,6 @@ version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" -[[package]] -name = "infer" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" - [[package]] name = "inout" version = "0.1.3" @@ -1797,15 +1817,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "ipnet" version = "2.9.0" @@ -1864,9 +1875,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -1998,7 +2009,7 @@ checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] @@ -2111,7 +2122,7 @@ dependencies = [ "num-integer", "num-iter", "num-traits", - "rand 0.8.5", + "rand", "smallvec", "zeroize", ] @@ -2260,7 +2271,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" dependencies = [ "base64ct", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -2354,7 +2365,7 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" dependencies = [ - "base64 0.21.7", + "base64", "indexmap 2.2.2", "line-wrap", "quick-xml", @@ -2504,19 +2515,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - [[package]] name = "rand" version = "0.8.5" @@ -2524,18 +2522,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", + "rand_chacha", + "rand_core", ] [[package]] @@ -2545,34 +2533,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", + "rand_core", ] [[package]] name = "rand_core" -version = "0.5.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.1.16", + "getrandom", ] [[package]] -name = "rand_core" -version = "0.6.4" +name = "rayon" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ - "getrandom 0.2.12", + "either", + "rayon-core", ] [[package]] -name = "rand_hc" -version = "0.2.0" +name = "rayon-core" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "rand_core 0.5.1", + "crossbeam-deque", + "crossbeam-utils", ] [[package]] @@ -2590,7 +2580,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "getrandom 0.2.12", + "getrandom", "libredox", "thiserror", ] @@ -2636,15 +2626,15 @@ version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ - "base64 0.21.7", + "base64", "bytes", "encoding_rs", "futures-core", "futures-util", - "h2", - "http", - "http-body", - "hyper", + "h2 0.3.24", + "http 0.2.11", + "http-body 0.4.6", + "hyper 0.14.28", "hyper-rustls", "ipnet", "js-sys", @@ -2672,12 +2662,6 @@ dependencies = [ "winreg", ] -[[package]] -name = "retain_mut" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" - [[package]] name = "rgb" version = "0.8.37" @@ -2694,7 +2678,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "getrandom 0.2.12", + "getrandom", "libc", "spin 0.9.8", "untrusted", @@ -2714,7 +2698,7 @@ dependencies = [ "num-traits", "pkcs1", "pkcs8", - "rand_core 0.6.4", + "rand_core", "signature", "spki", "subtle", @@ -2770,7 +2754,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.7", + "base64", ] [[package]] @@ -3003,17 +2987,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_qs" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" -dependencies = [ - "percent-encoding", - "serde", - "thiserror", -] - [[package]] name = "serde_qs" version = "0.12.0" @@ -3138,7 +3111,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -3328,13 +3301,12 @@ checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", - "fastrand 2.0.1", - "redox_syscall", + "fastrand", "rustix", "windows-sys 0.52.0", ] @@ -3352,18 +3324,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", @@ -3489,9 +3461,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" dependencies = [ "serde", "serde_spanned", @@ -3510,9 +3482,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" dependencies = [ "indexmap 2.2.2", "serde", @@ -3797,7 +3769,6 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", - "serde", ] [[package]] @@ -3812,6 +3783,7 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ + "getrandom", "serde", ] @@ -3827,12 +3799,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "waker-fn" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" - [[package]] name = "walkdir" version = "2.4.0" @@ -3852,12 +3818,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -3866,9 +3826,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "serde", @@ -3878,9 +3838,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", @@ -3893,9 +3853,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ "cfg-if", "js-sys", @@ -3905,9 +3865,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3915,9 +3875,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", @@ -3928,15 +3888,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "wasm-bindgen-test" -version = "0.3.40" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139bd73305d50e1c1c4333210c0db43d989395b64a237bd35c10ef3832a7f70c" +checksum = "143ddeb4f833e2ed0d252e618986e18bfc7b0e52f2d28d77d05b2f045dd8eb61" dependencies = [ "console_error_panic_hook", "js-sys", @@ -3948,9 +3908,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.40" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70072aebfe5da66d2716002c729a14e4aec4da0e23cc2ea66323dac541c93928" +checksum = "a5211b7550606857312bba1d978a8ec75692eae187becc5e680444fffc5e6f89" dependencies = [ "proc-macro2", "quote", @@ -4175,24 +4135,26 @@ dependencies = [ [[package]] name = "wiremock" -version = "0.5.22" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13a3a53eaf34f390dd30d7b1b078287dd05df2aa2e21a589ccb80f5c7253c2e9" +checksum = "ec874e1eef0df2dcac546057fe5e29186f09c378181cd7b635b4b7bcc98e9d81" dependencies = [ "assert-json-diff", "async-trait", - "base64 0.21.7", + "base64", "deadpool", "futures", - "futures-timer", - "http-types", - "hyper", + "http 1.0.0", + "http-body-util", + "hyper 1.1.0", + "hyper-util", "log", "once_cell", "regex", "serde", "serde_json", "tokio", + "url", ] [[package]] diff --git a/README.md b/README.md index 2de94b09c..9e3aa325f 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,10 @@ The first step is to generate the swagger documents from the server repository. ```bash # src/Api -dotnet swagger tofile --output ../../api.json ./bin/Debug/net6.0/Api.dll internal +dotnet swagger tofile --output ../../api.json ./bin/Debug/net8.0/Api.dll internal # src/Identity -ASPNETCORE_ENVIRONMENT=development dotnet swagger tofile --output ../../identity.json ./bin/Debug/net6.0/Identity.dll v1 +ASPNETCORE_ENVIRONMENT=development dotnet swagger tofile --output ../../identity.json ./bin/Debug/net8.0/Identity.dll v1 ``` ### OpenApi Generator @@ -68,21 +68,7 @@ ASPNETCORE_ENVIRONMENT=development dotnet swagger tofile --output ../../identity Runs from the root of the SDK project. ```bash -npx openapi-generator-cli generate \ - -i ../server/api.json \ - -g rust \ - -o crates/bitwarden-api-api \ - --package-name bitwarden-api-api \ - -t ./support/openapi-template \ - --additional-properties=packageVersion=1.0.0 - -npx openapi-generator-cli generate \ - -i ../server/identity.json \ - -g rust \ - -o crates/bitwarden-api-identity \ - --package-name bitwarden-api-identity \ - -t ./support/openapi-template \ - --additional-properties=packageVersion=1.0.0 +./support/build-api.sh ``` OpenApi Generator works using templates, we have customized our templates to work better with our diff --git a/crates/bitwarden-api-api/.openapi-generator-ignore b/crates/bitwarden-api-api/.openapi-generator-ignore index b72fc90d8..0a3fec13f 100644 --- a/crates/bitwarden-api-api/.openapi-generator-ignore +++ b/crates/bitwarden-api-api/.openapi-generator-ignore @@ -25,5 +25,3 @@ docs/*.md .travis.yml git_push.sh - -src/models/organization_user_status_type.rs diff --git a/crates/bitwarden-api-api/.openapi-generator/FILES b/crates/bitwarden-api-api/.openapi-generator/FILES index 586d4f2db..206ad61b2 100644 --- a/crates/bitwarden-api-api/.openapi-generator/FILES +++ b/crates/bitwarden-api-api/.openapi-generator/FILES @@ -36,6 +36,7 @@ src/apis/provider_users_api.rs src/apis/providers_api.rs src/apis/push_api.rs src/apis/secrets_api.rs +src/apis/secrets_manager_events_api.rs src/apis/secrets_manager_porting_api.rs src/apis/self_hosted_organization_licenses_api.rs src/apis/self_hosted_organization_sponsorships_api.rs @@ -46,6 +47,7 @@ src/apis/sync_api.rs src/apis/trash_api.rs src/apis/two_factor_api.rs src/apis/users_api.rs +src/apis/web_authn_api.rs src/lib.rs src/models/access_policies_create_request.rs src/models/access_policy_request.rs @@ -55,17 +57,26 @@ src/models/access_token_creation_response_model.rs src/models/access_token_response_model.rs src/models/access_token_response_model_list_response_model.rs src/models/admin_auth_request_update_request_model.rs +src/models/algorithm.rs src/models/api_key_response_model.rs +src/models/assertion_options.rs +src/models/assertion_response.rs src/models/attachment_request_model.rs src/models/attachment_response_model.rs src/models/attachment_upload_data_response_model.rs +src/models/attestation_conveyance_preference.rs src/models/auth_request_create_request_model.rs src/models/auth_request_response_model.rs src/models/auth_request_response_model_list_response_model.rs src/models/auth_request_type.rs src/models/auth_request_update_request_model.rs +src/models/authentication_extensions_client_inputs.rs src/models/authentication_extensions_client_outputs.rs +src/models/authenticator_assertion_raw_response.rs +src/models/authenticator_attachment.rs src/models/authenticator_attestation_raw_response.rs +src/models/authenticator_selection.rs +src/models/authenticator_transport.rs src/models/base_access_policy_response_model.rs src/models/base_secret_response_model.rs src/models/base_secret_response_model_list_response_model.rs @@ -80,7 +91,7 @@ src/models/billing_subscription_item.rs src/models/billing_subscription_upcoming_invoice.rs src/models/billing_transaction.rs src/models/bit_pay_invoice_request_model.rs -src/models/bitwarden_product_type.rs +src/models/bulk_collection_access_request_model.rs src/models/bulk_delete_response_model.rs src/models/bulk_delete_response_model_list_response_model.rs src/models/bulk_deny_admin_auth_request_request_model.rs @@ -94,6 +105,7 @@ src/models/cipher_collections_request_model.rs src/models/cipher_create_request_model.rs src/models/cipher_details_response_model.rs src/models/cipher_details_response_model_list_response_model.rs +src/models/cipher_fido2_credential_model.rs src/models/cipher_field_model.rs src/models/cipher_identity_model.rs src/models/cipher_login_model.rs @@ -121,6 +133,7 @@ src/models/collection_response_model.rs src/models/collection_response_model_list_response_model.rs src/models/collection_with_id_request_model.rs src/models/config_response_model.rs +src/models/credential_create_options.rs src/models/delete_recover_request_model.rs src/models/device_keys_request_model.rs src/models/device_keys_update_request_model.rs @@ -145,11 +158,13 @@ src/models/emergency_access_takeover_response_model.rs src/models/emergency_access_type.rs src/models/emergency_access_update_request_model.rs src/models/emergency_access_view_response_model.rs +src/models/emergency_access_with_id_request_model.rs src/models/environment_config_response_model.rs src/models/event_response_model.rs src/models/event_response_model_list_response_model.rs src/models/event_system_user.rs src/models/event_type.rs +src/models/fido2_user.rs src/models/field_type.rs src/models/file_upload_type.rs src/models/folder_request_model.rs @@ -168,7 +183,6 @@ src/models/group_project_access_policy_response_model.rs src/models/group_request_model.rs src/models/group_response_model.rs src/models/group_service_account_access_policy_response_model.rs -src/models/iap_check_request_model.rs src/models/import_ciphers_request_model.rs src/models/import_organization_ciphers_request_model.rs src/models/import_organization_users_request_model.rs @@ -194,6 +208,7 @@ src/models/organization_api_key_information_list_response_model.rs src/models/organization_api_key_request_model.rs src/models/organization_api_key_type.rs src/models/organization_auto_enroll_status_response_model.rs +src/models/organization_collection_management_update_request_model.rs src/models/organization_connection_request_model.rs src/models/organization_connection_response_model.rs src/models/organization_connection_type.rs @@ -208,6 +223,7 @@ src/models/organization_keys_response_model.rs src/models/organization_license.rs src/models/organization_public_key_response_model.rs src/models/organization_response_model.rs +src/models/organization_risks_subscription_failure_response_model.rs src/models/organization_seat_request_model.rs src/models/organization_sponsorship_create_request_model.rs src/models/organization_sponsorship_redeem_request_model.rs @@ -237,6 +253,7 @@ src/models/organization_user_public_key_response_model_list_response_model.rs src/models/organization_user_reset_password_details_response_model.rs src/models/organization_user_reset_password_enrollment_request_model.rs src/models/organization_user_reset_password_request_model.rs +src/models/organization_user_status_type.rs src/models/organization_user_type.rs src/models/organization_user_update_groups_request_model.rs src/models/organization_user_update_request_model.rs @@ -245,12 +262,14 @@ src/models/organization_user_user_details_response_model_list_response_model.rs src/models/organization_verify_bank_request_model.rs src/models/other_device_keys_update_request_model.rs src/models/password_hint_request_model.rs +src/models/password_manager_plan_features_response_model.rs src/models/password_request_model.rs src/models/payment_method_type.rs src/models/payment_request_model.rs src/models/payment_response_model.rs src/models/pending_organization_auth_request_response_model.rs src/models/pending_organization_auth_request_response_model_list_response_model.rs +src/models/people_access_policies_request_model.rs src/models/permissions.rs src/models/plan_response_model.rs src/models/plan_response_model_list_response_model.rs @@ -272,6 +291,7 @@ src/models/profile_provider_response_model.rs src/models/profile_response_model.rs src/models/project_access_policies_response_model.rs src/models/project_create_request_model.rs +src/models/project_people_access_policies_response_model.rs src/models/project_response_model.rs src/models/project_response_model_list_response_model.rs src/models/project_update_request_model.rs @@ -301,6 +321,9 @@ src/models/provider_user_type.rs src/models/provider_user_update_request_model.rs src/models/provider_user_user_details_response_model.rs src/models/provider_user_user_details_response_model_list_response_model.rs +src/models/pub_key_cred_param.rs +src/models/public_key_credential_descriptor.rs +src/models/public_key_credential_rp_entity.rs src/models/public_key_credential_type.rs src/models/push_registration_request_model.rs src/models/push_send_request_model.rs @@ -308,6 +331,7 @@ src/models/push_type.rs src/models/push_update_request_model.rs src/models/register_request_model.rs src/models/register_response_model.rs +src/models/reset_password_with_org_id_request_model.rs src/models/response_data.rs src/models/revoke_access_tokens_request.rs src/models/saml2_binding_type.rs @@ -320,6 +344,7 @@ src/models/secret_update_request_model.rs src/models/secret_verification_request_model.rs src/models/secret_with_projects_inner_project.rs src/models/secret_with_projects_list_response_model.rs +src/models/secrets_manager_plan_features_response_model.rs src/models/secrets_manager_subscribe_request_model.rs src/models/secrets_manager_subscription_update_request_model.rs src/models/secrets_with_projects_inner_secret.rs @@ -337,8 +362,8 @@ src/models/send_text_model.rs src/models/send_type.rs src/models/send_with_id_request_model.rs src/models/server_config_response_model.rs -src/models/service_account_access_policies_response_model.rs src/models/service_account_create_request_model.rs +src/models/service_account_people_access_policies_response_model.rs src/models/service_account_project_access_policy_response_model.rs src/models/service_account_project_access_policy_response_model_list_response_model.rs src/models/service_account_response_model.rs @@ -391,6 +416,14 @@ src/models/user_key_response_model.rs src/models/user_license.rs src/models/user_project_access_policy_response_model.rs src/models/user_service_account_access_policy_response_model.rs +src/models/user_verification_requirement.rs src/models/verify_delete_recover_request_model.rs src/models/verify_email_request_model.rs src/models/verify_otp_request_model.rs +src/models/web_authn_credential_create_options_response_model.rs +src/models/web_authn_credential_response_model.rs +src/models/web_authn_credential_response_model_list_response_model.rs +src/models/web_authn_login_assertion_options_response_model.rs +src/models/web_authn_login_credential_create_request_model.rs +src/models/web_authn_login_credential_update_request_model.rs +src/models/web_authn_prf_status.rs diff --git a/crates/bitwarden-api-api/.openapi-generator/VERSION b/crates/bitwarden-api-api/.openapi-generator/VERSION index 4be2c727a..4b49d9bb6 100644 --- a/crates/bitwarden-api-api/.openapi-generator/VERSION +++ b/crates/bitwarden-api-api/.openapi-generator/VERSION @@ -1 +1 @@ -6.5.0 \ No newline at end of file +7.2.0 \ No newline at end of file diff --git a/crates/bitwarden-api-api/README.md b/crates/bitwarden-api-api/README.md index 43cbc40e8..b4dac8d9f 100644 --- a/crates/bitwarden-api-api/README.md +++ b/crates/bitwarden-api-api/README.md @@ -26,17 +26,19 @@ bitwarden-api-api = { path = "./bitwarden-api-api" } All URIs are relative to _http://localhost_ -| Class | Method | HTTP request | Description | -| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | +| Class | Method | HTTP request | Description | +| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | _AccessPoliciesApi_ | [**access_policies_id_delete**](docs/AccessPoliciesApi.md#access_policies_id_delete) | **DELETE** /access-policies/{id} | | _AccessPoliciesApi_ | [**access_policies_id_put**](docs/AccessPoliciesApi.md#access_policies_id_put) | **PUT** /access-policies/{id} | | _AccessPoliciesApi_ | [**organizations_id_access_policies_people_potential_grantees_get**](docs/AccessPoliciesApi.md#organizations_id_access_policies_people_potential_grantees_get) | **GET** /organizations/{id}/access-policies/people/potential-grantees | | _AccessPoliciesApi_ | [**organizations_id_access_policies_projects_potential_grantees_get**](docs/AccessPoliciesApi.md#organizations_id_access_policies_projects_potential_grantees_get) | **GET** /organizations/{id}/access-policies/projects/potential-grantees | | _AccessPoliciesApi_ | [**organizations_id_access_policies_service_accounts_potential_grantees_get**](docs/AccessPoliciesApi.md#organizations_id_access_policies_service_accounts_potential_grantees_get) | **GET** /organizations/{id}/access-policies/service-accounts/potential-grantees | | _AccessPoliciesApi_ | [**projects_id_access_policies_get**](docs/AccessPoliciesApi.md#projects_id_access_policies_get) | **GET** /projects/{id}/access-policies | +| _AccessPoliciesApi_ | [**projects_id_access_policies_people_get**](docs/AccessPoliciesApi.md#projects_id_access_policies_people_get) | **GET** /projects/{id}/access-policies/people | +| _AccessPoliciesApi_ | [**projects_id_access_policies_people_put**](docs/AccessPoliciesApi.md#projects_id_access_policies_people_put) | **PUT** /projects/{id}/access-policies/people | | _AccessPoliciesApi_ | [**projects_id_access_policies_post**](docs/AccessPoliciesApi.md#projects_id_access_policies_post) | **POST** /projects/{id}/access-policies | -| _AccessPoliciesApi_ | [**service_accounts_id_access_policies_get**](docs/AccessPoliciesApi.md#service_accounts_id_access_policies_get) | **GET** /service-accounts/{id}/access-policies | -| _AccessPoliciesApi_ | [**service_accounts_id_access_policies_post**](docs/AccessPoliciesApi.md#service_accounts_id_access_policies_post) | **POST** /service-accounts/{id}/access-policies | +| _AccessPoliciesApi_ | [**service_accounts_id_access_policies_people_get**](docs/AccessPoliciesApi.md#service_accounts_id_access_policies_people_get) | **GET** /service-accounts/{id}/access-policies/people | +| _AccessPoliciesApi_ | [**service_accounts_id_access_policies_people_put**](docs/AccessPoliciesApi.md#service_accounts_id_access_policies_people_put) | **PUT** /service-accounts/{id}/access-policies/people | | _AccessPoliciesApi_ | [**service_accounts_id_granted_policies_get**](docs/AccessPoliciesApi.md#service_accounts_id_granted_policies_get) | **GET** /service-accounts/{id}/granted-policies | | _AccessPoliciesApi_ | [**service_accounts_id_granted_policies_post**](docs/AccessPoliciesApi.md#service_accounts_id_granted_policies_post) | **POST** /service-accounts/{id}/granted-policies | | _AccountsApi_ | [**accounts_api_key_post**](docs/AccountsApi.md#accounts_api_key_post) | **POST** /accounts/api-key | @@ -50,7 +52,6 @@ All URIs are relative to _http://localhost_ | _AccountsApi_ | [**accounts_delete_recover_token_post**](docs/AccountsApi.md#accounts_delete_recover_token_post) | **POST** /accounts/delete-recover-token | | _AccountsApi_ | [**accounts_email_post**](docs/AccountsApi.md#accounts_email_post) | **POST** /accounts/email | | _AccountsApi_ | [**accounts_email_token_post**](docs/AccountsApi.md#accounts_email_token_post) | **POST** /accounts/email-token | -| _AccountsApi_ | [**accounts_iap_check_post**](docs/AccountsApi.md#accounts_iap_check_post) | **POST** /accounts/iap-check | | _AccountsApi_ | [**accounts_kdf_post**](docs/AccountsApi.md#accounts_kdf_post) | **POST** /accounts/kdf | | _AccountsApi_ | [**accounts_key_post**](docs/AccountsApi.md#accounts_key_post) | **POST** /accounts/key | | _AccountsApi_ | [**accounts_keys_get**](docs/AccountsApi.md#accounts_keys_get) | **GET** /accounts/keys | @@ -147,6 +148,7 @@ All URIs are relative to _http://localhost_ | _CiphersApi_ | [**ciphers_share_post**](docs/CiphersApi.md#ciphers_share_post) | **POST** /ciphers/share | | _CiphersApi_ | [**ciphers_share_put**](docs/CiphersApi.md#ciphers_share_put) | **PUT** /ciphers/share | | _CollectionsApi_ | [**collections_get**](docs/CollectionsApi.md#collections_get) | **GET** /collections | +| _CollectionsApi_ | [**organizations_org_id_collections_bulk_access_post**](docs/CollectionsApi.md#organizations_org_id_collections_bulk_access_post) | **POST** /organizations/{orgId}/collections/bulk-access | | _CollectionsApi_ | [**organizations_org_id_collections_delete**](docs/CollectionsApi.md#organizations_org_id_collections_delete) | **DELETE** /organizations/{orgId}/collections | | _CollectionsApi_ | [**organizations_org_id_collections_delete_post**](docs/CollectionsApi.md#organizations_org_id_collections_delete_post) | **POST** /organizations/{orgId}/collections/delete | | _CollectionsApi_ | [**organizations_org_id_collections_details_get**](docs/CollectionsApi.md#organizations_org_id_collections_details_get) | **GET** /organizations/{orgId}/collections/details | @@ -236,7 +238,7 @@ All URIs are relative to _http://localhost_ | _InfoApi_ | [**version_get**](docs/InfoApi.md#version_get) | **GET** /version | | _InstallationsApi_ | [**installations_id_get**](docs/InstallationsApi.md#installations_id_get) | **GET** /installations/{id} | | _InstallationsApi_ | [**installations_post**](docs/InstallationsApi.md#installations_post) | **POST** /installations | -| _LicensesApi_ | [**licenses_organization_id_get**](docs/LicensesApi.md#licenses_organization_id_get) | **GET** /licenses/organization/{id} | Used by self-hosted installations to get an updated license file | +| _LicensesApi_ | [**licenses_organization_id_get**](docs/LicensesApi.md#licenses_organization_id_get) | **GET** /licenses/organization/{id} | Used by self-hosted installations to get an updated license file | | _LicensesApi_ | [**licenses_user_id_get**](docs/LicensesApi.md#licenses_user_id_get) | **GET** /licenses/user/{id} | | _MiscApi_ | [**bitpay_invoice_post**](docs/MiscApi.md#bitpay_invoice_post) | **POST** /bitpay-invoice | | _MiscApi_ | [**setup_payment_post**](docs/MiscApi.md#setup_payment_post) | **POST** /setup-payment | @@ -304,8 +306,10 @@ All URIs are relative to _http://localhost_ | _OrganizationsApi_ | [**organizations_id_api_key_post**](docs/OrganizationsApi.md#organizations_id_api_key_post) | **POST** /organizations/{id}/api-key | | _OrganizationsApi_ | [**organizations_id_billing_get**](docs/OrganizationsApi.md#organizations_id_billing_get) | **GET** /organizations/{id}/billing | | _OrganizationsApi_ | [**organizations_id_cancel_post**](docs/OrganizationsApi.md#organizations_id_cancel_post) | **POST** /organizations/{id}/cancel | +| _OrganizationsApi_ | [**organizations_id_collection_management_put**](docs/OrganizationsApi.md#organizations_id_collection_management_put) | **PUT** /organizations/{id}/collection-management | | _OrganizationsApi_ | [**organizations_id_delete**](docs/OrganizationsApi.md#organizations_id_delete) | **DELETE** /organizations/{id} | | _OrganizationsApi_ | [**organizations_id_delete_post**](docs/OrganizationsApi.md#organizations_id_delete_post) | **POST** /organizations/{id}/delete | +| _OrganizationsApi_ | [**organizations_id_enable_collection_enhancements_post**](docs/OrganizationsApi.md#organizations_id_enable_collection_enhancements_post) | **POST** /organizations/{id}/enable-collection-enhancements | Migrates user, collection, and group data to the new Flexible Collections permissions scheme, then sets organization.FlexibleCollections to true to enable these new features for the organization. This is irreversible. | | _OrganizationsApi_ | [**organizations_id_get**](docs/OrganizationsApi.md#organizations_id_get) | **GET** /organizations/{id} | | _OrganizationsApi_ | [**organizations_id_import_post**](docs/OrganizationsApi.md#organizations_id_import_post) | **POST** /organizations/{id}/import | | _OrganizationsApi_ | [**organizations_id_keys_get**](docs/OrganizationsApi.md#organizations_id_keys_get) | **GET** /organizations/{id}/keys | @@ -317,6 +321,7 @@ All URIs are relative to _http://localhost_ | _OrganizationsApi_ | [**organizations_id_public_key_get**](docs/OrganizationsApi.md#organizations_id_public_key_get) | **GET** /organizations/{id}/public-key | | _OrganizationsApi_ | [**organizations_id_put**](docs/OrganizationsApi.md#organizations_id_put) | **PUT** /organizations/{id} | | _OrganizationsApi_ | [**organizations_id_reinstate_post**](docs/OrganizationsApi.md#organizations_id_reinstate_post) | **POST** /organizations/{id}/reinstate | +| _OrganizationsApi_ | [**organizations_id_risks_subscription_failure_get**](docs/OrganizationsApi.md#organizations_id_risks_subscription_failure_get) | **GET** /organizations/{id}/risks-subscription-failure | | _OrganizationsApi_ | [**organizations_id_rotate_api_key_post**](docs/OrganizationsApi.md#organizations_id_rotate_api_key_post) | **POST** /organizations/{id}/rotate-api-key | | _OrganizationsApi_ | [**organizations_id_seat_post**](docs/OrganizationsApi.md#organizations_id_seat_post) | **POST** /organizations/{id}/seat | | _OrganizationsApi_ | [**organizations_id_sm_subscription_post**](docs/OrganizationsApi.md#organizations_id_sm_subscription_post) | **POST** /organizations/{id}/sm-subscription | @@ -332,12 +337,11 @@ All URIs are relative to _http://localhost_ | _OrganizationsApi_ | [**organizations_id_verify_bank_post**](docs/OrganizationsApi.md#organizations_id_verify_bank_post) | **POST** /organizations/{id}/verify-bank | | _OrganizationsApi_ | [**organizations_identifier_auto_enroll_status_get**](docs/OrganizationsApi.md#organizations_identifier_auto_enroll_status_get) | **GET** /organizations/{identifier}/auto-enroll-status | | _OrganizationsApi_ | [**organizations_post**](docs/OrganizationsApi.md#organizations_post) | **POST** /organizations | -| _PlansApi_ | [**plans_all_get**](docs/PlansApi.md#plans_all_get) | **GET** /plans/all | | _PlansApi_ | [**plans_get**](docs/PlansApi.md#plans_get) | **GET** /plans | | _PlansApi_ | [**plans_sales_tax_rates_get**](docs/PlansApi.md#plans_sales_tax_rates_get) | **GET** /plans/sales-tax-rates | -| _PlansApi_ | [**plans_sm_plans_get**](docs/PlansApi.md#plans_sm_plans_get) | **GET** /plans/sm-plans | | _PoliciesApi_ | [**organizations_org_id_policies_get**](docs/PoliciesApi.md#organizations_org_id_policies_get) | **GET** /organizations/{orgId}/policies | | _PoliciesApi_ | [**organizations_org_id_policies_invited_user_get**](docs/PoliciesApi.md#organizations_org_id_policies_invited_user_get) | **GET** /organizations/{orgId}/policies/invited-user | +| _PoliciesApi_ | [**organizations_org_id_policies_master_password_get**](docs/PoliciesApi.md#organizations_org_id_policies_master_password_get) | **GET** /organizations/{orgId}/policies/master-password | | _PoliciesApi_ | [**organizations_org_id_policies_token_get**](docs/PoliciesApi.md#organizations_org_id_policies_token_get) | **GET** /organizations/{orgId}/policies/token | | _PoliciesApi_ | [**organizations_org_id_policies_type_get**](docs/PoliciesApi.md#organizations_org_id_policies_type_get) | **GET** /organizations/{orgId}/policies/{type} | | _PoliciesApi_ | [**organizations_org_id_policies_type_put**](docs/PoliciesApi.md#organizations_org_id_policies_type_put) | **PUT** /organizations/{orgId}/policies/{type} | @@ -382,6 +386,7 @@ All URIs are relative to _http://localhost_ | _SecretsApi_ | [**secrets_get_by_ids_post**](docs/SecretsApi.md#secrets_get_by_ids_post) | **POST** /secrets/get-by-ids | | _SecretsApi_ | [**secrets_id_get**](docs/SecretsApi.md#secrets_id_get) | **GET** /secrets/{id} | | _SecretsApi_ | [**secrets_id_put**](docs/SecretsApi.md#secrets_id_put) | **PUT** /secrets/{id} | +| _SecretsManagerEventsApi_ | [**sm_events_service_accounts_service_account_id_get**](docs/SecretsManagerEventsApi.md#sm_events_service_accounts_service_account_id_get) | **GET** /sm/events/service-accounts/{serviceAccountId} | | _SecretsManagerPortingApi_ | [**sm_organization_id_export_get**](docs/SecretsManagerPortingApi.md#sm_organization_id_export_get) | **GET** /sm/{organizationId}/export | | _SecretsManagerPortingApi_ | [**sm_organization_id_import_post**](docs/SecretsManagerPortingApi.md#sm_organization_id_import_post) | **POST** /sm/{organizationId}/import | | _SelfHostedOrganizationLicensesApi_ | [**organizations_licenses_self_hosted_id_post**](docs/SelfHostedOrganizationLicensesApi.md#organizations_licenses_self_hosted_id_post) | **POST** /organizations/licenses/self-hosted/{id} | @@ -450,6 +455,12 @@ All URIs are relative to _http://localhost_ | _TwoFactorApi_ | [**two_factor_yubikey_post**](docs/TwoFactorApi.md#two_factor_yubikey_post) | **POST** /two-factor/yubikey | | _TwoFactorApi_ | [**two_factor_yubikey_put**](docs/TwoFactorApi.md#two_factor_yubikey_put) | **PUT** /two-factor/yubikey | | _UsersApi_ | [**users_id_public_key_get**](docs/UsersApi.md#users_id_public_key_get) | **GET** /users/{id}/public-key | +| _WebAuthnApi_ | [**webauthn_assertion_options_post**](docs/WebAuthnApi.md#webauthn_assertion_options_post) | **POST** /webauthn/assertion-options | +| _WebAuthnApi_ | [**webauthn_attestation_options_post**](docs/WebAuthnApi.md#webauthn_attestation_options_post) | **POST** /webauthn/attestation-options | +| _WebAuthnApi_ | [**webauthn_get**](docs/WebAuthnApi.md#webauthn_get) | **GET** /webauthn | +| _WebAuthnApi_ | [**webauthn_id_delete_post**](docs/WebAuthnApi.md#webauthn_id_delete_post) | **POST** /webauthn/{id}/delete | +| _WebAuthnApi_ | [**webauthn_post**](docs/WebAuthnApi.md#webauthn_post) | **POST** /webauthn | +| _WebAuthnApi_ | [**webauthn_put**](docs/WebAuthnApi.md#webauthn_put) | **PUT** /webauthn | ## Documentation For Models @@ -461,17 +472,26 @@ All URIs are relative to _http://localhost_ - [AccessTokenResponseModel](docs/AccessTokenResponseModel.md) - [AccessTokenResponseModelListResponseModel](docs/AccessTokenResponseModelListResponseModel.md) - [AdminAuthRequestUpdateRequestModel](docs/AdminAuthRequestUpdateRequestModel.md) +- [Algorithm](docs/Algorithm.md) - [ApiKeyResponseModel](docs/ApiKeyResponseModel.md) +- [AssertionOptions](docs/AssertionOptions.md) +- [AssertionResponse](docs/AssertionResponse.md) - [AttachmentRequestModel](docs/AttachmentRequestModel.md) - [AttachmentResponseModel](docs/AttachmentResponseModel.md) - [AttachmentUploadDataResponseModel](docs/AttachmentUploadDataResponseModel.md) +- [AttestationConveyancePreference](docs/AttestationConveyancePreference.md) - [AuthRequestCreateRequestModel](docs/AuthRequestCreateRequestModel.md) - [AuthRequestResponseModel](docs/AuthRequestResponseModel.md) - [AuthRequestResponseModelListResponseModel](docs/AuthRequestResponseModelListResponseModel.md) - [AuthRequestType](docs/AuthRequestType.md) - [AuthRequestUpdateRequestModel](docs/AuthRequestUpdateRequestModel.md) +- [AuthenticationExtensionsClientInputs](docs/AuthenticationExtensionsClientInputs.md) - [AuthenticationExtensionsClientOutputs](docs/AuthenticationExtensionsClientOutputs.md) +- [AuthenticatorAssertionRawResponse](docs/AuthenticatorAssertionRawResponse.md) +- [AuthenticatorAttachment](docs/AuthenticatorAttachment.md) - [AuthenticatorAttestationRawResponse](docs/AuthenticatorAttestationRawResponse.md) +- [AuthenticatorSelection](docs/AuthenticatorSelection.md) +- [AuthenticatorTransport](docs/AuthenticatorTransport.md) - [BaseAccessPolicyResponseModel](docs/BaseAccessPolicyResponseModel.md) - [BaseSecretResponseModel](docs/BaseSecretResponseModel.md) - [BaseSecretResponseModelListResponseModel](docs/BaseSecretResponseModelListResponseModel.md) @@ -486,7 +506,7 @@ All URIs are relative to _http://localhost_ - [BillingSubscriptionUpcomingInvoice](docs/BillingSubscriptionUpcomingInvoice.md) - [BillingTransaction](docs/BillingTransaction.md) - [BitPayInvoiceRequestModel](docs/BitPayInvoiceRequestModel.md) -- [BitwardenProductType](docs/BitwardenProductType.md) +- [BulkCollectionAccessRequestModel](docs/BulkCollectionAccessRequestModel.md) - [BulkDeleteResponseModel](docs/BulkDeleteResponseModel.md) - [BulkDeleteResponseModelListResponseModel](docs/BulkDeleteResponseModelListResponseModel.md) - [BulkDenyAdminAuthRequestRequestModel](docs/BulkDenyAdminAuthRequestRequestModel.md) @@ -500,6 +520,7 @@ All URIs are relative to _http://localhost_ - [CipherCreateRequestModel](docs/CipherCreateRequestModel.md) - [CipherDetailsResponseModel](docs/CipherDetailsResponseModel.md) - [CipherDetailsResponseModelListResponseModel](docs/CipherDetailsResponseModelListResponseModel.md) +- [CipherFido2CredentialModel](docs/CipherFido2CredentialModel.md) - [CipherFieldModel](docs/CipherFieldModel.md) - [CipherIdentityModel](docs/CipherIdentityModel.md) - [CipherLoginModel](docs/CipherLoginModel.md) @@ -527,6 +548,7 @@ All URIs are relative to _http://localhost_ - [CollectionResponseModelListResponseModel](docs/CollectionResponseModelListResponseModel.md) - [CollectionWithIdRequestModel](docs/CollectionWithIdRequestModel.md) - [ConfigResponseModel](docs/ConfigResponseModel.md) +- [CredentialCreateOptions](docs/CredentialCreateOptions.md) - [DeleteRecoverRequestModel](docs/DeleteRecoverRequestModel.md) - [DeviceKeysRequestModel](docs/DeviceKeysRequestModel.md) - [DeviceKeysUpdateRequestModel](docs/DeviceKeysUpdateRequestModel.md) @@ -551,11 +573,13 @@ All URIs are relative to _http://localhost_ - [EmergencyAccessType](docs/EmergencyAccessType.md) - [EmergencyAccessUpdateRequestModel](docs/EmergencyAccessUpdateRequestModel.md) - [EmergencyAccessViewResponseModel](docs/EmergencyAccessViewResponseModel.md) +- [EmergencyAccessWithIdRequestModel](docs/EmergencyAccessWithIdRequestModel.md) - [EnvironmentConfigResponseModel](docs/EnvironmentConfigResponseModel.md) - [EventResponseModel](docs/EventResponseModel.md) - [EventResponseModelListResponseModel](docs/EventResponseModelListResponseModel.md) - [EventSystemUser](docs/EventSystemUser.md) - [EventType](docs/EventType.md) +- [Fido2User](docs/Fido2User.md) - [FieldType](docs/FieldType.md) - [FileUploadType](docs/FileUploadType.md) - [FolderRequestModel](docs/FolderRequestModel.md) @@ -574,7 +598,6 @@ All URIs are relative to _http://localhost_ - [GroupRequestModel](docs/GroupRequestModel.md) - [GroupResponseModel](docs/GroupResponseModel.md) - [GroupServiceAccountAccessPolicyResponseModel](docs/GroupServiceAccountAccessPolicyResponseModel.md) -- [IapCheckRequestModel](docs/IapCheckRequestModel.md) - [ImportCiphersRequestModel](docs/ImportCiphersRequestModel.md) - [ImportOrganizationCiphersRequestModel](docs/ImportOrganizationCiphersRequestModel.md) - [ImportOrganizationUsersRequestModel](docs/ImportOrganizationUsersRequestModel.md) @@ -599,6 +622,7 @@ All URIs are relative to _http://localhost_ - [OrganizationApiKeyRequestModel](docs/OrganizationApiKeyRequestModel.md) - [OrganizationApiKeyType](docs/OrganizationApiKeyType.md) - [OrganizationAutoEnrollStatusResponseModel](docs/OrganizationAutoEnrollStatusResponseModel.md) +- [OrganizationCollectionManagementUpdateRequestModel](docs/OrganizationCollectionManagementUpdateRequestModel.md) - [OrganizationConnectionRequestModel](docs/OrganizationConnectionRequestModel.md) - [OrganizationConnectionResponseModel](docs/OrganizationConnectionResponseModel.md) - [OrganizationConnectionType](docs/OrganizationConnectionType.md) @@ -613,6 +637,7 @@ All URIs are relative to _http://localhost_ - [OrganizationLicense](docs/OrganizationLicense.md) - [OrganizationPublicKeyResponseModel](docs/OrganizationPublicKeyResponseModel.md) - [OrganizationResponseModel](docs/OrganizationResponseModel.md) +- [OrganizationRisksSubscriptionFailureResponseModel](docs/OrganizationRisksSubscriptionFailureResponseModel.md) - [OrganizationSeatRequestModel](docs/OrganizationSeatRequestModel.md) - [OrganizationSponsorshipCreateRequestModel](docs/OrganizationSponsorshipCreateRequestModel.md) - [OrganizationSponsorshipRedeemRequestModel](docs/OrganizationSponsorshipRedeemRequestModel.md) @@ -651,12 +676,14 @@ All URIs are relative to _http://localhost_ - [OrganizationVerifyBankRequestModel](docs/OrganizationVerifyBankRequestModel.md) - [OtherDeviceKeysUpdateRequestModel](docs/OtherDeviceKeysUpdateRequestModel.md) - [PasswordHintRequestModel](docs/PasswordHintRequestModel.md) +- [PasswordManagerPlanFeaturesResponseModel](docs/PasswordManagerPlanFeaturesResponseModel.md) - [PasswordRequestModel](docs/PasswordRequestModel.md) - [PaymentMethodType](docs/PaymentMethodType.md) - [PaymentRequestModel](docs/PaymentRequestModel.md) - [PaymentResponseModel](docs/PaymentResponseModel.md) - [PendingOrganizationAuthRequestResponseModel](docs/PendingOrganizationAuthRequestResponseModel.md) - [PendingOrganizationAuthRequestResponseModelListResponseModel](docs/PendingOrganizationAuthRequestResponseModelListResponseModel.md) +- [PeopleAccessPoliciesRequestModel](docs/PeopleAccessPoliciesRequestModel.md) - [Permissions](docs/Permissions.md) - [PlanResponseModel](docs/PlanResponseModel.md) - [PlanResponseModelListResponseModel](docs/PlanResponseModelListResponseModel.md) @@ -678,6 +705,7 @@ All URIs are relative to _http://localhost_ - [ProfileResponseModel](docs/ProfileResponseModel.md) - [ProjectAccessPoliciesResponseModel](docs/ProjectAccessPoliciesResponseModel.md) - [ProjectCreateRequestModel](docs/ProjectCreateRequestModel.md) +- [ProjectPeopleAccessPoliciesResponseModel](docs/ProjectPeopleAccessPoliciesResponseModel.md) - [ProjectResponseModel](docs/ProjectResponseModel.md) - [ProjectResponseModelListResponseModel](docs/ProjectResponseModelListResponseModel.md) - [ProjectUpdateRequestModel](docs/ProjectUpdateRequestModel.md) @@ -707,6 +735,9 @@ All URIs are relative to _http://localhost_ - [ProviderUserUpdateRequestModel](docs/ProviderUserUpdateRequestModel.md) - [ProviderUserUserDetailsResponseModel](docs/ProviderUserUserDetailsResponseModel.md) - [ProviderUserUserDetailsResponseModelListResponseModel](docs/ProviderUserUserDetailsResponseModelListResponseModel.md) +- [PubKeyCredParam](docs/PubKeyCredParam.md) +- [PublicKeyCredentialDescriptor](docs/PublicKeyCredentialDescriptor.md) +- [PublicKeyCredentialRpEntity](docs/PublicKeyCredentialRpEntity.md) - [PublicKeyCredentialType](docs/PublicKeyCredentialType.md) - [PushRegistrationRequestModel](docs/PushRegistrationRequestModel.md) - [PushSendRequestModel](docs/PushSendRequestModel.md) @@ -714,6 +745,7 @@ All URIs are relative to _http://localhost_ - [PushUpdateRequestModel](docs/PushUpdateRequestModel.md) - [RegisterRequestModel](docs/RegisterRequestModel.md) - [RegisterResponseModel](docs/RegisterResponseModel.md) +- [ResetPasswordWithOrgIdRequestModel](docs/ResetPasswordWithOrgIdRequestModel.md) - [ResponseData](docs/ResponseData.md) - [RevokeAccessTokensRequest](docs/RevokeAccessTokensRequest.md) - [Saml2BindingType](docs/Saml2BindingType.md) @@ -726,6 +758,7 @@ All URIs are relative to _http://localhost_ - [SecretVerificationRequestModel](docs/SecretVerificationRequestModel.md) - [SecretWithProjectsInnerProject](docs/SecretWithProjectsInnerProject.md) - [SecretWithProjectsListResponseModel](docs/SecretWithProjectsListResponseModel.md) +- [SecretsManagerPlanFeaturesResponseModel](docs/SecretsManagerPlanFeaturesResponseModel.md) - [SecretsManagerSubscribeRequestModel](docs/SecretsManagerSubscribeRequestModel.md) - [SecretsManagerSubscriptionUpdateRequestModel](docs/SecretsManagerSubscriptionUpdateRequestModel.md) - [SecretsWithProjectsInnerSecret](docs/SecretsWithProjectsInnerSecret.md) @@ -743,8 +776,8 @@ All URIs are relative to _http://localhost_ - [SendType](docs/SendType.md) - [SendWithIdRequestModel](docs/SendWithIdRequestModel.md) - [ServerConfigResponseModel](docs/ServerConfigResponseModel.md) -- [ServiceAccountAccessPoliciesResponseModel](docs/ServiceAccountAccessPoliciesResponseModel.md) - [ServiceAccountCreateRequestModel](docs/ServiceAccountCreateRequestModel.md) +- [ServiceAccountPeopleAccessPoliciesResponseModel](docs/ServiceAccountPeopleAccessPoliciesResponseModel.md) - [ServiceAccountProjectAccessPolicyResponseModel](docs/ServiceAccountProjectAccessPolicyResponseModel.md) - [ServiceAccountProjectAccessPolicyResponseModelListResponseModel](docs/ServiceAccountProjectAccessPolicyResponseModelListResponseModel.md) - [ServiceAccountResponseModel](docs/ServiceAccountResponseModel.md) @@ -797,9 +830,17 @@ All URIs are relative to _http://localhost_ - [UserLicense](docs/UserLicense.md) - [UserProjectAccessPolicyResponseModel](docs/UserProjectAccessPolicyResponseModel.md) - [UserServiceAccountAccessPolicyResponseModel](docs/UserServiceAccountAccessPolicyResponseModel.md) +- [UserVerificationRequirement](docs/UserVerificationRequirement.md) - [VerifyDeleteRecoverRequestModel](docs/VerifyDeleteRecoverRequestModel.md) - [VerifyEmailRequestModel](docs/VerifyEmailRequestModel.md) - [VerifyOtpRequestModel](docs/VerifyOtpRequestModel.md) +- [WebAuthnCredentialCreateOptionsResponseModel](docs/WebAuthnCredentialCreateOptionsResponseModel.md) +- [WebAuthnCredentialResponseModel](docs/WebAuthnCredentialResponseModel.md) +- [WebAuthnCredentialResponseModelListResponseModel](docs/WebAuthnCredentialResponseModelListResponseModel.md) +- [WebAuthnLoginAssertionOptionsResponseModel](docs/WebAuthnLoginAssertionOptionsResponseModel.md) +- [WebAuthnLoginCredentialCreateRequestModel](docs/WebAuthnLoginCredentialCreateRequestModel.md) +- [WebAuthnLoginCredentialUpdateRequestModel](docs/WebAuthnLoginCredentialUpdateRequestModel.md) +- [WebAuthnPrfStatus](docs/WebAuthnPrfStatus.md) To get access to the crate's generated documentation, use: diff --git a/crates/bitwarden-api-api/src/apis/access_policies_api.rs b/crates/bitwarden-api-api/src/apis/access_policies_api.rs index 9eb40719d..9f1135beb 100644 --- a/crates/bitwarden-api-api/src/apis/access_policies_api.rs +++ b/crates/bitwarden-api-api/src/apis/access_policies_api.rs @@ -58,6 +58,20 @@ pub enum ProjectsIdAccessPoliciesGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`projects_id_access_policies_people_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProjectsIdAccessPoliciesPeopleGetError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`projects_id_access_policies_people_put`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ProjectsIdAccessPoliciesPeoplePutError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`projects_id_access_policies_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -65,17 +79,17 @@ pub enum ProjectsIdAccessPoliciesPostError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`service_accounts_id_access_policies_get`] +/// struct for typed errors of method [`service_accounts_id_access_policies_people_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServiceAccountsIdAccessPoliciesGetError { +pub enum ServiceAccountsIdAccessPoliciesPeopleGetError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`service_accounts_id_access_policies_post`] +/// struct for typed errors of method [`service_accounts_id_access_policies_people_put`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ServiceAccountsIdAccessPoliciesPostError { +pub enum ServiceAccountsIdAccessPoliciesPeoplePutError { UnknownValue(serde_json::Value), } @@ -373,6 +387,102 @@ pub async fn projects_id_access_policies_get( } } +pub async fn projects_id_access_policies_people_get( + configuration: &configuration::Configuration, + id: uuid::Uuid, +) -> Result< + crate::models::ProjectPeopleAccessPoliciesResponseModel, + Error, +> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/projects/{id}/access-policies/people", + local_var_configuration.base_path, + id = crate::apis::urlencode(id.to_string()) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn projects_id_access_policies_people_put( + configuration: &configuration::Configuration, + id: uuid::Uuid, + people_access_policies_request_model: Option, +) -> Result< + crate::models::ProjectPeopleAccessPoliciesResponseModel, + Error, +> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/projects/{id}/access-policies/people", + local_var_configuration.base_path, + id = crate::apis::urlencode(id.to_string()) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&people_access_policies_request_model); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + pub async fn projects_id_access_policies_post( configuration: &configuration::Configuration, id: uuid::Uuid, @@ -422,19 +532,19 @@ pub async fn projects_id_access_policies_post( } } -pub async fn service_accounts_id_access_policies_get( +pub async fn service_accounts_id_access_policies_people_get( configuration: &configuration::Configuration, id: uuid::Uuid, ) -> Result< - crate::models::ServiceAccountAccessPoliciesResponseModel, - Error, + crate::models::ServiceAccountPeopleAccessPoliciesResponseModel, + Error, > { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!( - "{}/service-accounts/{id}/access-policies", + "{}/service-accounts/{id}/access-policies/people", local_var_configuration.base_path, id = crate::apis::urlencode(id.to_string()) ); @@ -458,7 +568,7 @@ pub async fn service_accounts_id_access_policies_get( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, @@ -469,25 +579,25 @@ pub async fn service_accounts_id_access_policies_get( } } -pub async fn service_accounts_id_access_policies_post( +pub async fn service_accounts_id_access_policies_people_put( configuration: &configuration::Configuration, id: uuid::Uuid, - access_policies_create_request: Option, + people_access_policies_request_model: Option, ) -> Result< - crate::models::ServiceAccountAccessPoliciesResponseModel, - Error, + crate::models::ServiceAccountPeopleAccessPoliciesResponseModel, + Error, > { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!( - "{}/service-accounts/{id}/access-policies", + "{}/service-accounts/{id}/access-policies/people", local_var_configuration.base_path, id = crate::apis::urlencode(id.to_string()) ); let mut local_var_req_builder = - local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = @@ -496,7 +606,7 @@ pub async fn service_accounts_id_access_policies_post( if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; - local_var_req_builder = local_var_req_builder.json(&access_policies_create_request); + local_var_req_builder = local_var_req_builder.json(&people_access_policies_request_model); let local_var_req = local_var_req_builder.build()?; let local_var_resp = local_var_client.execute(local_var_req).await?; @@ -507,7 +617,7 @@ pub async fn service_accounts_id_access_policies_post( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); let local_var_error = ResponseContent { status: local_var_status, diff --git a/crates/bitwarden-api-api/src/apis/accounts_api.rs b/crates/bitwarden-api-api/src/apis/accounts_api.rs index 9e3349409..23b1c1d85 100644 --- a/crates/bitwarden-api-api/src/apis/accounts_api.rs +++ b/crates/bitwarden-api-api/src/apis/accounts_api.rs @@ -90,13 +90,6 @@ pub enum AccountsEmailTokenPostError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`accounts_iap_check_post`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AccountsIapCheckPostError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`accounts_kdf_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -787,47 +780,6 @@ pub async fn accounts_email_token_post( } } -pub async fn accounts_iap_check_post( - configuration: &configuration::Configuration, - iap_check_request_model: Option, -) -> Result<(), Error> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/accounts/iap-check", local_var_configuration.base_path); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - local_var_req_builder = local_var_req_builder.json(&iap_check_request_model); - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - Ok(()) - } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; - Err(Error::ResponseError(local_var_error)) - } -} - pub async fn accounts_kdf_post( configuration: &configuration::Configuration, kdf_request_model: Option, diff --git a/crates/bitwarden-api-api/src/apis/ciphers_api.rs b/crates/bitwarden-api-api/src/apis/ciphers_api.rs index 4ca7f4969..5a1466c75 100644 --- a/crates/bitwarden-api-api/src/apis/ciphers_api.rs +++ b/crates/bitwarden-api-api/src/apis/ciphers_api.rs @@ -1072,7 +1072,7 @@ pub async fn ciphers_id_attachment_attachment_id_admin_delete( pub async fn ciphers_id_attachment_attachment_id_delete( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, attachment_id: &str, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -1164,7 +1164,7 @@ pub async fn ciphers_id_attachment_attachment_id_delete_admin_post( pub async fn ciphers_id_attachment_attachment_id_delete_post( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, attachment_id: &str, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -1210,7 +1210,7 @@ pub async fn ciphers_id_attachment_attachment_id_delete_post( pub async fn ciphers_id_attachment_attachment_id_get( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, attachment_id: &str, ) -> Result> { @@ -1257,7 +1257,7 @@ pub async fn ciphers_id_attachment_attachment_id_get( pub async fn ciphers_id_attachment_attachment_id_post( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, attachment_id: &str, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -1303,7 +1303,7 @@ pub async fn ciphers_id_attachment_attachment_id_post( pub async fn ciphers_id_attachment_attachment_id_renew_get( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, attachment_id: &str, ) -> Result< crate::models::AttachmentUploadDataResponseModel, @@ -1403,7 +1403,7 @@ pub async fn ciphers_id_attachment_attachment_id_share_post( pub async fn ciphers_id_attachment_post( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, ) -> Result> { let local_var_configuration = configuration; @@ -1447,7 +1447,7 @@ pub async fn ciphers_id_attachment_post( pub async fn ciphers_id_attachment_v2_post( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, attachment_request_model: Option, ) -> Result> { @@ -1586,7 +1586,7 @@ pub async fn ciphers_id_collections_admin_put( pub async fn ciphers_id_collections_post( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, cipher_collections_request_model: Option, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -1632,7 +1632,7 @@ pub async fn ciphers_id_collections_post( pub async fn ciphers_id_collections_put( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, cipher_collections_request_model: Option, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -1678,7 +1678,7 @@ pub async fn ciphers_id_collections_put( pub async fn ciphers_id_delete( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -1810,7 +1810,7 @@ pub async fn ciphers_id_delete_admin_put( pub async fn ciphers_id_delete_post( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -1854,7 +1854,7 @@ pub async fn ciphers_id_delete_post( pub async fn ciphers_id_delete_put( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -1898,7 +1898,7 @@ pub async fn ciphers_id_delete_put( pub async fn ciphers_id_details_get( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, ) -> Result> { let local_var_configuration = configuration; @@ -1942,7 +1942,7 @@ pub async fn ciphers_id_details_get( pub async fn ciphers_id_full_details_get( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, ) -> Result> { let local_var_configuration = configuration; @@ -1986,7 +1986,7 @@ pub async fn ciphers_id_full_details_get( pub async fn ciphers_id_get( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, ) -> Result> { let local_var_configuration = configuration; @@ -2030,7 +2030,7 @@ pub async fn ciphers_id_get( pub async fn ciphers_id_partial_post( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, cipher_partial_request_model: Option, ) -> Result> { let local_var_configuration = configuration; @@ -2076,7 +2076,7 @@ pub async fn ciphers_id_partial_post( pub async fn ciphers_id_partial_put( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, cipher_partial_request_model: Option, ) -> Result> { let local_var_configuration = configuration; @@ -2258,7 +2258,7 @@ pub async fn ciphers_id_restore_admin_put( pub async fn ciphers_id_restore_put( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, ) -> Result> { let local_var_configuration = configuration; @@ -2302,7 +2302,7 @@ pub async fn ciphers_id_restore_put( pub async fn ciphers_id_share_post( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, cipher_share_request_model: Option, ) -> Result> { let local_var_configuration = configuration; @@ -2348,7 +2348,7 @@ pub async fn ciphers_id_share_post( pub async fn ciphers_id_share_put( configuration: &configuration::Configuration, - id: &str, + id: uuid::Uuid, cipher_share_request_model: Option, ) -> Result> { let local_var_configuration = configuration; diff --git a/crates/bitwarden-api-api/src/apis/collections_api.rs b/crates/bitwarden-api-api/src/apis/collections_api.rs index c95ac5529..d6c302538 100644 --- a/crates/bitwarden-api-api/src/apis/collections_api.rs +++ b/crates/bitwarden-api-api/src/apis/collections_api.rs @@ -20,6 +20,13 @@ pub enum CollectionsGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`organizations_org_id_collections_bulk_access_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrganizationsOrgIdCollectionsBulkAccessPostError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`organizations_org_id_collections_delete`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -169,9 +176,55 @@ pub async fn collections_get( } } +pub async fn organizations_org_id_collections_bulk_access_post( + configuration: &configuration::Configuration, + org_id: uuid::Uuid, + bulk_collection_access_request_model: Option, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/organizations/{orgId}/collections/bulk-access", + local_var_configuration.base_path, + orgId = crate::apis::urlencode(org_id.to_string()) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&bulk_collection_access_request_model); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + pub async fn organizations_org_id_collections_delete( configuration: &configuration::Configuration, - org_id: &str, + org_id: uuid::Uuid, collection_bulk_delete_request_model: Option, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -217,7 +270,7 @@ pub async fn organizations_org_id_collections_delete( pub async fn organizations_org_id_collections_delete_post( configuration: &configuration::Configuration, - org_id: &str, + org_id: uuid::Uuid, collection_bulk_delete_request_model: Option, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -449,9 +502,9 @@ pub async fn organizations_org_id_collections_id_delete_post( pub async fn organizations_org_id_collections_id_delete_user_org_user_id_post( configuration: &configuration::Configuration, - org_id: &str, - id: &str, - org_user_id: &str, + org_id: uuid::Uuid, + id: uuid::Uuid, + org_user_id: uuid::Uuid, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -691,9 +744,9 @@ pub async fn organizations_org_id_collections_id_put( pub async fn organizations_org_id_collections_id_user_org_user_id_delete( configuration: &configuration::Configuration, - org_id: &str, - id: &str, - org_user_id: &str, + org_id: uuid::Uuid, + id: uuid::Uuid, + org_user_id: uuid::Uuid, ) -> Result<(), Error> { let local_var_configuration = configuration; diff --git a/crates/bitwarden-api-api/src/apis/configuration.rs b/crates/bitwarden-api-api/src/apis/configuration.rs index 6b5e1c3a3..83d56c8a5 100644 --- a/crates/bitwarden-api-api/src/apis/configuration.rs +++ b/crates/bitwarden-api-api/src/apis/configuration.rs @@ -8,8 +8,6 @@ * Generated by: https://openapi-generator.tech */ -use reqwest; - #[derive(Debug, Clone)] pub struct Configuration { pub base_path: String, diff --git a/crates/bitwarden-api-api/src/apis/devices_api.rs b/crates/bitwarden-api-api/src/apis/devices_api.rs index 95564464a..71cfdaade 100644 --- a/crates/bitwarden-api-api/src/apis/devices_api.rs +++ b/crates/bitwarden-api-api/src/apis/devices_api.rs @@ -815,8 +815,8 @@ pub async fn devices_knowndevice_email_identifier_get( pub async fn devices_knowndevice_get( configuration: &configuration::Configuration, - x_request_email: Option<&str>, - x_device_identifier: Option<&str>, + x_request_email: &str, + x_device_identifier: &str, ) -> Result> { let local_var_configuration = configuration; @@ -830,14 +830,10 @@ pub async fn devices_knowndevice_get( local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } - if let Some(local_var_param_value) = x_request_email { - local_var_req_builder = - local_var_req_builder.header("x-Request-Email", local_var_param_value.to_string()); - } - if let Some(local_var_param_value) = x_device_identifier { - local_var_req_builder = - local_var_req_builder.header("x-Device-Identifier", local_var_param_value.to_string()); - } + local_var_req_builder = + local_var_req_builder.header("x-Request-Email", x_request_email.to_string()); + local_var_req_builder = + local_var_req_builder.header("x-Device-Identifier", x_device_identifier.to_string()); if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); }; diff --git a/crates/bitwarden-api-api/src/apis/groups_api.rs b/crates/bitwarden-api-api/src/apis/groups_api.rs index d52fcd200..5918989f4 100644 --- a/crates/bitwarden-api-api/src/apis/groups_api.rs +++ b/crates/bitwarden-api-api/src/apis/groups_api.rs @@ -206,7 +206,7 @@ pub async fn organizations_org_id_groups_delete_post( pub async fn organizations_org_id_groups_get( configuration: &configuration::Configuration, - org_id: &str, + org_id: uuid::Uuid, ) -> Result< crate::models::GroupDetailsResponseModelListResponseModel, Error, diff --git a/crates/bitwarden-api-api/src/apis/mod.rs b/crates/bitwarden-api-api/src/apis/mod.rs index 492680582..b99dc592d 100644 --- a/crates/bitwarden-api-api/src/apis/mod.rs +++ b/crates/bitwarden-api-api/src/apis/mod.rs @@ -60,6 +60,37 @@ pub fn urlencode>(s: T) -> String { ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() } +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + } + serde_json::Value::String(s) => { + params.push((format!("{}[{}]", prefix, key), s.clone())) + } + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + pub mod access_policies_api; pub mod accounts_api; pub mod accounts_billing_api; @@ -93,6 +124,7 @@ pub mod provider_users_api; pub mod providers_api; pub mod push_api; pub mod secrets_api; +pub mod secrets_manager_events_api; pub mod secrets_manager_porting_api; pub mod self_hosted_organization_licenses_api; pub mod self_hosted_organization_sponsorships_api; @@ -103,5 +135,6 @@ pub mod sync_api; pub mod trash_api; pub mod two_factor_api; pub mod users_api; +pub mod web_authn_api; pub mod configuration; diff --git a/crates/bitwarden-api-api/src/apis/organization_domain_api.rs b/crates/bitwarden-api-api/src/apis/organization_domain_api.rs index 4e10ff78f..c55e95f2a 100644 --- a/crates/bitwarden-api-api/src/apis/organization_domain_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_domain_api.rs @@ -114,7 +114,7 @@ pub async fn organizations_domain_sso_details_post( pub async fn organizations_org_id_domain_get( configuration: &configuration::Configuration, - org_id: &str, + org_id: uuid::Uuid, ) -> Result< crate::models::OrganizationDomainResponseModelListResponseModel, Error, @@ -161,8 +161,8 @@ pub async fn organizations_org_id_domain_get( pub async fn organizations_org_id_domain_id_delete( configuration: &configuration::Configuration, - org_id: &str, - id: &str, + org_id: uuid::Uuid, + id: uuid::Uuid, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -207,8 +207,8 @@ pub async fn organizations_org_id_domain_id_delete( pub async fn organizations_org_id_domain_id_get( configuration: &configuration::Configuration, - org_id: &str, - id: &str, + org_id: uuid::Uuid, + id: uuid::Uuid, ) -> Result> { let local_var_configuration = configuration; @@ -254,8 +254,8 @@ pub async fn organizations_org_id_domain_id_get( pub async fn organizations_org_id_domain_id_remove_post( configuration: &configuration::Configuration, - org_id: &str, - id: &str, + org_id: uuid::Uuid, + id: uuid::Uuid, ) -> Result<(), Error> { let local_var_configuration = configuration; @@ -300,8 +300,8 @@ pub async fn organizations_org_id_domain_id_remove_post( pub async fn organizations_org_id_domain_id_verify_post( configuration: &configuration::Configuration, - org_id: &str, - id: &str, + org_id: uuid::Uuid, + id: uuid::Uuid, ) -> Result< crate::models::OrganizationDomainResponseModel, Error, @@ -349,7 +349,7 @@ pub async fn organizations_org_id_domain_id_verify_post( pub async fn organizations_org_id_domain_post( configuration: &configuration::Configuration, - org_id: &str, + org_id: uuid::Uuid, organization_domain_request_model: Option, ) -> Result> { diff --git a/crates/bitwarden-api-api/src/apis/organization_users_api.rs b/crates/bitwarden-api-api/src/apis/organization_users_api.rs index 804a29019..ef9fd864f 100644 --- a/crates/bitwarden-api-api/src/apis/organization_users_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_users_api.rs @@ -484,7 +484,7 @@ pub async fn organizations_org_id_users_enable_secrets_manager_put( pub async fn organizations_org_id_users_get( configuration: &configuration::Configuration, - org_id: &str, + org_id: uuid::Uuid, include_groups: Option, include_collections: Option, ) -> Result< diff --git a/crates/bitwarden-api-api/src/apis/organizations_api.rs b/crates/bitwarden-api-api/src/apis/organizations_api.rs index 6377ef6bf..cd9c3326a 100644 --- a/crates/bitwarden-api-api/src/apis/organizations_api.rs +++ b/crates/bitwarden-api-api/src/apis/organizations_api.rs @@ -48,6 +48,13 @@ pub enum OrganizationsIdCancelPostError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`organizations_id_collection_management_put`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrganizationsIdCollectionManagementPutError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`organizations_id_delete`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -62,6 +69,13 @@ pub enum OrganizationsIdDeletePostError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`organizations_id_enable_collection_enhancements_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrganizationsIdEnableCollectionEnhancementsPostError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`organizations_id_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -139,6 +153,13 @@ pub enum OrganizationsIdReinstatePostError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`organizations_id_risks_subscription_failure_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrganizationsIdRisksSubscriptionFailureGetError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`organizations_id_rotate_api_key_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -464,6 +485,58 @@ pub async fn organizations_id_cancel_post( } } +pub async fn organizations_id_collection_management_put( + configuration: &configuration::Configuration, + id: uuid::Uuid, + organization_collection_management_update_request_model: Option< + crate::models::OrganizationCollectionManagementUpdateRequestModel, + >, +) -> Result< + crate::models::OrganizationResponseModel, + Error, +> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/organizations/{id}/collection-management", + local_var_configuration.base_path, + id = crate::apis::urlencode(id.to_string()) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = + local_var_req_builder.json(&organization_collection_management_update_request_model); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + pub async fn organizations_id_delete( configuration: &configuration::Configuration, id: &str, @@ -556,6 +629,50 @@ pub async fn organizations_id_delete_post( } } +pub async fn organizations_id_enable_collection_enhancements_post( + configuration: &configuration::Configuration, + id: uuid::Uuid, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/organizations/{id}/enable-collection-enhancements", + local_var_configuration.base_path, + id = crate::apis::urlencode(id.to_string()) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + pub async fn organizations_id_get( configuration: &configuration::Configuration, id: &str, @@ -1060,6 +1177,53 @@ pub async fn organizations_id_reinstate_post( } } +pub async fn organizations_id_risks_subscription_failure_get( + configuration: &configuration::Configuration, + id: uuid::Uuid, +) -> Result< + crate::models::OrganizationRisksSubscriptionFailureResponseModel, + Error, +> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/organizations/{id}/risks-subscription-failure", + local_var_configuration.base_path, + id = crate::apis::urlencode(id.to_string()) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + pub async fn organizations_id_rotate_api_key_post( configuration: &configuration::Configuration, id: &str, diff --git a/crates/bitwarden-api-api/src/apis/plans_api.rs b/crates/bitwarden-api-api/src/apis/plans_api.rs index 83a9da2b9..e0430ac66 100644 --- a/crates/bitwarden-api-api/src/apis/plans_api.rs +++ b/crates/bitwarden-api-api/src/apis/plans_api.rs @@ -13,13 +13,6 @@ use reqwest; use super::{configuration, Error}; use crate::apis::ResponseContent; -/// struct for typed errors of method [`plans_all_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PlansAllGetError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`plans_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -34,52 +27,6 @@ pub enum PlansSalesTaxRatesGetError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`plans_sm_plans_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PlansSmPlansGetError { - UnknownValue(serde_json::Value), -} - -pub async fn plans_all_get( - configuration: &configuration::Configuration, -) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/plans/all", local_var_configuration.base_path); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; - Err(Error::ResponseError(local_var_error)) - } -} - pub async fn plans_get( configuration: &configuration::Configuration, ) -> Result> { @@ -160,42 +107,3 @@ pub async fn plans_sales_tax_rates_get( Err(Error::ResponseError(local_var_error)) } } - -pub async fn plans_sm_plans_get( - configuration: &configuration::Configuration, -) -> Result> { - let local_var_configuration = configuration; - - let local_var_client = &local_var_configuration.client; - - let local_var_uri_str = format!("{}/plans/sm-plans", local_var_configuration.base_path); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - - if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); - } - if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { - local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); - }; - - let local_var_req = local_var_req_builder.build()?; - let local_var_resp = local_var_client.execute(local_var_req).await?; - - let local_var_status = local_var_resp.status(); - let local_var_content = local_var_resp.text().await?; - - if !local_var_status.is_client_error() && !local_var_status.is_server_error() { - serde_json::from_str(&local_var_content).map_err(Error::from) - } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; - Err(Error::ResponseError(local_var_error)) - } -} diff --git a/crates/bitwarden-api-api/src/apis/policies_api.rs b/crates/bitwarden-api-api/src/apis/policies_api.rs index bfec61923..1ac26b251 100644 --- a/crates/bitwarden-api-api/src/apis/policies_api.rs +++ b/crates/bitwarden-api-api/src/apis/policies_api.rs @@ -27,6 +27,13 @@ pub enum OrganizationsOrgIdPoliciesInvitedUserGetError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`organizations_org_id_policies_master_password_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrganizationsOrgIdPoliciesMasterPasswordGetError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`organizations_org_id_policies_token_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -97,8 +104,8 @@ pub async fn organizations_org_id_policies_get( pub async fn organizations_org_id_policies_invited_user_get( configuration: &configuration::Configuration, - org_id: &str, - user_id: Option<&str>, + org_id: uuid::Uuid, + user_id: Option, ) -> Result< crate::models::PolicyResponseModelListResponseModel, Error, @@ -147,12 +154,59 @@ pub async fn organizations_org_id_policies_invited_user_get( } } +pub async fn organizations_org_id_policies_master_password_get( + configuration: &configuration::Configuration, + org_id: uuid::Uuid, +) -> Result< + crate::models::PolicyResponseModel, + Error, +> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/organizations/{orgId}/policies/master-password", + local_var_configuration.base_path, + orgId = crate::apis::urlencode(org_id.to_string()) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + pub async fn organizations_org_id_policies_token_get( configuration: &configuration::Configuration, - org_id: &str, + org_id: uuid::Uuid, email: Option<&str>, token: Option<&str>, - organization_user_id: Option<&str>, + organization_user_id: Option, ) -> Result< crate::models::PolicyResponseModelListResponseModel, Error, diff --git a/crates/bitwarden-api-api/src/apis/secrets_manager_events_api.rs b/crates/bitwarden-api-api/src/apis/secrets_manager_events_api.rs new file mode 100644 index 000000000..d651ac32f --- /dev/null +++ b/crates/bitwarden-api-api/src/apis/secrets_manager_events_api.rs @@ -0,0 +1,82 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +use reqwest; + +use super::{configuration, Error}; +use crate::apis::ResponseContent; + +/// struct for typed errors of method [`sm_events_service_accounts_service_account_id_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SmEventsServiceAccountsServiceAccountIdGetError { + UnknownValue(serde_json::Value), +} + +pub async fn sm_events_service_accounts_service_account_id_get( + configuration: &configuration::Configuration, + service_account_id: uuid::Uuid, + start: Option, + end: Option, + continuation_token: Option<&str>, +) -> Result< + crate::models::EventResponseModelListResponseModel, + Error, +> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/sm/events/service-accounts/{serviceAccountId}", + local_var_configuration.base_path, + serviceAccountId = crate::apis::urlencode(service_account_id.to_string()) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = start { + local_var_req_builder = + local_var_req_builder.query(&[("start", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = end { + local_var_req_builder = local_var_req_builder.query(&[("end", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = continuation_token { + local_var_req_builder = + local_var_req_builder.query(&[("continuationToken", &local_var_str.to_string())]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} diff --git a/crates/bitwarden-api-api/src/apis/web_authn_api.rs b/crates/bitwarden-api-api/src/apis/web_authn_api.rs new file mode 100644 index 000000000..8c269d783 --- /dev/null +++ b/crates/bitwarden-api-api/src/apis/web_authn_api.rs @@ -0,0 +1,324 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +use reqwest; + +use super::{configuration, Error}; +use crate::apis::ResponseContent; + +/// struct for typed errors of method [`webauthn_assertion_options_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum WebauthnAssertionOptionsPostError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`webauthn_attestation_options_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum WebauthnAttestationOptionsPostError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`webauthn_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum WebauthnGetError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`webauthn_id_delete_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum WebauthnIdDeletePostError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`webauthn_post`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum WebauthnPostError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`webauthn_put`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum WebauthnPutError { + UnknownValue(serde_json::Value), +} + +pub async fn webauthn_assertion_options_post( + configuration: &configuration::Configuration, + secret_verification_request_model: Option, +) -> Result< + crate::models::WebAuthnLoginAssertionOptionsResponseModel, + Error, +> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/webauthn/assertion-options", + local_var_configuration.base_path + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&secret_verification_request_model); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn webauthn_attestation_options_post( + configuration: &configuration::Configuration, + secret_verification_request_model: Option, +) -> Result< + crate::models::WebAuthnCredentialCreateOptionsResponseModel, + Error, +> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/webauthn/attestation-options", + local_var_configuration.base_path + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&secret_verification_request_model); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn webauthn_get( + configuration: &configuration::Configuration, +) -> Result> +{ + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/webauthn", local_var_configuration.base_path); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn webauthn_id_delete_post( + configuration: &configuration::Configuration, + id: uuid::Uuid, + secret_verification_request_model: Option, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/webauthn/{id}/delete", + local_var_configuration.base_path, + id = crate::apis::urlencode(id.to_string()) + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&secret_verification_request_model); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn webauthn_post( + configuration: &configuration::Configuration, + web_authn_login_credential_create_request_model: Option< + crate::models::WebAuthnLoginCredentialCreateRequestModel, + >, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/webauthn", local_var_configuration.base_path); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = + local_var_req_builder.json(&web_authn_login_credential_create_request_model); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn webauthn_put( + configuration: &configuration::Configuration, + web_authn_login_credential_update_request_model: Option< + crate::models::WebAuthnLoginCredentialUpdateRequestModel, + >, +) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/webauthn", local_var_configuration.base_path); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.oauth_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = + local_var_req_builder.json(&web_authn_login_credential_update_request_model); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} diff --git a/crates/bitwarden-api-api/src/models/access_policies_create_request.rs b/crates/bitwarden-api-api/src/models/access_policies_create_request.rs index 0b55b52f1..59a11774e 100644 --- a/crates/bitwarden-api-api/src/models/access_policies_create_request.rs +++ b/crates/bitwarden-api-api/src/models/access_policies_create_request.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AccessPoliciesCreateRequest { #[serde( rename = "userAccessPolicyRequests", diff --git a/crates/bitwarden-api-api/src/models/access_policy_request.rs b/crates/bitwarden-api-api/src/models/access_policy_request.rs index 7ec692135..81065c5b5 100644 --- a/crates/bitwarden-api-api/src/models/access_policy_request.rs +++ b/crates/bitwarden-api-api/src/models/access_policy_request.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AccessPolicyRequest { #[serde(rename = "granteeId")] pub grantee_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/models/access_policy_update_request.rs b/crates/bitwarden-api-api/src/models/access_policy_update_request.rs index a783d2a2e..38d7852b0 100644 --- a/crates/bitwarden-api-api/src/models/access_policy_update_request.rs +++ b/crates/bitwarden-api-api/src/models/access_policy_update_request.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AccessPolicyUpdateRequest { #[serde(rename = "read")] pub read: bool, diff --git a/crates/bitwarden-api-api/src/models/access_token_create_request_model.rs b/crates/bitwarden-api-api/src/models/access_token_create_request_model.rs index c3c55258b..00a3dfa15 100644 --- a/crates/bitwarden-api-api/src/models/access_token_create_request_model.rs +++ b/crates/bitwarden-api-api/src/models/access_token_create_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AccessTokenCreateRequestModel { #[serde(rename = "name")] pub name: String, diff --git a/crates/bitwarden-api-api/src/models/access_token_creation_response_model.rs b/crates/bitwarden-api-api/src/models/access_token_creation_response_model.rs index 319108e6a..e5b91a94a 100644 --- a/crates/bitwarden-api-api/src/models/access_token_creation_response_model.rs +++ b/crates/bitwarden-api-api/src/models/access_token_creation_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AccessTokenCreationResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/access_token_response_model.rs b/crates/bitwarden-api-api/src/models/access_token_response_model.rs index 766dfa42b..eb06b0108 100644 --- a/crates/bitwarden-api-api/src/models/access_token_response_model.rs +++ b/crates/bitwarden-api-api/src/models/access_token_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AccessTokenResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/access_token_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/access_token_response_model_list_response_model.rs index eeb65cc65..2b6fa6d82 100644 --- a/crates/bitwarden-api-api/src/models/access_token_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/access_token_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AccessTokenResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/admin_auth_request_update_request_model.rs b/crates/bitwarden-api-api/src/models/admin_auth_request_update_request_model.rs index ba7f199ce..b3629d3a5 100644 --- a/crates/bitwarden-api-api/src/models/admin_auth_request_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/admin_auth_request_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AdminAuthRequestUpdateRequestModel { #[serde(rename = "encryptedUserKey", skip_serializing_if = "Option::is_none")] pub encrypted_user_key: Option, diff --git a/crates/bitwarden-api-api/src/models/algorithm.rs b/crates/bitwarden-api-api/src/models/algorithm.rs new file mode 100644 index 000000000..2c302de0a --- /dev/null +++ b/crates/bitwarden-api-api/src/models/algorithm.rs @@ -0,0 +1,54 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +/// +#[repr(i64)] +#[derive( + Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, +)] +pub enum Algorithm { + RS1 = -65535, + RS512 = -259, + RS384 = -258, + RS256 = -257, + ES256K = -47, + PS512 = -39, + PS384 = -38, + PS256 = -37, + ES512 = -36, + ES384 = -35, + EdDSA = -8, + ES256 = -7, +} + +impl ToString for Algorithm { + fn to_string(&self) -> String { + match self { + Self::RS1 => String::from("-65535"), + Self::RS512 => String::from("-259"), + Self::RS384 => String::from("-258"), + Self::RS256 => String::from("-257"), + Self::ES256K => String::from("-47"), + Self::PS512 => String::from("-39"), + Self::PS384 => String::from("-38"), + Self::PS256 => String::from("-37"), + Self::ES512 => String::from("-36"), + Self::ES384 => String::from("-35"), + Self::EdDSA => String::from("-8"), + Self::ES256 => String::from("-7"), + } + } +} + +impl Default for Algorithm { + fn default() -> Algorithm { + Self::RS1 + } +} diff --git a/crates/bitwarden-api-api/src/models/api_key_response_model.rs b/crates/bitwarden-api-api/src/models/api_key_response_model.rs index 5e28ae677..6c7cde826 100644 --- a/crates/bitwarden-api-api/src/models/api_key_response_model.rs +++ b/crates/bitwarden-api-api/src/models/api_key_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ApiKeyResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/assertion_options.rs b/crates/bitwarden-api-api/src/models/assertion_options.rs new file mode 100644 index 000000000..a7772e88d --- /dev/null +++ b/crates/bitwarden-api-api/src/models/assertion_options.rs @@ -0,0 +1,44 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AssertionOptions { + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(rename = "errorMessage", skip_serializing_if = "Option::is_none")] + pub error_message: Option, + #[serde(rename = "challenge", skip_serializing_if = "Option::is_none")] + pub challenge: Option, + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + #[serde(rename = "rpId", skip_serializing_if = "Option::is_none")] + pub rp_id: Option, + #[serde(rename = "allowCredentials", skip_serializing_if = "Option::is_none")] + pub allow_credentials: Option>, + #[serde(rename = "userVerification", skip_serializing_if = "Option::is_none")] + pub user_verification: Option, + #[serde(rename = "extensions", skip_serializing_if = "Option::is_none")] + pub extensions: Option>, +} + +impl AssertionOptions { + pub fn new() -> AssertionOptions { + AssertionOptions { + status: None, + error_message: None, + challenge: None, + timeout: None, + rp_id: None, + allow_credentials: None, + user_verification: None, + extensions: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/assertion_response.rs b/crates/bitwarden-api-api/src/models/assertion_response.rs new file mode 100644 index 000000000..bf5f1e792 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/assertion_response.rs @@ -0,0 +1,32 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AssertionResponse { + #[serde(rename = "authenticatorData", skip_serializing_if = "Option::is_none")] + pub authenticator_data: Option, + #[serde(rename = "signature", skip_serializing_if = "Option::is_none")] + pub signature: Option, + #[serde(rename = "clientDataJSON", skip_serializing_if = "Option::is_none")] + pub client_data_json: Option, + #[serde(rename = "userHandle", skip_serializing_if = "Option::is_none")] + pub user_handle: Option, +} + +impl AssertionResponse { + pub fn new() -> AssertionResponse { + AssertionResponse { + authenticator_data: None, + signature: None, + client_data_json: None, + user_handle: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/attachment_request_model.rs b/crates/bitwarden-api-api/src/models/attachment_request_model.rs index 9925ee618..8eeedb507 100644 --- a/crates/bitwarden-api-api/src/models/attachment_request_model.rs +++ b/crates/bitwarden-api-api/src/models/attachment_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AttachmentRequestModel { #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, diff --git a/crates/bitwarden-api-api/src/models/attachment_response_model.rs b/crates/bitwarden-api-api/src/models/attachment_response_model.rs index c9066488d..e0616818f 100644 --- a/crates/bitwarden-api-api/src/models/attachment_response_model.rs +++ b/crates/bitwarden-api-api/src/models/attachment_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AttachmentResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/attachment_upload_data_response_model.rs b/crates/bitwarden-api-api/src/models/attachment_upload_data_response_model.rs index 4b9f61825..9a78e5807 100644 --- a/crates/bitwarden-api-api/src/models/attachment_upload_data_response_model.rs +++ b/crates/bitwarden-api-api/src/models/attachment_upload_data_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AttachmentUploadDataResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/attestation_conveyance_preference.rs b/crates/bitwarden-api-api/src/models/attestation_conveyance_preference.rs new file mode 100644 index 000000000..0b8a76151 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/attestation_conveyance_preference.rs @@ -0,0 +1,36 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AttestationConveyancePreference { + #[serde(rename = "none")] + None, + #[serde(rename = "indirect")] + Indirect, + #[serde(rename = "direct")] + Direct, +} + +impl ToString for AttestationConveyancePreference { + fn to_string(&self) -> String { + match self { + Self::None => String::from("none"), + Self::Indirect => String::from("indirect"), + Self::Direct => String::from("direct"), + } + } +} + +impl Default for AttestationConveyancePreference { + fn default() -> AttestationConveyancePreference { + Self::None + } +} diff --git a/crates/bitwarden-api-api/src/models/auth_request_create_request_model.rs b/crates/bitwarden-api-api/src/models/auth_request_create_request_model.rs index 54eee561c..c092ae47d 100644 --- a/crates/bitwarden-api-api/src/models/auth_request_create_request_model.rs +++ b/crates/bitwarden-api-api/src/models/auth_request_create_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AuthRequestCreateRequestModel { #[serde(rename = "email")] pub email: String, diff --git a/crates/bitwarden-api-api/src/models/auth_request_response_model.rs b/crates/bitwarden-api-api/src/models/auth_request_response_model.rs index 8409b4f6c..b6a7438b7 100644 --- a/crates/bitwarden-api-api/src/models/auth_request_response_model.rs +++ b/crates/bitwarden-api-api/src/models/auth_request_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AuthRequestResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/auth_request_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/auth_request_response_model_list_response_model.rs index 70d96a2ed..32e953d28 100644 --- a/crates/bitwarden-api-api/src/models/auth_request_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/auth_request_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AuthRequestResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/auth_request_type.rs b/crates/bitwarden-api-api/src/models/auth_request_type.rs index fbcfb8e9f..1ca3f7790 100644 --- a/crates/bitwarden-api-api/src/models/auth_request_type.rs +++ b/crates/bitwarden-api-api/src/models/auth_request_type.rs @@ -14,23 +14,23 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum AuthRequestType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, + AuthenticateAndUnlock = 0, + Unlock = 1, + AdminApproval = 2, } impl ToString for AuthRequestType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::AuthenticateAndUnlock => String::from("0"), + Self::Unlock => String::from("1"), + Self::AdminApproval => String::from("2"), } } } impl Default for AuthRequestType { fn default() -> AuthRequestType { - Self::Variant0 + Self::AuthenticateAndUnlock } } diff --git a/crates/bitwarden-api-api/src/models/auth_request_update_request_model.rs b/crates/bitwarden-api-api/src/models/auth_request_update_request_model.rs index 6baf69f8a..9799a5fc7 100644 --- a/crates/bitwarden-api-api/src/models/auth_request_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/auth_request_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AuthRequestUpdateRequestModel { #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, diff --git a/crates/bitwarden-api-api/src/models/authentication_extensions_client_inputs.rs b/crates/bitwarden-api-api/src/models/authentication_extensions_client_inputs.rs new file mode 100644 index 000000000..cd98f01d1 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/authentication_extensions_client_inputs.rs @@ -0,0 +1,35 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticationExtensionsClientInputs { + #[serde(rename = "example.extension", skip_serializing_if = "Option::is_none")] + pub example_period_extension: Option, + #[serde(rename = "appid", skip_serializing_if = "Option::is_none")] + pub appid: Option, + #[serde(rename = "authnSel", skip_serializing_if = "Option::is_none")] + pub authn_sel: Option>, + #[serde(rename = "exts", skip_serializing_if = "Option::is_none")] + pub exts: Option, + #[serde(rename = "uvm", skip_serializing_if = "Option::is_none")] + pub uvm: Option, +} + +impl AuthenticationExtensionsClientInputs { + pub fn new() -> AuthenticationExtensionsClientInputs { + AuthenticationExtensionsClientInputs { + example_period_extension: None, + appid: None, + authn_sel: None, + exts: None, + uvm: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/authentication_extensions_client_outputs.rs b/crates/bitwarden-api-api/src/models/authentication_extensions_client_outputs.rs index af7deb6da..2af5ed7c5 100644 --- a/crates/bitwarden-api-api/src/models/authentication_extensions_client_outputs.rs +++ b/crates/bitwarden-api-api/src/models/authentication_extensions_client_outputs.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AuthenticationExtensionsClientOutputs { #[serde(rename = "example.extension", skip_serializing_if = "Option::is_none")] pub example_period_extension: Option, diff --git a/crates/bitwarden-api-api/src/models/authenticator_assertion_raw_response.rs b/crates/bitwarden-api-api/src/models/authenticator_assertion_raw_response.rs new file mode 100644 index 000000000..ea39efeab --- /dev/null +++ b/crates/bitwarden-api-api/src/models/authenticator_assertion_raw_response.rs @@ -0,0 +1,35 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorAssertionRawResponse { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "rawId", skip_serializing_if = "Option::is_none")] + pub raw_id: Option, + #[serde(rename = "response", skip_serializing_if = "Option::is_none")] + pub response: Option>, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "extensions", skip_serializing_if = "Option::is_none")] + pub extensions: Option>, +} + +impl AuthenticatorAssertionRawResponse { + pub fn new() -> AuthenticatorAssertionRawResponse { + AuthenticatorAssertionRawResponse { + id: None, + raw_id: None, + response: None, + r#type: None, + extensions: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/authenticator_attachment.rs b/crates/bitwarden-api-api/src/models/authenticator_attachment.rs new file mode 100644 index 000000000..8e2d2df19 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/authenticator_attachment.rs @@ -0,0 +1,33 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AuthenticatorAttachment { + #[serde(rename = "platform")] + Platform, + #[serde(rename = "cross-platform")] + CrossPlatform, +} + +impl ToString for AuthenticatorAttachment { + fn to_string(&self) -> String { + match self { + Self::Platform => String::from("platform"), + Self::CrossPlatform => String::from("cross-platform"), + } + } +} + +impl Default for AuthenticatorAttachment { + fn default() -> AuthenticatorAttachment { + Self::Platform + } +} diff --git a/crates/bitwarden-api-api/src/models/authenticator_attestation_raw_response.rs b/crates/bitwarden-api-api/src/models/authenticator_attestation_raw_response.rs index 3e2b4c05c..8763ab261 100644 --- a/crates/bitwarden-api-api/src/models/authenticator_attestation_raw_response.rs +++ b/crates/bitwarden-api-api/src/models/authenticator_attestation_raw_response.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct AuthenticatorAttestationRawResponse { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/crates/bitwarden-api-api/src/models/authenticator_selection.rs b/crates/bitwarden-api-api/src/models/authenticator_selection.rs new file mode 100644 index 000000000..4159eddde --- /dev/null +++ b/crates/bitwarden-api-api/src/models/authenticator_selection.rs @@ -0,0 +1,32 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticatorSelection { + #[serde( + rename = "authenticatorAttachment", + skip_serializing_if = "Option::is_none" + )] + pub authenticator_attachment: Option, + #[serde(rename = "requireResidentKey", skip_serializing_if = "Option::is_none")] + pub require_resident_key: Option, + #[serde(rename = "userVerification", skip_serializing_if = "Option::is_none")] + pub user_verification: Option, +} + +impl AuthenticatorSelection { + pub fn new() -> AuthenticatorSelection { + AuthenticatorSelection { + authenticator_attachment: None, + require_resident_key: None, + user_verification: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/authenticator_transport.rs b/crates/bitwarden-api-api/src/models/authenticator_transport.rs new file mode 100644 index 000000000..0773f8138 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/authenticator_transport.rs @@ -0,0 +1,39 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AuthenticatorTransport { + #[serde(rename = "usb")] + Usb, + #[serde(rename = "nfc")] + Nfc, + #[serde(rename = "ble")] + Ble, + #[serde(rename = "internal")] + Internal, +} + +impl ToString for AuthenticatorTransport { + fn to_string(&self) -> String { + match self { + Self::Usb => String::from("usb"), + Self::Nfc => String::from("nfc"), + Self::Ble => String::from("ble"), + Self::Internal => String::from("internal"), + } + } +} + +impl Default for AuthenticatorTransport { + fn default() -> AuthenticatorTransport { + Self::Usb + } +} diff --git a/crates/bitwarden-api-api/src/models/base_access_policy_response_model.rs b/crates/bitwarden-api-api/src/models/base_access_policy_response_model.rs index 39efd3242..cb15dde0b 100644 --- a/crates/bitwarden-api-api/src/models/base_access_policy_response_model.rs +++ b/crates/bitwarden-api-api/src/models/base_access_policy_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BaseAccessPolicyResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/base_secret_response_model.rs b/crates/bitwarden-api-api/src/models/base_secret_response_model.rs index d2db29bc7..2b486020f 100644 --- a/crates/bitwarden-api-api/src/models/base_secret_response_model.rs +++ b/crates/bitwarden-api-api/src/models/base_secret_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BaseSecretResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/base_secret_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/base_secret_response_model_list_response_model.rs index f65cb215d..650333a80 100644 --- a/crates/bitwarden-api-api/src/models/base_secret_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/base_secret_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BaseSecretResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/billing_customer_discount.rs b/crates/bitwarden-api-api/src/models/billing_customer_discount.rs index 61f695d70..71fc4f46d 100644 --- a/crates/bitwarden-api-api/src/models/billing_customer_discount.rs +++ b/crates/bitwarden-api-api/src/models/billing_customer_discount.rs @@ -8,12 +8,16 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BillingCustomerDiscount { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, #[serde(rename = "active", skip_serializing_if = "Option::is_none")] pub active: Option, + #[serde(rename = "percentOff", skip_serializing_if = "Option::is_none")] + pub percent_off: Option, + #[serde(rename = "appliesTo", skip_serializing_if = "Option::is_none")] + pub applies_to: Option>, } impl BillingCustomerDiscount { @@ -21,6 +25,8 @@ impl BillingCustomerDiscount { BillingCustomerDiscount { id: None, active: None, + percent_off: None, + applies_to: None, } } } diff --git a/crates/bitwarden-api-api/src/models/billing_history_response_model.rs b/crates/bitwarden-api-api/src/models/billing_history_response_model.rs index 54f00397f..f1550bcae 100644 --- a/crates/bitwarden-api-api/src/models/billing_history_response_model.rs +++ b/crates/bitwarden-api-api/src/models/billing_history_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BillingHistoryResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/billing_invoice.rs b/crates/bitwarden-api-api/src/models/billing_invoice.rs index 893930723..23dcb17d2 100644 --- a/crates/bitwarden-api-api/src/models/billing_invoice.rs +++ b/crates/bitwarden-api-api/src/models/billing_invoice.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BillingInvoice { #[serde(rename = "amount", skip_serializing_if = "Option::is_none")] pub amount: Option, diff --git a/crates/bitwarden-api-api/src/models/billing_payment_response_model.rs b/crates/bitwarden-api-api/src/models/billing_payment_response_model.rs index eb7bc10db..2b1f929a7 100644 --- a/crates/bitwarden-api-api/src/models/billing_payment_response_model.rs +++ b/crates/bitwarden-api-api/src/models/billing_payment_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BillingPaymentResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/billing_response_model.rs b/crates/bitwarden-api-api/src/models/billing_response_model.rs index 7637917e1..4a3cbea6e 100644 --- a/crates/bitwarden-api-api/src/models/billing_response_model.rs +++ b/crates/bitwarden-api-api/src/models/billing_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BillingResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/billing_source.rs b/crates/bitwarden-api-api/src/models/billing_source.rs index da231d360..cff096377 100644 --- a/crates/bitwarden-api-api/src/models/billing_source.rs +++ b/crates/bitwarden-api-api/src/models/billing_source.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BillingSource { #[serde(rename = "type", skip_serializing_if = "Option::is_none")] pub r#type: Option, diff --git a/crates/bitwarden-api-api/src/models/billing_subscription.rs b/crates/bitwarden-api-api/src/models/billing_subscription.rs index 0c89977ed..8a0c3aec0 100644 --- a/crates/bitwarden-api-api/src/models/billing_subscription.rs +++ b/crates/bitwarden-api-api/src/models/billing_subscription.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BillingSubscription { #[serde(rename = "trialStartDate", skip_serializing_if = "Option::is_none")] pub trial_start_date: Option, diff --git a/crates/bitwarden-api-api/src/models/billing_subscription_item.rs b/crates/bitwarden-api-api/src/models/billing_subscription_item.rs index 7a9693eb2..0e40278c5 100644 --- a/crates/bitwarden-api-api/src/models/billing_subscription_item.rs +++ b/crates/bitwarden-api-api/src/models/billing_subscription_item.rs @@ -8,8 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BillingSubscriptionItem { + #[serde(rename = "productId", skip_serializing_if = "Option::is_none")] + pub product_id: Option, #[serde(rename = "name", skip_serializing_if = "Option::is_none")] pub name: Option, #[serde(rename = "amount", skip_serializing_if = "Option::is_none")] @@ -28,20 +30,18 @@ pub struct BillingSubscriptionItem { skip_serializing_if = "Option::is_none" )] pub addon_subscription_item: Option, - #[serde(rename = "bitwardenProduct", skip_serializing_if = "Option::is_none")] - pub bitwarden_product: Option, } impl BillingSubscriptionItem { pub fn new() -> BillingSubscriptionItem { BillingSubscriptionItem { + product_id: None, name: None, amount: None, quantity: None, interval: None, sponsored_subscription_item: None, addon_subscription_item: None, - bitwarden_product: None, } } } diff --git a/crates/bitwarden-api-api/src/models/billing_subscription_upcoming_invoice.rs b/crates/bitwarden-api-api/src/models/billing_subscription_upcoming_invoice.rs index c4b741a7a..a2e183a94 100644 --- a/crates/bitwarden-api-api/src/models/billing_subscription_upcoming_invoice.rs +++ b/crates/bitwarden-api-api/src/models/billing_subscription_upcoming_invoice.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BillingSubscriptionUpcomingInvoice { #[serde(rename = "amount", skip_serializing_if = "Option::is_none")] pub amount: Option, diff --git a/crates/bitwarden-api-api/src/models/billing_transaction.rs b/crates/bitwarden-api-api/src/models/billing_transaction.rs index 2343afb8b..666d13919 100644 --- a/crates/bitwarden-api-api/src/models/billing_transaction.rs +++ b/crates/bitwarden-api-api/src/models/billing_transaction.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BillingTransaction { #[serde(rename = "createdDate", skip_serializing_if = "Option::is_none")] pub created_date: Option, diff --git a/crates/bitwarden-api-api/src/models/bit_pay_invoice_request_model.rs b/crates/bitwarden-api-api/src/models/bit_pay_invoice_request_model.rs index c94e9d565..9491aabb0 100644 --- a/crates/bitwarden-api-api/src/models/bit_pay_invoice_request_model.rs +++ b/crates/bitwarden-api-api/src/models/bit_pay_invoice_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BitPayInvoiceRequestModel { #[serde(rename = "userId", skip_serializing_if = "Option::is_none")] pub user_id: Option, diff --git a/crates/bitwarden-api-api/src/models/bulk_collection_access_request_model.rs b/crates/bitwarden-api-api/src/models/bulk_collection_access_request_model.rs new file mode 100644 index 000000000..a7fd75d85 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/bulk_collection_access_request_model.rs @@ -0,0 +1,29 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct BulkCollectionAccessRequestModel { + #[serde(rename = "collectionIds", skip_serializing_if = "Option::is_none")] + pub collection_ids: Option>, + #[serde(rename = "groups", skip_serializing_if = "Option::is_none")] + pub groups: Option>, + #[serde(rename = "users", skip_serializing_if = "Option::is_none")] + pub users: Option>, +} + +impl BulkCollectionAccessRequestModel { + pub fn new() -> BulkCollectionAccessRequestModel { + BulkCollectionAccessRequestModel { + collection_ids: None, + groups: None, + users: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/bulk_delete_response_model.rs b/crates/bitwarden-api-api/src/models/bulk_delete_response_model.rs index 8bab4b18a..0d9b9e074 100644 --- a/crates/bitwarden-api-api/src/models/bulk_delete_response_model.rs +++ b/crates/bitwarden-api-api/src/models/bulk_delete_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BulkDeleteResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/bulk_delete_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/bulk_delete_response_model_list_response_model.rs index 94d644d0b..800ffeb32 100644 --- a/crates/bitwarden-api-api/src/models/bulk_delete_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/bulk_delete_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BulkDeleteResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/bulk_deny_admin_auth_request_request_model.rs b/crates/bitwarden-api-api/src/models/bulk_deny_admin_auth_request_request_model.rs index 5108fb419..b870cc77b 100644 --- a/crates/bitwarden-api-api/src/models/bulk_deny_admin_auth_request_request_model.rs +++ b/crates/bitwarden-api-api/src/models/bulk_deny_admin_auth_request_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BulkDenyAdminAuthRequestRequestModel { #[serde(rename = "ids", skip_serializing_if = "Option::is_none")] pub ids: Option>, diff --git a/crates/bitwarden-api-api/src/models/cipher_attachment_model.rs b/crates/bitwarden-api-api/src/models/cipher_attachment_model.rs index 7d55716dd..93beabc99 100644 --- a/crates/bitwarden-api-api/src/models/cipher_attachment_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_attachment_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherAttachmentModel { #[serde(rename = "fileName", skip_serializing_if = "Option::is_none")] pub file_name: Option, diff --git a/crates/bitwarden-api-api/src/models/cipher_bulk_delete_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_bulk_delete_request_model.rs index 22202fcaf..b709c5622 100644 --- a/crates/bitwarden-api-api/src/models/cipher_bulk_delete_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_bulk_delete_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherBulkDeleteRequestModel { #[serde(rename = "ids")] pub ids: Vec, diff --git a/crates/bitwarden-api-api/src/models/cipher_bulk_move_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_bulk_move_request_model.rs index eca93c3a7..b9e2b61f5 100644 --- a/crates/bitwarden-api-api/src/models/cipher_bulk_move_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_bulk_move_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherBulkMoveRequestModel { #[serde(rename = "ids")] pub ids: Vec, diff --git a/crates/bitwarden-api-api/src/models/cipher_bulk_restore_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_bulk_restore_request_model.rs index 9fe99c9ce..3d6ad9338 100644 --- a/crates/bitwarden-api-api/src/models/cipher_bulk_restore_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_bulk_restore_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherBulkRestoreRequestModel { #[serde(rename = "ids")] pub ids: Vec, diff --git a/crates/bitwarden-api-api/src/models/cipher_bulk_share_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_bulk_share_request_model.rs index c5d906e0f..92dff066c 100644 --- a/crates/bitwarden-api-api/src/models/cipher_bulk_share_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_bulk_share_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherBulkShareRequestModel { #[serde(rename = "collectionIds")] pub collection_ids: Vec, diff --git a/crates/bitwarden-api-api/src/models/cipher_card_model.rs b/crates/bitwarden-api-api/src/models/cipher_card_model.rs index 173e4e55c..eae29bc84 100644 --- a/crates/bitwarden-api-api/src/models/cipher_card_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_card_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherCardModel { #[serde(rename = "cardholderName", skip_serializing_if = "Option::is_none")] pub cardholder_name: Option, diff --git a/crates/bitwarden-api-api/src/models/cipher_collections_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_collections_request_model.rs index cdd2649a9..8bdf4be41 100644 --- a/crates/bitwarden-api-api/src/models/cipher_collections_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_collections_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherCollectionsRequestModel { #[serde(rename = "collectionIds")] pub collection_ids: Vec, diff --git a/crates/bitwarden-api-api/src/models/cipher_create_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_create_request_model.rs index 272343066..bbfdf3c03 100644 --- a/crates/bitwarden-api-api/src/models/cipher_create_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_create_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherCreateRequestModel { #[serde(rename = "collectionIds", skip_serializing_if = "Option::is_none")] pub collection_ids: Option>, diff --git a/crates/bitwarden-api-api/src/models/cipher_details_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_details_response_model.rs index 289169e41..1dd69ecd9 100644 --- a/crates/bitwarden-api-api/src/models/cipher_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_details_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherDetailsResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/cipher_details_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_details_response_model_list_response_model.rs index 9e840e978..8da076327 100644 --- a/crates/bitwarden-api-api/src/models/cipher_details_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_details_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherDetailsResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/cipher_fido2_credential_model.rs b/crates/bitwarden-api-api/src/models/cipher_fido2_credential_model.rs new file mode 100644 index 000000000..95de4bc28 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/cipher_fido2_credential_model.rs @@ -0,0 +1,59 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CipherFido2CredentialModel { + #[serde(rename = "credentialId", skip_serializing_if = "Option::is_none")] + pub credential_id: Option, + #[serde(rename = "keyType", skip_serializing_if = "Option::is_none")] + pub key_type: Option, + #[serde(rename = "keyAlgorithm", skip_serializing_if = "Option::is_none")] + pub key_algorithm: Option, + #[serde(rename = "keyCurve", skip_serializing_if = "Option::is_none")] + pub key_curve: Option, + #[serde(rename = "keyValue", skip_serializing_if = "Option::is_none")] + pub key_value: Option, + #[serde(rename = "rpId", skip_serializing_if = "Option::is_none")] + pub rp_id: Option, + #[serde(rename = "rpName", skip_serializing_if = "Option::is_none")] + pub rp_name: Option, + #[serde(rename = "userHandle", skip_serializing_if = "Option::is_none")] + pub user_handle: Option, + #[serde(rename = "userName", skip_serializing_if = "Option::is_none")] + pub user_name: Option, + #[serde(rename = "userDisplayName", skip_serializing_if = "Option::is_none")] + pub user_display_name: Option, + #[serde(rename = "counter", skip_serializing_if = "Option::is_none")] + pub counter: Option, + #[serde(rename = "discoverable", skip_serializing_if = "Option::is_none")] + pub discoverable: Option, + #[serde(rename = "creationDate")] + pub creation_date: String, +} + +impl CipherFido2CredentialModel { + pub fn new(creation_date: String) -> CipherFido2CredentialModel { + CipherFido2CredentialModel { + credential_id: None, + key_type: None, + key_algorithm: None, + key_curve: None, + key_value: None, + rp_id: None, + rp_name: None, + user_handle: None, + user_name: None, + user_display_name: None, + counter: None, + discoverable: None, + creation_date, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/cipher_field_model.rs b/crates/bitwarden-api-api/src/models/cipher_field_model.rs index 937e52e33..3b1700dd6 100644 --- a/crates/bitwarden-api-api/src/models/cipher_field_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_field_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherFieldModel { #[serde(rename = "type", skip_serializing_if = "Option::is_none")] pub r#type: Option, diff --git a/crates/bitwarden-api-api/src/models/cipher_identity_model.rs b/crates/bitwarden-api-api/src/models/cipher_identity_model.rs index 54463ad3a..e2e629398 100644 --- a/crates/bitwarden-api-api/src/models/cipher_identity_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_identity_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherIdentityModel { #[serde(rename = "title", skip_serializing_if = "Option::is_none")] pub title: Option, diff --git a/crates/bitwarden-api-api/src/models/cipher_login_model.rs b/crates/bitwarden-api-api/src/models/cipher_login_model.rs index d9f531154..159bee7cd 100644 --- a/crates/bitwarden-api-api/src/models/cipher_login_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_login_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherLoginModel { #[serde(rename = "uri", skip_serializing_if = "Option::is_none")] pub uri: Option, @@ -27,6 +27,8 @@ pub struct CipherLoginModel { pub totp: Option, #[serde(rename = "autofillOnPageLoad", skip_serializing_if = "Option::is_none")] pub autofill_on_page_load: Option, + #[serde(rename = "fido2Credentials", skip_serializing_if = "Option::is_none")] + pub fido2_credentials: Option>, } impl CipherLoginModel { @@ -39,6 +41,7 @@ impl CipherLoginModel { password_revision_date: None, totp: None, autofill_on_page_load: None, + fido2_credentials: None, } } } diff --git a/crates/bitwarden-api-api/src/models/cipher_login_uri_model.rs b/crates/bitwarden-api-api/src/models/cipher_login_uri_model.rs index 07358be79..39b6139c7 100644 --- a/crates/bitwarden-api-api/src/models/cipher_login_uri_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_login_uri_model.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherLoginUriModel { #[serde(rename = "uri", skip_serializing_if = "Option::is_none")] pub uri: Option, + #[serde(rename = "uriChecksum", skip_serializing_if = "Option::is_none")] + pub uri_checksum: Option, #[serde(rename = "match", skip_serializing_if = "Option::is_none")] pub r#match: Option, } @@ -20,6 +22,7 @@ impl CipherLoginUriModel { pub fn new() -> CipherLoginUriModel { CipherLoginUriModel { uri: None, + uri_checksum: None, r#match: None, } } diff --git a/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model.rs index 1aa5b8e3b..bf8e29707 100644 --- a/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherMiniDetailsResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model_list_response_model.rs index f0c30765f..8fbdaa67c 100644 --- a/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherMiniDetailsResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/cipher_mini_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_mini_response_model.rs index c96ddfd18..b6e77e2a2 100644 --- a/crates/bitwarden-api-api/src/models/cipher_mini_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_mini_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherMiniResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/cipher_mini_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_mini_response_model_list_response_model.rs index 10dbe91ec..ccae92e9e 100644 --- a/crates/bitwarden-api-api/src/models/cipher_mini_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_mini_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherMiniResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/cipher_partial_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_partial_request_model.rs index 791dc52d1..f911ef5cb 100644 --- a/crates/bitwarden-api-api/src/models/cipher_partial_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_partial_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherPartialRequestModel { #[serde(rename = "folderId", skip_serializing_if = "Option::is_none")] pub folder_id: Option, diff --git a/crates/bitwarden-api-api/src/models/cipher_password_history_model.rs b/crates/bitwarden-api-api/src/models/cipher_password_history_model.rs index b7ea59de0..4ab05138a 100644 --- a/crates/bitwarden-api-api/src/models/cipher_password_history_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_password_history_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherPasswordHistoryModel { #[serde(rename = "password")] pub password: String, diff --git a/crates/bitwarden-api-api/src/models/cipher_reprompt_type.rs b/crates/bitwarden-api-api/src/models/cipher_reprompt_type.rs index d20cef2db..4443b8c03 100644 --- a/crates/bitwarden-api-api/src/models/cipher_reprompt_type.rs +++ b/crates/bitwarden-api-api/src/models/cipher_reprompt_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum CipherRepromptType { - Variant0 = 0, - Variant1 = 1, + None = 0, + Password = 1, } impl ToString for CipherRepromptType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::None => String::from("0"), + Self::Password => String::from("1"), } } } impl Default for CipherRepromptType { fn default() -> CipherRepromptType { - Self::Variant0 + Self::None } } diff --git a/crates/bitwarden-api-api/src/models/cipher_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_request_model.rs index 2e445802b..8f8d17312 100644 --- a/crates/bitwarden-api-api/src/models/cipher_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherRequestModel { #[serde(rename = "type", skip_serializing_if = "Option::is_none")] pub r#type: Option, diff --git a/crates/bitwarden-api-api/src/models/cipher_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_response_model.rs index 59831e6fb..bd9c360b3 100644 --- a/crates/bitwarden-api-api/src/models/cipher_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/cipher_secure_note_model.rs b/crates/bitwarden-api-api/src/models/cipher_secure_note_model.rs index 6cb7a0a2a..a1cb38421 100644 --- a/crates/bitwarden-api-api/src/models/cipher_secure_note_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_secure_note_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherSecureNoteModel { #[serde(rename = "type", skip_serializing_if = "Option::is_none")] pub r#type: Option, diff --git a/crates/bitwarden-api-api/src/models/cipher_share_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_share_request_model.rs index ec5cdab25..86dcb3454 100644 --- a/crates/bitwarden-api-api/src/models/cipher_share_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_share_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherShareRequestModel { #[serde(rename = "collectionIds")] pub collection_ids: Vec, diff --git a/crates/bitwarden-api-api/src/models/cipher_type.rs b/crates/bitwarden-api-api/src/models/cipher_type.rs index 1420ac6a4..044349ef8 100644 --- a/crates/bitwarden-api-api/src/models/cipher_type.rs +++ b/crates/bitwarden-api-api/src/models/cipher_type.rs @@ -14,25 +14,25 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum CipherType { - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, + Login = 1, + SecureNote = 2, + Card = 3, + Identity = 4, } impl ToString for CipherType { fn to_string(&self) -> String { match self { - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), + Self::Login => String::from("1"), + Self::SecureNote => String::from("2"), + Self::Card => String::from("3"), + Self::Identity => String::from("4"), } } } impl Default for CipherType { fn default() -> CipherType { - Self::Variant1 + Self::Login } } diff --git a/crates/bitwarden-api-api/src/models/cipher_with_id_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_with_id_request_model.rs index 093d2e5d9..665bd4b4d 100644 --- a/crates/bitwarden-api-api/src/models/cipher_with_id_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_with_id_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CipherWithIdRequestModel { #[serde(rename = "type", skip_serializing_if = "Option::is_none")] pub r#type: Option, diff --git a/crates/bitwarden-api-api/src/models/collection_access_details_response_model.rs b/crates/bitwarden-api-api/src/models/collection_access_details_response_model.rs index faaf5b47a..99ba1ed9b 100644 --- a/crates/bitwarden-api-api/src/models/collection_access_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/collection_access_details_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CollectionAccessDetailsResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/collection_access_details_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/collection_access_details_response_model_list_response_model.rs index 21d388fdf..89b0cb89a 100644 --- a/crates/bitwarden-api-api/src/models/collection_access_details_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/collection_access_details_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CollectionAccessDetailsResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/collection_bulk_delete_request_model.rs b/crates/bitwarden-api-api/src/models/collection_bulk_delete_request_model.rs index 7d2d5d8fe..d919294b9 100644 --- a/crates/bitwarden-api-api/src/models/collection_bulk_delete_request_model.rs +++ b/crates/bitwarden-api-api/src/models/collection_bulk_delete_request_model.rs @@ -8,19 +8,14 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CollectionBulkDeleteRequestModel { #[serde(rename = "ids")] - pub ids: Vec, - #[serde(rename = "organizationId", skip_serializing_if = "Option::is_none")] - pub organization_id: Option, + pub ids: Vec, } impl CollectionBulkDeleteRequestModel { - pub fn new(ids: Vec) -> CollectionBulkDeleteRequestModel { - CollectionBulkDeleteRequestModel { - ids, - organization_id: None, - } + pub fn new(ids: Vec) -> CollectionBulkDeleteRequestModel { + CollectionBulkDeleteRequestModel { ids } } } diff --git a/crates/bitwarden-api-api/src/models/collection_details_response_model.rs b/crates/bitwarden-api-api/src/models/collection_details_response_model.rs index f364a98e8..3275bb104 100644 --- a/crates/bitwarden-api-api/src/models/collection_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/collection_details_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CollectionDetailsResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, @@ -24,6 +24,8 @@ pub struct CollectionDetailsResponseModel { pub read_only: Option, #[serde(rename = "hidePasswords", skip_serializing_if = "Option::is_none")] pub hide_passwords: Option, + #[serde(rename = "manage", skip_serializing_if = "Option::is_none")] + pub manage: Option, } impl CollectionDetailsResponseModel { @@ -36,6 +38,7 @@ impl CollectionDetailsResponseModel { external_id: None, read_only: None, hide_passwords: None, + manage: None, } } } diff --git a/crates/bitwarden-api-api/src/models/collection_details_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/collection_details_response_model_list_response_model.rs index 8e71cb637..e505be1dd 100644 --- a/crates/bitwarden-api-api/src/models/collection_details_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/collection_details_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CollectionDetailsResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/collection_request_model.rs b/crates/bitwarden-api-api/src/models/collection_request_model.rs index 3b3449d8f..6a67c959c 100644 --- a/crates/bitwarden-api-api/src/models/collection_request_model.rs +++ b/crates/bitwarden-api-api/src/models/collection_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CollectionRequestModel { #[serde(rename = "name")] pub name: String, diff --git a/crates/bitwarden-api-api/src/models/collection_response_model.rs b/crates/bitwarden-api-api/src/models/collection_response_model.rs index 580adc1bb..091a88fea 100644 --- a/crates/bitwarden-api-api/src/models/collection_response_model.rs +++ b/crates/bitwarden-api-api/src/models/collection_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CollectionResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/collection_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/collection_response_model_list_response_model.rs index 6a5e3720d..943be4ca5 100644 --- a/crates/bitwarden-api-api/src/models/collection_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/collection_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CollectionResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/collection_with_id_request_model.rs b/crates/bitwarden-api-api/src/models/collection_with_id_request_model.rs index 659dbf617..ae621c621 100644 --- a/crates/bitwarden-api-api/src/models/collection_with_id_request_model.rs +++ b/crates/bitwarden-api-api/src/models/collection_with_id_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CollectionWithIdRequestModel { #[serde(rename = "name")] pub name: String, diff --git a/crates/bitwarden-api-api/src/models/config_response_model.rs b/crates/bitwarden-api-api/src/models/config_response_model.rs index 6ac6d935c..3d087338f 100644 --- a/crates/bitwarden-api-api/src/models/config_response_model.rs +++ b/crates/bitwarden-api-api/src/models/config_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ConfigResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/credential_create_options.rs b/crates/bitwarden-api-api/src/models/credential_create_options.rs new file mode 100644 index 000000000..57d6799f9 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/credential_create_options.rs @@ -0,0 +1,56 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CredentialCreateOptions { + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(rename = "errorMessage", skip_serializing_if = "Option::is_none")] + pub error_message: Option, + #[serde(rename = "rp", skip_serializing_if = "Option::is_none")] + pub rp: Option>, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option>, + #[serde(rename = "challenge", skip_serializing_if = "Option::is_none")] + pub challenge: Option, + #[serde(rename = "pubKeyCredParams", skip_serializing_if = "Option::is_none")] + pub pub_key_cred_params: Option>, + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + #[serde(rename = "attestation", skip_serializing_if = "Option::is_none")] + pub attestation: Option, + #[serde( + rename = "authenticatorSelection", + skip_serializing_if = "Option::is_none" + )] + pub authenticator_selection: Option>, + #[serde(rename = "excludeCredentials", skip_serializing_if = "Option::is_none")] + pub exclude_credentials: Option>, + #[serde(rename = "extensions", skip_serializing_if = "Option::is_none")] + pub extensions: Option>, +} + +impl CredentialCreateOptions { + pub fn new() -> CredentialCreateOptions { + CredentialCreateOptions { + status: None, + error_message: None, + rp: None, + user: None, + challenge: None, + pub_key_cred_params: None, + timeout: None, + attestation: None, + authenticator_selection: None, + exclude_credentials: None, + extensions: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/delete_recover_request_model.rs b/crates/bitwarden-api-api/src/models/delete_recover_request_model.rs index 4a4026d98..a065a1724 100644 --- a/crates/bitwarden-api-api/src/models/delete_recover_request_model.rs +++ b/crates/bitwarden-api-api/src/models/delete_recover_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeleteRecoverRequestModel { #[serde(rename = "email")] pub email: String, diff --git a/crates/bitwarden-api-api/src/models/device_keys_request_model.rs b/crates/bitwarden-api-api/src/models/device_keys_request_model.rs index 4b6fdbb69..4864103b8 100644 --- a/crates/bitwarden-api-api/src/models/device_keys_request_model.rs +++ b/crates/bitwarden-api-api/src/models/device_keys_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeviceKeysRequestModel { #[serde(rename = "encryptedUserKey")] pub encrypted_user_key: String, diff --git a/crates/bitwarden-api-api/src/models/device_keys_update_request_model.rs b/crates/bitwarden-api-api/src/models/device_keys_update_request_model.rs index 65d82513c..8000d96fe 100644 --- a/crates/bitwarden-api-api/src/models/device_keys_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/device_keys_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeviceKeysUpdateRequestModel { #[serde(rename = "encryptedPublicKey")] pub encrypted_public_key: String, diff --git a/crates/bitwarden-api-api/src/models/device_request_model.rs b/crates/bitwarden-api-api/src/models/device_request_model.rs index 556350265..856801792 100644 --- a/crates/bitwarden-api-api/src/models/device_request_model.rs +++ b/crates/bitwarden-api-api/src/models/device_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeviceRequestModel { #[serde(rename = "type")] pub r#type: crate::models::DeviceType, diff --git a/crates/bitwarden-api-api/src/models/device_response_model.rs b/crates/bitwarden-api-api/src/models/device_response_model.rs index c6dc76d96..08a7bfe2f 100644 --- a/crates/bitwarden-api-api/src/models/device_response_model.rs +++ b/crates/bitwarden-api-api/src/models/device_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeviceResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/device_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/device_response_model_list_response_model.rs index 47ab93fae..6db95f61f 100644 --- a/crates/bitwarden-api-api/src/models/device_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/device_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeviceResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/device_token_request_model.rs b/crates/bitwarden-api-api/src/models/device_token_request_model.rs index 1e0b8b3b0..295d8545d 100644 --- a/crates/bitwarden-api-api/src/models/device_token_request_model.rs +++ b/crates/bitwarden-api-api/src/models/device_token_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeviceTokenRequestModel { #[serde(rename = "pushToken", skip_serializing_if = "Option::is_none")] pub push_token: Option, diff --git a/crates/bitwarden-api-api/src/models/device_type.rs b/crates/bitwarden-api-api/src/models/device_type.rs index b6785618a..12e162ce6 100644 --- a/crates/bitwarden-api-api/src/models/device_type.rs +++ b/crates/bitwarden-api-api/src/models/device_type.rs @@ -14,63 +14,69 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum DeviceType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant6 = 6, - Variant7 = 7, - Variant8 = 8, - Variant9 = 9, - Variant10 = 10, - Variant11 = 11, - Variant12 = 12, - Variant13 = 13, - Variant14 = 14, - Variant15 = 15, - Variant16 = 16, - Variant17 = 17, - Variant18 = 18, - Variant19 = 19, - Variant20 = 20, - Variant21 = 21, - Variant22 = 22, + Android = 0, + iOS = 1, + ChromeExtension = 2, + FirefoxExtension = 3, + OperaExtension = 4, + EdgeExtension = 5, + WindowsDesktop = 6, + MacOsDesktop = 7, + LinuxDesktop = 8, + ChromeBrowser = 9, + FirefoxBrowser = 10, + OperaBrowser = 11, + EdgeBrowser = 12, + IEBrowser = 13, + UnknownBrowser = 14, + AndroidAmazon = 15, + UWP = 16, + SafariBrowser = 17, + VivaldiBrowser = 18, + VivaldiExtension = 19, + SafariExtension = 20, + SDK = 21, + Server = 22, + WindowsCLI = 23, + MacOsCLI = 24, + LinuxCLI = 25, } impl ToString for DeviceType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant6 => String::from("6"), - Self::Variant7 => String::from("7"), - Self::Variant8 => String::from("8"), - Self::Variant9 => String::from("9"), - Self::Variant10 => String::from("10"), - Self::Variant11 => String::from("11"), - Self::Variant12 => String::from("12"), - Self::Variant13 => String::from("13"), - Self::Variant14 => String::from("14"), - Self::Variant15 => String::from("15"), - Self::Variant16 => String::from("16"), - Self::Variant17 => String::from("17"), - Self::Variant18 => String::from("18"), - Self::Variant19 => String::from("19"), - Self::Variant20 => String::from("20"), - Self::Variant21 => String::from("21"), - Self::Variant22 => String::from("22"), + Self::Android => String::from("0"), + Self::iOS => String::from("1"), + Self::ChromeExtension => String::from("2"), + Self::FirefoxExtension => String::from("3"), + Self::OperaExtension => String::from("4"), + Self::EdgeExtension => String::from("5"), + Self::WindowsDesktop => String::from("6"), + Self::MacOsDesktop => String::from("7"), + Self::LinuxDesktop => String::from("8"), + Self::ChromeBrowser => String::from("9"), + Self::FirefoxBrowser => String::from("10"), + Self::OperaBrowser => String::from("11"), + Self::EdgeBrowser => String::from("12"), + Self::IEBrowser => String::from("13"), + Self::UnknownBrowser => String::from("14"), + Self::AndroidAmazon => String::from("15"), + Self::UWP => String::from("16"), + Self::SafariBrowser => String::from("17"), + Self::VivaldiBrowser => String::from("18"), + Self::VivaldiExtension => String::from("19"), + Self::SafariExtension => String::from("20"), + Self::SDK => String::from("21"), + Self::Server => String::from("22"), + Self::WindowsCLI => String::from("23"), + Self::MacOsCLI => String::from("24"), + Self::LinuxCLI => String::from("25"), } } } impl Default for DeviceType { fn default() -> DeviceType { - Self::Variant0 + Self::Android } } diff --git a/crates/bitwarden-api-api/src/models/device_verification_request_model.rs b/crates/bitwarden-api-api/src/models/device_verification_request_model.rs index bba9b491a..e6a6907f5 100644 --- a/crates/bitwarden-api-api/src/models/device_verification_request_model.rs +++ b/crates/bitwarden-api-api/src/models/device_verification_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeviceVerificationRequestModel { #[serde(rename = "unknownDeviceVerificationEnabled")] pub unknown_device_verification_enabled: bool, diff --git a/crates/bitwarden-api-api/src/models/device_verification_response_model.rs b/crates/bitwarden-api-api/src/models/device_verification_response_model.rs index e969a8d5b..e9077828b 100644 --- a/crates/bitwarden-api-api/src/models/device_verification_response_model.rs +++ b/crates/bitwarden-api-api/src/models/device_verification_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DeviceVerificationResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/domains_response_model.rs b/crates/bitwarden-api-api/src/models/domains_response_model.rs index 3e4cc73db..8ccab95c1 100644 --- a/crates/bitwarden-api-api/src/models/domains_response_model.rs +++ b/crates/bitwarden-api-api/src/models/domains_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct DomainsResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/email_request_model.rs b/crates/bitwarden-api-api/src/models/email_request_model.rs index 24a205f63..e8db8de94 100644 --- a/crates/bitwarden-api-api/src/models/email_request_model.rs +++ b/crates/bitwarden-api-api/src/models/email_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EmailRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/email_token_request_model.rs b/crates/bitwarden-api-api/src/models/email_token_request_model.rs index ed29f776c..09ea36974 100644 --- a/crates/bitwarden-api-api/src/models/email_token_request_model.rs +++ b/crates/bitwarden-api-api/src/models/email_token_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EmailTokenRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/emergency_access_grantee_details_response_model.rs b/crates/bitwarden-api-api/src/models/emergency_access_grantee_details_response_model.rs index d6b7945e6..6869f6709 100644 --- a/crates/bitwarden-api-api/src/models/emergency_access_grantee_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/emergency_access_grantee_details_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EmergencyAccessGranteeDetailsResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/emergency_access_grantee_details_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/emergency_access_grantee_details_response_model_list_response_model.rs index 1fc800217..9d76aaea9 100644 --- a/crates/bitwarden-api-api/src/models/emergency_access_grantee_details_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/emergency_access_grantee_details_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EmergencyAccessGranteeDetailsResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/emergency_access_grantor_details_response_model.rs b/crates/bitwarden-api-api/src/models/emergency_access_grantor_details_response_model.rs index ecf1eb186..902cd938c 100644 --- a/crates/bitwarden-api-api/src/models/emergency_access_grantor_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/emergency_access_grantor_details_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EmergencyAccessGrantorDetailsResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/emergency_access_grantor_details_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/emergency_access_grantor_details_response_model_list_response_model.rs index 51cbabb3e..414f5037f 100644 --- a/crates/bitwarden-api-api/src/models/emergency_access_grantor_details_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/emergency_access_grantor_details_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EmergencyAccessGrantorDetailsResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/emergency_access_invite_request_model.rs b/crates/bitwarden-api-api/src/models/emergency_access_invite_request_model.rs index 3ec945bc6..2d85903aa 100644 --- a/crates/bitwarden-api-api/src/models/emergency_access_invite_request_model.rs +++ b/crates/bitwarden-api-api/src/models/emergency_access_invite_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EmergencyAccessInviteRequestModel { #[serde(rename = "email")] pub email: String, diff --git a/crates/bitwarden-api-api/src/models/emergency_access_password_request_model.rs b/crates/bitwarden-api-api/src/models/emergency_access_password_request_model.rs index 6687a57fe..091a31495 100644 --- a/crates/bitwarden-api-api/src/models/emergency_access_password_request_model.rs +++ b/crates/bitwarden-api-api/src/models/emergency_access_password_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EmergencyAccessPasswordRequestModel { #[serde(rename = "newMasterPasswordHash")] pub new_master_password_hash: String, diff --git a/crates/bitwarden-api-api/src/models/emergency_access_status_type.rs b/crates/bitwarden-api-api/src/models/emergency_access_status_type.rs index a4766cec4..9b046f3eb 100644 --- a/crates/bitwarden-api-api/src/models/emergency_access_status_type.rs +++ b/crates/bitwarden-api-api/src/models/emergency_access_status_type.rs @@ -14,27 +14,27 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum EmergencyAccessStatusType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, + Invited = 0, + Accepted = 1, + Confirmed = 2, + RecoveryInitiated = 3, + RecoveryApproved = 4, } impl ToString for EmergencyAccessStatusType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), + Self::Invited => String::from("0"), + Self::Accepted => String::from("1"), + Self::Confirmed => String::from("2"), + Self::RecoveryInitiated => String::from("3"), + Self::RecoveryApproved => String::from("4"), } } } impl Default for EmergencyAccessStatusType { fn default() -> EmergencyAccessStatusType { - Self::Variant0 + Self::Invited } } diff --git a/crates/bitwarden-api-api/src/models/emergency_access_takeover_response_model.rs b/crates/bitwarden-api-api/src/models/emergency_access_takeover_response_model.rs index ce22542ea..c4bd0786a 100644 --- a/crates/bitwarden-api-api/src/models/emergency_access_takeover_response_model.rs +++ b/crates/bitwarden-api-api/src/models/emergency_access_takeover_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EmergencyAccessTakeoverResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/emergency_access_type.rs b/crates/bitwarden-api-api/src/models/emergency_access_type.rs index 007df25a2..317c42f94 100644 --- a/crates/bitwarden-api-api/src/models/emergency_access_type.rs +++ b/crates/bitwarden-api-api/src/models/emergency_access_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum EmergencyAccessType { - Variant0 = 0, - Variant1 = 1, + View = 0, + Takeover = 1, } impl ToString for EmergencyAccessType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::View => String::from("0"), + Self::Takeover => String::from("1"), } } } impl Default for EmergencyAccessType { fn default() -> EmergencyAccessType { - Self::Variant0 + Self::View } } diff --git a/crates/bitwarden-api-api/src/models/emergency_access_update_request_model.rs b/crates/bitwarden-api-api/src/models/emergency_access_update_request_model.rs index 184e4288b..433041c35 100644 --- a/crates/bitwarden-api-api/src/models/emergency_access_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/emergency_access_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EmergencyAccessUpdateRequestModel { #[serde(rename = "type")] pub r#type: crate::models::EmergencyAccessType, diff --git a/crates/bitwarden-api-api/src/models/emergency_access_view_response_model.rs b/crates/bitwarden-api-api/src/models/emergency_access_view_response_model.rs index 066162dc1..4e58cda5e 100644 --- a/crates/bitwarden-api-api/src/models/emergency_access_view_response_model.rs +++ b/crates/bitwarden-api-api/src/models/emergency_access_view_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EmergencyAccessViewResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/emergency_access_with_id_request_model.rs b/crates/bitwarden-api-api/src/models/emergency_access_with_id_request_model.rs new file mode 100644 index 000000000..45d16e39b --- /dev/null +++ b/crates/bitwarden-api-api/src/models/emergency_access_with_id_request_model.rs @@ -0,0 +1,36 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EmergencyAccessWithIdRequestModel { + #[serde(rename = "type")] + pub r#type: crate::models::EmergencyAccessType, + #[serde(rename = "waitTimeDays")] + pub wait_time_days: i32, + #[serde(rename = "keyEncrypted", skip_serializing_if = "Option::is_none")] + pub key_encrypted: Option, + #[serde(rename = "id")] + pub id: uuid::Uuid, +} + +impl EmergencyAccessWithIdRequestModel { + pub fn new( + r#type: crate::models::EmergencyAccessType, + wait_time_days: i32, + id: uuid::Uuid, + ) -> EmergencyAccessWithIdRequestModel { + EmergencyAccessWithIdRequestModel { + r#type, + wait_time_days, + key_encrypted: None, + id, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/environment_config_response_model.rs b/crates/bitwarden-api-api/src/models/environment_config_response_model.rs index 1cceee850..9bb550571 100644 --- a/crates/bitwarden-api-api/src/models/environment_config_response_model.rs +++ b/crates/bitwarden-api-api/src/models/environment_config_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EnvironmentConfigResponseModel { #[serde(rename = "cloudRegion", skip_serializing_if = "Option::is_none")] pub cloud_region: Option, diff --git a/crates/bitwarden-api-api/src/models/event_response_model.rs b/crates/bitwarden-api-api/src/models/event_response_model.rs index 03ce76ed7..b634ef7dc 100644 --- a/crates/bitwarden-api-api/src/models/event_response_model.rs +++ b/crates/bitwarden-api-api/src/models/event_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/event_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/event_response_model_list_response_model.rs index e2042731c..40f1d9e8e 100644 --- a/crates/bitwarden-api-api/src/models/event_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/event_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct EventResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/event_system_user.rs b/crates/bitwarden-api-api/src/models/event_system_user.rs index 8a1795433..afb1333e8 100644 --- a/crates/bitwarden-api-api/src/models/event_system_user.rs +++ b/crates/bitwarden-api-api/src/models/event_system_user.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum EventSystemUser { - Variant1 = 1, - Variant2 = 2, + SCIM = 1, + DomainVerification = 2, } impl ToString for EventSystemUser { fn to_string(&self) -> String { match self { - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::SCIM => String::from("1"), + Self::DomainVerification => String::from("2"), } } } impl Default for EventSystemUser { fn default() -> EventSystemUser { - Self::Variant1 + Self::SCIM } } diff --git a/crates/bitwarden-api-api/src/models/event_type.rs b/crates/bitwarden-api-api/src/models/event_type.rs index f0cea8ebc..2826c1fb4 100644 --- a/crates/bitwarden-api-api/src/models/event_type.rs +++ b/crates/bitwarden-api-api/src/models/event_type.rs @@ -14,163 +14,165 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum EventType { - Variant1000 = 1000, - Variant1001 = 1001, - Variant1002 = 1002, - Variant1003 = 1003, - Variant1004 = 1004, - Variant1005 = 1005, - Variant1006 = 1006, - Variant1007 = 1007, - Variant1008 = 1008, - Variant1009 = 1009, - Variant1010 = 1010, - Variant1100 = 1100, - Variant1101 = 1101, - Variant1102 = 1102, - Variant1103 = 1103, - Variant1104 = 1104, - Variant1105 = 1105, - Variant1106 = 1106, - Variant1107 = 1107, - Variant1108 = 1108, - Variant1109 = 1109, - Variant1110 = 1110, - Variant1111 = 1111, - Variant1112 = 1112, - Variant1113 = 1113, - Variant1114 = 1114, - Variant1115 = 1115, - Variant1116 = 1116, - Variant1117 = 1117, - Variant1300 = 1300, - Variant1301 = 1301, - Variant1302 = 1302, - Variant1400 = 1400, - Variant1401 = 1401, - Variant1402 = 1402, - Variant1500 = 1500, - Variant1501 = 1501, - Variant1502 = 1502, - Variant1503 = 1503, - Variant1504 = 1504, - Variant1505 = 1505, - Variant1506 = 1506, - Variant1507 = 1507, - Variant1508 = 1508, - Variant1509 = 1509, - Variant1510 = 1510, - Variant1511 = 1511, - Variant1512 = 1512, - Variant1513 = 1513, - Variant1514 = 1514, - Variant1600 = 1600, - Variant1601 = 1601, - Variant1602 = 1602, - Variant1603 = 1603, - Variant1604 = 1604, - Variant1605 = 1605, - Variant1606 = 1606, - Variant1607 = 1607, - Variant1608 = 1608, - Variant1700 = 1700, - Variant1800 = 1800, - Variant1801 = 1801, - Variant1802 = 1802, - Variant1803 = 1803, - Variant1900 = 1900, - Variant1901 = 1901, - Variant1902 = 1902, - Variant1903 = 1903, - Variant2000 = 2000, - Variant2001 = 2001, - Variant2002 = 2002, - Variant2003 = 2003, - Variant2100 = 2100, + User_LoggedIn = 1000, + User_ChangedPassword = 1001, + User_Updated2fa = 1002, + User_Disabled2fa = 1003, + User_Recovered2fa = 1004, + User_FailedLogIn = 1005, + User_FailedLogIn2fa = 1006, + User_ClientExportedVault = 1007, + User_UpdatedTempPassword = 1008, + User_MigratedKeyToKeyConnector = 1009, + User_RequestedDeviceApproval = 1010, + Cipher_Created = 1100, + Cipher_Updated = 1101, + Cipher_Deleted = 1102, + Cipher_AttachmentCreated = 1103, + Cipher_AttachmentDeleted = 1104, + Cipher_Shared = 1105, + Cipher_UpdatedCollections = 1106, + Cipher_ClientViewed = 1107, + Cipher_ClientToggledPasswordVisible = 1108, + Cipher_ClientToggledHiddenFieldVisible = 1109, + Cipher_ClientToggledCardCodeVisible = 1110, + Cipher_ClientCopiedPassword = 1111, + Cipher_ClientCopiedHiddenField = 1112, + Cipher_ClientCopiedCardCode = 1113, + Cipher_ClientAutofilled = 1114, + Cipher_SoftDeleted = 1115, + Cipher_Restored = 1116, + Cipher_ClientToggledCardNumberVisible = 1117, + Collection_Created = 1300, + Collection_Updated = 1301, + Collection_Deleted = 1302, + Group_Created = 1400, + Group_Updated = 1401, + Group_Deleted = 1402, + OrganizationUser_Invited = 1500, + OrganizationUser_Confirmed = 1501, + OrganizationUser_Updated = 1502, + OrganizationUser_Removed = 1503, + OrganizationUser_UpdatedGroups = 1504, + OrganizationUser_UnlinkedSso = 1505, + OrganizationUser_ResetPassword_Enroll = 1506, + OrganizationUser_ResetPassword_Withdraw = 1507, + OrganizationUser_AdminResetPassword = 1508, + OrganizationUser_ResetSsoLink = 1509, + OrganizationUser_FirstSsoLogin = 1510, + OrganizationUser_Revoked = 1511, + OrganizationUser_Restored = 1512, + OrganizationUser_ApprovedAuthRequest = 1513, + OrganizationUser_RejectedAuthRequest = 1514, + Organization_Updated = 1600, + Organization_PurgedVault = 1601, + Organization_ClientExportedVault = 1602, + Organization_VaultAccessed = 1603, + Organization_EnabledSso = 1604, + Organization_DisabledSso = 1605, + Organization_EnabledKeyConnector = 1606, + Organization_DisabledKeyConnector = 1607, + Organization_SponsorshipsSynced = 1608, + Organization_CollectionManagement_Updated = 1609, + Policy_Updated = 1700, + ProviderUser_Invited = 1800, + ProviderUser_Confirmed = 1801, + ProviderUser_Updated = 1802, + ProviderUser_Removed = 1803, + ProviderOrganization_Created = 1900, + ProviderOrganization_Added = 1901, + ProviderOrganization_Removed = 1902, + ProviderOrganization_VaultAccessed = 1903, + OrganizationDomain_Added = 2000, + OrganizationDomain_Removed = 2001, + OrganizationDomain_Verified = 2002, + OrganizationDomain_NotVerified = 2003, + Secret_Retrieved = 2100, } impl ToString for EventType { fn to_string(&self) -> String { match self { - Self::Variant1000 => String::from("1000"), - Self::Variant1001 => String::from("1001"), - Self::Variant1002 => String::from("1002"), - Self::Variant1003 => String::from("1003"), - Self::Variant1004 => String::from("1004"), - Self::Variant1005 => String::from("1005"), - Self::Variant1006 => String::from("1006"), - Self::Variant1007 => String::from("1007"), - Self::Variant1008 => String::from("1008"), - Self::Variant1009 => String::from("1009"), - Self::Variant1010 => String::from("1010"), - Self::Variant1100 => String::from("1100"), - Self::Variant1101 => String::from("1101"), - Self::Variant1102 => String::from("1102"), - Self::Variant1103 => String::from("1103"), - Self::Variant1104 => String::from("1104"), - Self::Variant1105 => String::from("1105"), - Self::Variant1106 => String::from("1106"), - Self::Variant1107 => String::from("1107"), - Self::Variant1108 => String::from("1108"), - Self::Variant1109 => String::from("1109"), - Self::Variant1110 => String::from("1110"), - Self::Variant1111 => String::from("1111"), - Self::Variant1112 => String::from("1112"), - Self::Variant1113 => String::from("1113"), - Self::Variant1114 => String::from("1114"), - Self::Variant1115 => String::from("1115"), - Self::Variant1116 => String::from("1116"), - Self::Variant1117 => String::from("1117"), - Self::Variant1300 => String::from("1300"), - Self::Variant1301 => String::from("1301"), - Self::Variant1302 => String::from("1302"), - Self::Variant1400 => String::from("1400"), - Self::Variant1401 => String::from("1401"), - Self::Variant1402 => String::from("1402"), - Self::Variant1500 => String::from("1500"), - Self::Variant1501 => String::from("1501"), - Self::Variant1502 => String::from("1502"), - Self::Variant1503 => String::from("1503"), - Self::Variant1504 => String::from("1504"), - Self::Variant1505 => String::from("1505"), - Self::Variant1506 => String::from("1506"), - Self::Variant1507 => String::from("1507"), - Self::Variant1508 => String::from("1508"), - Self::Variant1509 => String::from("1509"), - Self::Variant1510 => String::from("1510"), - Self::Variant1511 => String::from("1511"), - Self::Variant1512 => String::from("1512"), - Self::Variant1513 => String::from("1513"), - Self::Variant1514 => String::from("1514"), - Self::Variant1600 => String::from("1600"), - Self::Variant1601 => String::from("1601"), - Self::Variant1602 => String::from("1602"), - Self::Variant1603 => String::from("1603"), - Self::Variant1604 => String::from("1604"), - Self::Variant1605 => String::from("1605"), - Self::Variant1606 => String::from("1606"), - Self::Variant1607 => String::from("1607"), - Self::Variant1608 => String::from("1608"), - Self::Variant1700 => String::from("1700"), - Self::Variant1800 => String::from("1800"), - Self::Variant1801 => String::from("1801"), - Self::Variant1802 => String::from("1802"), - Self::Variant1803 => String::from("1803"), - Self::Variant1900 => String::from("1900"), - Self::Variant1901 => String::from("1901"), - Self::Variant1902 => String::from("1902"), - Self::Variant1903 => String::from("1903"), - Self::Variant2000 => String::from("2000"), - Self::Variant2001 => String::from("2001"), - Self::Variant2002 => String::from("2002"), - Self::Variant2003 => String::from("2003"), - Self::Variant2100 => String::from("2100"), + Self::User_LoggedIn => String::from("1000"), + Self::User_ChangedPassword => String::from("1001"), + Self::User_Updated2fa => String::from("1002"), + Self::User_Disabled2fa => String::from("1003"), + Self::User_Recovered2fa => String::from("1004"), + Self::User_FailedLogIn => String::from("1005"), + Self::User_FailedLogIn2fa => String::from("1006"), + Self::User_ClientExportedVault => String::from("1007"), + Self::User_UpdatedTempPassword => String::from("1008"), + Self::User_MigratedKeyToKeyConnector => String::from("1009"), + Self::User_RequestedDeviceApproval => String::from("1010"), + Self::Cipher_Created => String::from("1100"), + Self::Cipher_Updated => String::from("1101"), + Self::Cipher_Deleted => String::from("1102"), + Self::Cipher_AttachmentCreated => String::from("1103"), + Self::Cipher_AttachmentDeleted => String::from("1104"), + Self::Cipher_Shared => String::from("1105"), + Self::Cipher_UpdatedCollections => String::from("1106"), + Self::Cipher_ClientViewed => String::from("1107"), + Self::Cipher_ClientToggledPasswordVisible => String::from("1108"), + Self::Cipher_ClientToggledHiddenFieldVisible => String::from("1109"), + Self::Cipher_ClientToggledCardCodeVisible => String::from("1110"), + Self::Cipher_ClientCopiedPassword => String::from("1111"), + Self::Cipher_ClientCopiedHiddenField => String::from("1112"), + Self::Cipher_ClientCopiedCardCode => String::from("1113"), + Self::Cipher_ClientAutofilled => String::from("1114"), + Self::Cipher_SoftDeleted => String::from("1115"), + Self::Cipher_Restored => String::from("1116"), + Self::Cipher_ClientToggledCardNumberVisible => String::from("1117"), + Self::Collection_Created => String::from("1300"), + Self::Collection_Updated => String::from("1301"), + Self::Collection_Deleted => String::from("1302"), + Self::Group_Created => String::from("1400"), + Self::Group_Updated => String::from("1401"), + Self::Group_Deleted => String::from("1402"), + Self::OrganizationUser_Invited => String::from("1500"), + Self::OrganizationUser_Confirmed => String::from("1501"), + Self::OrganizationUser_Updated => String::from("1502"), + Self::OrganizationUser_Removed => String::from("1503"), + Self::OrganizationUser_UpdatedGroups => String::from("1504"), + Self::OrganizationUser_UnlinkedSso => String::from("1505"), + Self::OrganizationUser_ResetPassword_Enroll => String::from("1506"), + Self::OrganizationUser_ResetPassword_Withdraw => String::from("1507"), + Self::OrganizationUser_AdminResetPassword => String::from("1508"), + Self::OrganizationUser_ResetSsoLink => String::from("1509"), + Self::OrganizationUser_FirstSsoLogin => String::from("1510"), + Self::OrganizationUser_Revoked => String::from("1511"), + Self::OrganizationUser_Restored => String::from("1512"), + Self::OrganizationUser_ApprovedAuthRequest => String::from("1513"), + Self::OrganizationUser_RejectedAuthRequest => String::from("1514"), + Self::Organization_Updated => String::from("1600"), + Self::Organization_PurgedVault => String::from("1601"), + Self::Organization_ClientExportedVault => String::from("1602"), + Self::Organization_VaultAccessed => String::from("1603"), + Self::Organization_EnabledSso => String::from("1604"), + Self::Organization_DisabledSso => String::from("1605"), + Self::Organization_EnabledKeyConnector => String::from("1606"), + Self::Organization_DisabledKeyConnector => String::from("1607"), + Self::Organization_SponsorshipsSynced => String::from("1608"), + Self::Organization_CollectionManagement_Updated => String::from("1609"), + Self::Policy_Updated => String::from("1700"), + Self::ProviderUser_Invited => String::from("1800"), + Self::ProviderUser_Confirmed => String::from("1801"), + Self::ProviderUser_Updated => String::from("1802"), + Self::ProviderUser_Removed => String::from("1803"), + Self::ProviderOrganization_Created => String::from("1900"), + Self::ProviderOrganization_Added => String::from("1901"), + Self::ProviderOrganization_Removed => String::from("1902"), + Self::ProviderOrganization_VaultAccessed => String::from("1903"), + Self::OrganizationDomain_Added => String::from("2000"), + Self::OrganizationDomain_Removed => String::from("2001"), + Self::OrganizationDomain_Verified => String::from("2002"), + Self::OrganizationDomain_NotVerified => String::from("2003"), + Self::Secret_Retrieved => String::from("2100"), } } } impl Default for EventType { fn default() -> EventType { - Self::Variant1000 + Self::User_LoggedIn } } diff --git a/crates/bitwarden-api-api/src/models/inner_project.rs b/crates/bitwarden-api-api/src/models/fido2_user.rs similarity index 63% rename from crates/bitwarden-api-api/src/models/inner_project.rs rename to crates/bitwarden-api-api/src/models/fido2_user.rs index 59ecb7f07..542019d39 100644 --- a/crates/bitwarden-api-api/src/models/inner_project.rs +++ b/crates/bitwarden-api-api/src/models/fido2_user.rs @@ -8,19 +8,22 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct InnerProject { - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Fido2User { #[serde(rename = "name", skip_serializing_if = "Option::is_none")] pub name: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "displayName", skip_serializing_if = "Option::is_none")] + pub display_name: Option, } -impl InnerProject { - pub fn new() -> InnerProject { - InnerProject { - id: None, +impl Fido2User { + pub fn new() -> Fido2User { + Fido2User { name: None, + id: None, + display_name: None, } } } diff --git a/crates/bitwarden-api-api/src/models/field_type.rs b/crates/bitwarden-api-api/src/models/field_type.rs index fbaa9b728..3a6209399 100644 --- a/crates/bitwarden-api-api/src/models/field_type.rs +++ b/crates/bitwarden-api-api/src/models/field_type.rs @@ -14,25 +14,25 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum FieldType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, + Text = 0, + Hidden = 1, + Boolean = 2, + Linked = 3, } impl ToString for FieldType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), + Self::Text => String::from("0"), + Self::Hidden => String::from("1"), + Self::Boolean => String::from("2"), + Self::Linked => String::from("3"), } } } impl Default for FieldType { fn default() -> FieldType { - Self::Variant0 + Self::Text } } diff --git a/crates/bitwarden-api-api/src/models/file_upload_type.rs b/crates/bitwarden-api-api/src/models/file_upload_type.rs index 765bc7563..79327b3cb 100644 --- a/crates/bitwarden-api-api/src/models/file_upload_type.rs +++ b/crates/bitwarden-api-api/src/models/file_upload_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum FileUploadType { - Variant0 = 0, - Variant1 = 1, + Direct = 0, + Azure = 1, } impl ToString for FileUploadType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::Direct => String::from("0"), + Self::Azure => String::from("1"), } } } impl Default for FileUploadType { fn default() -> FileUploadType { - Self::Variant0 + Self::Direct } } diff --git a/crates/bitwarden-api-api/src/models/folder_request_model.rs b/crates/bitwarden-api-api/src/models/folder_request_model.rs index d226d2e04..cb73d7693 100644 --- a/crates/bitwarden-api-api/src/models/folder_request_model.rs +++ b/crates/bitwarden-api-api/src/models/folder_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FolderRequestModel { #[serde(rename = "name")] pub name: String, diff --git a/crates/bitwarden-api-api/src/models/folder_response_model.rs b/crates/bitwarden-api-api/src/models/folder_response_model.rs index 976340c98..705c45f04 100644 --- a/crates/bitwarden-api-api/src/models/folder_response_model.rs +++ b/crates/bitwarden-api-api/src/models/folder_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FolderResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/folder_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/folder_response_model_list_response_model.rs index d0209006d..3a12dfd31 100644 --- a/crates/bitwarden-api-api/src/models/folder_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/folder_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FolderResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/folder_with_id_request_model.rs b/crates/bitwarden-api-api/src/models/folder_with_id_request_model.rs index 599126620..a69b5ef8c 100644 --- a/crates/bitwarden-api-api/src/models/folder_with_id_request_model.rs +++ b/crates/bitwarden-api-api/src/models/folder_with_id_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct FolderWithIdRequestModel { #[serde(rename = "name")] pub name: String, diff --git a/crates/bitwarden-api-api/src/models/get_secrets_request_model.rs b/crates/bitwarden-api-api/src/models/get_secrets_request_model.rs index 2786d8c9d..93ca67bde 100644 --- a/crates/bitwarden-api-api/src/models/get_secrets_request_model.rs +++ b/crates/bitwarden-api-api/src/models/get_secrets_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GetSecretsRequestModel { #[serde(rename = "ids")] pub ids: Vec, diff --git a/crates/bitwarden-api-api/src/models/global_domains.rs b/crates/bitwarden-api-api/src/models/global_domains.rs index 10a943482..b86399762 100644 --- a/crates/bitwarden-api-api/src/models/global_domains.rs +++ b/crates/bitwarden-api-api/src/models/global_domains.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GlobalDomains { #[serde(rename = "type", skip_serializing_if = "Option::is_none")] pub r#type: Option, diff --git a/crates/bitwarden-api-api/src/models/global_equivalent_domains_type.rs b/crates/bitwarden-api-api/src/models/global_equivalent_domains_type.rs index f5e1c3655..f30b2d5e7 100644 --- a/crates/bitwarden-api-api/src/models/global_equivalent_domains_type.rs +++ b/crates/bitwarden-api-api/src/models/global_equivalent_domains_type.rs @@ -14,199 +14,199 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum GlobalEquivalentDomainsType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant6 = 6, - Variant7 = 7, - Variant8 = 8, - Variant9 = 9, - Variant10 = 10, - Variant11 = 11, - Variant12 = 12, - Variant13 = 13, - Variant14 = 14, - Variant15 = 15, - Variant16 = 16, - Variant17 = 17, - Variant18 = 18, - Variant19 = 19, - Variant20 = 20, - Variant21 = 21, - Variant22 = 22, - Variant23 = 23, - Variant24 = 24, - Variant25 = 25, - Variant26 = 26, - Variant27 = 27, - Variant28 = 28, - Variant29 = 29, - Variant30 = 30, - Variant31 = 31, - Variant32 = 32, - Variant33 = 33, - Variant34 = 34, - Variant35 = 35, - Variant36 = 36, - Variant37 = 37, - Variant38 = 38, - Variant39 = 39, - Variant40 = 40, - Variant41 = 41, - Variant42 = 42, - Variant43 = 43, - Variant44 = 44, - Variant45 = 45, - Variant46 = 46, - Variant47 = 47, - Variant48 = 48, - Variant49 = 49, - Variant50 = 50, - Variant51 = 51, - Variant52 = 52, - Variant53 = 53, - Variant54 = 54, - Variant55 = 55, - Variant56 = 56, - Variant57 = 57, - Variant58 = 58, - Variant59 = 59, - Variant60 = 60, - Variant61 = 61, - Variant62 = 62, - Variant63 = 63, - Variant64 = 64, - Variant65 = 65, - Variant66 = 66, - Variant67 = 67, - Variant68 = 68, - Variant69 = 69, - Variant70 = 70, - Variant71 = 71, - Variant72 = 72, - Variant73 = 73, - Variant74 = 74, - Variant75 = 75, - Variant76 = 76, - Variant77 = 77, - Variant78 = 78, - Variant79 = 79, - Variant80 = 80, - Variant81 = 81, - Variant82 = 82, - Variant83 = 83, - Variant84 = 84, - Variant85 = 85, - Variant86 = 86, - Variant87 = 87, - Variant88 = 88, - Variant89 = 89, - Variant90 = 90, + Google = 0, + Apple = 1, + Ameritrade = 2, + BoA = 3, + Sprint = 4, + WellsFargo = 5, + Merrill = 6, + Citi = 7, + Cnet = 8, + Gap = 9, + Microsoft = 10, + United = 11, + Yahoo = 12, + Zonelabs = 13, + PayPal = 14, + Avon = 15, + Diapers = 16, + Contacts = 17, + Amazon = 18, + Cox = 19, + Norton = 20, + Verizon = 21, + Buy = 22, + Sirius = 23, + Ea = 24, + Basecamp = 25, + Steam = 26, + Chart = 27, + Gotomeeting = 28, + Gogo = 29, + Oracle = 30, + Discover = 31, + Dcu = 32, + Healthcare = 33, + Pepco = 34, + Century21 = 35, + Comcast = 36, + Cricket = 37, + Mtb = 38, + Dropbox = 39, + Snapfish = 40, + Alibaba = 41, + Playstation = 42, + Mercado = 43, + Zendesk = 44, + Autodesk = 45, + RailNation = 46, + Wpcu = 47, + Mathletics = 48, + Discountbank = 49, + Mi = 50, + Facebook = 51, + Postepay = 52, + Skysports = 53, + Disney = 54, + Pokemon = 55, + Uv = 56, + Yahavo = 57, + Mdsol = 58, + Sears = 59, + Xiami = 60, + Belkin = 61, + Turbotax = 62, + Shopify = 63, + Ebay = 64, + Techdata = 65, + Schwab = 66, + Mozilla = 67, + Tesla = 68, + MorganStanley = 69, + TaxAct = 70, + Wikimedia = 71, + Airbnb = 72, + Eventbrite = 73, + StackExchange = 74, + Docusign = 75, + Envato = 76, + X10Hosting = 77, + Cisco = 78, + CedarFair = 79, + Ubiquiti = 80, + Discord = 81, + Netcup = 82, + Yandex = 83, + Sony = 84, + Proton = 85, + Ubisoft = 86, + TransferWise = 87, + TakeawayEU = 88, + Atlassian = 89, + Pinterest = 90, } impl ToString for GlobalEquivalentDomainsType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant6 => String::from("6"), - Self::Variant7 => String::from("7"), - Self::Variant8 => String::from("8"), - Self::Variant9 => String::from("9"), - Self::Variant10 => String::from("10"), - Self::Variant11 => String::from("11"), - Self::Variant12 => String::from("12"), - Self::Variant13 => String::from("13"), - Self::Variant14 => String::from("14"), - Self::Variant15 => String::from("15"), - Self::Variant16 => String::from("16"), - Self::Variant17 => String::from("17"), - Self::Variant18 => String::from("18"), - Self::Variant19 => String::from("19"), - Self::Variant20 => String::from("20"), - Self::Variant21 => String::from("21"), - Self::Variant22 => String::from("22"), - Self::Variant23 => String::from("23"), - Self::Variant24 => String::from("24"), - Self::Variant25 => String::from("25"), - Self::Variant26 => String::from("26"), - Self::Variant27 => String::from("27"), - Self::Variant28 => String::from("28"), - Self::Variant29 => String::from("29"), - Self::Variant30 => String::from("30"), - Self::Variant31 => String::from("31"), - Self::Variant32 => String::from("32"), - Self::Variant33 => String::from("33"), - Self::Variant34 => String::from("34"), - Self::Variant35 => String::from("35"), - Self::Variant36 => String::from("36"), - Self::Variant37 => String::from("37"), - Self::Variant38 => String::from("38"), - Self::Variant39 => String::from("39"), - Self::Variant40 => String::from("40"), - Self::Variant41 => String::from("41"), - Self::Variant42 => String::from("42"), - Self::Variant43 => String::from("43"), - Self::Variant44 => String::from("44"), - Self::Variant45 => String::from("45"), - Self::Variant46 => String::from("46"), - Self::Variant47 => String::from("47"), - Self::Variant48 => String::from("48"), - Self::Variant49 => String::from("49"), - Self::Variant50 => String::from("50"), - Self::Variant51 => String::from("51"), - Self::Variant52 => String::from("52"), - Self::Variant53 => String::from("53"), - Self::Variant54 => String::from("54"), - Self::Variant55 => String::from("55"), - Self::Variant56 => String::from("56"), - Self::Variant57 => String::from("57"), - Self::Variant58 => String::from("58"), - Self::Variant59 => String::from("59"), - Self::Variant60 => String::from("60"), - Self::Variant61 => String::from("61"), - Self::Variant62 => String::from("62"), - Self::Variant63 => String::from("63"), - Self::Variant64 => String::from("64"), - Self::Variant65 => String::from("65"), - Self::Variant66 => String::from("66"), - Self::Variant67 => String::from("67"), - Self::Variant68 => String::from("68"), - Self::Variant69 => String::from("69"), - Self::Variant70 => String::from("70"), - Self::Variant71 => String::from("71"), - Self::Variant72 => String::from("72"), - Self::Variant73 => String::from("73"), - Self::Variant74 => String::from("74"), - Self::Variant75 => String::from("75"), - Self::Variant76 => String::from("76"), - Self::Variant77 => String::from("77"), - Self::Variant78 => String::from("78"), - Self::Variant79 => String::from("79"), - Self::Variant80 => String::from("80"), - Self::Variant81 => String::from("81"), - Self::Variant82 => String::from("82"), - Self::Variant83 => String::from("83"), - Self::Variant84 => String::from("84"), - Self::Variant85 => String::from("85"), - Self::Variant86 => String::from("86"), - Self::Variant87 => String::from("87"), - Self::Variant88 => String::from("88"), - Self::Variant89 => String::from("89"), - Self::Variant90 => String::from("90"), + Self::Google => String::from("0"), + Self::Apple => String::from("1"), + Self::Ameritrade => String::from("2"), + Self::BoA => String::from("3"), + Self::Sprint => String::from("4"), + Self::WellsFargo => String::from("5"), + Self::Merrill => String::from("6"), + Self::Citi => String::from("7"), + Self::Cnet => String::from("8"), + Self::Gap => String::from("9"), + Self::Microsoft => String::from("10"), + Self::United => String::from("11"), + Self::Yahoo => String::from("12"), + Self::Zonelabs => String::from("13"), + Self::PayPal => String::from("14"), + Self::Avon => String::from("15"), + Self::Diapers => String::from("16"), + Self::Contacts => String::from("17"), + Self::Amazon => String::from("18"), + Self::Cox => String::from("19"), + Self::Norton => String::from("20"), + Self::Verizon => String::from("21"), + Self::Buy => String::from("22"), + Self::Sirius => String::from("23"), + Self::Ea => String::from("24"), + Self::Basecamp => String::from("25"), + Self::Steam => String::from("26"), + Self::Chart => String::from("27"), + Self::Gotomeeting => String::from("28"), + Self::Gogo => String::from("29"), + Self::Oracle => String::from("30"), + Self::Discover => String::from("31"), + Self::Dcu => String::from("32"), + Self::Healthcare => String::from("33"), + Self::Pepco => String::from("34"), + Self::Century21 => String::from("35"), + Self::Comcast => String::from("36"), + Self::Cricket => String::from("37"), + Self::Mtb => String::from("38"), + Self::Dropbox => String::from("39"), + Self::Snapfish => String::from("40"), + Self::Alibaba => String::from("41"), + Self::Playstation => String::from("42"), + Self::Mercado => String::from("43"), + Self::Zendesk => String::from("44"), + Self::Autodesk => String::from("45"), + Self::RailNation => String::from("46"), + Self::Wpcu => String::from("47"), + Self::Mathletics => String::from("48"), + Self::Discountbank => String::from("49"), + Self::Mi => String::from("50"), + Self::Facebook => String::from("51"), + Self::Postepay => String::from("52"), + Self::Skysports => String::from("53"), + Self::Disney => String::from("54"), + Self::Pokemon => String::from("55"), + Self::Uv => String::from("56"), + Self::Yahavo => String::from("57"), + Self::Mdsol => String::from("58"), + Self::Sears => String::from("59"), + Self::Xiami => String::from("60"), + Self::Belkin => String::from("61"), + Self::Turbotax => String::from("62"), + Self::Shopify => String::from("63"), + Self::Ebay => String::from("64"), + Self::Techdata => String::from("65"), + Self::Schwab => String::from("66"), + Self::Mozilla => String::from("67"), + Self::Tesla => String::from("68"), + Self::MorganStanley => String::from("69"), + Self::TaxAct => String::from("70"), + Self::Wikimedia => String::from("71"), + Self::Airbnb => String::from("72"), + Self::Eventbrite => String::from("73"), + Self::StackExchange => String::from("74"), + Self::Docusign => String::from("75"), + Self::Envato => String::from("76"), + Self::X10Hosting => String::from("77"), + Self::Cisco => String::from("78"), + Self::CedarFair => String::from("79"), + Self::Ubiquiti => String::from("80"), + Self::Discord => String::from("81"), + Self::Netcup => String::from("82"), + Self::Yandex => String::from("83"), + Self::Sony => String::from("84"), + Self::Proton => String::from("85"), + Self::Ubisoft => String::from("86"), + Self::TransferWise => String::from("87"), + Self::TakeawayEU => String::from("88"), + Self::Atlassian => String::from("89"), + Self::Pinterest => String::from("90"), } } } impl Default for GlobalEquivalentDomainsType { fn default() -> GlobalEquivalentDomainsType { - Self::Variant0 + Self::Google } } diff --git a/crates/bitwarden-api-api/src/models/granted_access_policy_request.rs b/crates/bitwarden-api-api/src/models/granted_access_policy_request.rs index 4d4f1291d..3d35274a0 100644 --- a/crates/bitwarden-api-api/src/models/granted_access_policy_request.rs +++ b/crates/bitwarden-api-api/src/models/granted_access_policy_request.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GrantedAccessPolicyRequest { #[serde(rename = "grantedId")] pub granted_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/models/group.rs b/crates/bitwarden-api-api/src/models/group.rs index c7acafc56..7133029b5 100644 --- a/crates/bitwarden-api-api/src/models/group.rs +++ b/crates/bitwarden-api-api/src/models/group.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Group { #[serde(rename = "name")] pub name: String, diff --git a/crates/bitwarden-api-api/src/models/group_bulk_request_model.rs b/crates/bitwarden-api-api/src/models/group_bulk_request_model.rs index 1f56fe0fb..432f9f6d8 100644 --- a/crates/bitwarden-api-api/src/models/group_bulk_request_model.rs +++ b/crates/bitwarden-api-api/src/models/group_bulk_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupBulkRequestModel { #[serde(rename = "ids")] pub ids: Vec, diff --git a/crates/bitwarden-api-api/src/models/group_details_response_model.rs b/crates/bitwarden-api-api/src/models/group_details_response_model.rs index 91e20d584..d6ee7239a 100644 --- a/crates/bitwarden-api-api/src/models/group_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/group_details_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupDetailsResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/group_details_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/group_details_response_model_list_response_model.rs index 5aa54b57c..c1c19d332 100644 --- a/crates/bitwarden-api-api/src/models/group_details_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/group_details_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupDetailsResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/group_project_access_policy_response_model.rs b/crates/bitwarden-api-api/src/models/group_project_access_policy_response_model.rs index d43b70e95..2b6f5c9c0 100644 --- a/crates/bitwarden-api-api/src/models/group_project_access_policy_response_model.rs +++ b/crates/bitwarden-api-api/src/models/group_project_access_policy_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupProjectAccessPolicyResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/group_request_model.rs b/crates/bitwarden-api-api/src/models/group_request_model.rs index 27d24defc..0284a04d9 100644 --- a/crates/bitwarden-api-api/src/models/group_request_model.rs +++ b/crates/bitwarden-api-api/src/models/group_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupRequestModel { #[serde(rename = "name")] pub name: String, diff --git a/crates/bitwarden-api-api/src/models/group_response_model.rs b/crates/bitwarden-api-api/src/models/group_response_model.rs index 32d43b51f..388fe68f5 100644 --- a/crates/bitwarden-api-api/src/models/group_response_model.rs +++ b/crates/bitwarden-api-api/src/models/group_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/group_service_account_access_policy_response_model.rs b/crates/bitwarden-api-api/src/models/group_service_account_access_policy_response_model.rs index 0f7eb9b3e..af04b2cfe 100644 --- a/crates/bitwarden-api-api/src/models/group_service_account_access_policy_response_model.rs +++ b/crates/bitwarden-api-api/src/models/group_service_account_access_policy_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct GroupServiceAccountAccessPolicyResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/iap_check_request_model.rs b/crates/bitwarden-api-api/src/models/iap_check_request_model.rs deleted file mode 100644 index f18b4b017..000000000 --- a/crates/bitwarden-api-api/src/models/iap_check_request_model.rs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Bitwarden Internal API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: latest - * - * Generated by: https://openapi-generator.tech - */ - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct IapCheckRequestModel { - #[serde(rename = "paymentMethodType")] - pub payment_method_type: crate::models::PaymentMethodType, -} - -impl IapCheckRequestModel { - pub fn new(payment_method_type: crate::models::PaymentMethodType) -> IapCheckRequestModel { - IapCheckRequestModel { - payment_method_type, - } - } -} diff --git a/crates/bitwarden-api-api/src/models/import_ciphers_request_model.rs b/crates/bitwarden-api-api/src/models/import_ciphers_request_model.rs index 9cc2a7d75..371f2fa5c 100644 --- a/crates/bitwarden-api-api/src/models/import_ciphers_request_model.rs +++ b/crates/bitwarden-api-api/src/models/import_ciphers_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImportCiphersRequestModel { #[serde(rename = "folders", skip_serializing_if = "Option::is_none")] pub folders: Option>, diff --git a/crates/bitwarden-api-api/src/models/import_organization_ciphers_request_model.rs b/crates/bitwarden-api-api/src/models/import_organization_ciphers_request_model.rs index 625f733a3..894fb7131 100644 --- a/crates/bitwarden-api-api/src/models/import_organization_ciphers_request_model.rs +++ b/crates/bitwarden-api-api/src/models/import_organization_ciphers_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImportOrganizationCiphersRequestModel { #[serde(rename = "collections", skip_serializing_if = "Option::is_none")] pub collections: Option>, diff --git a/crates/bitwarden-api-api/src/models/import_organization_users_request_model.rs b/crates/bitwarden-api-api/src/models/import_organization_users_request_model.rs index 72f276d05..ff5be1b6f 100644 --- a/crates/bitwarden-api-api/src/models/import_organization_users_request_model.rs +++ b/crates/bitwarden-api-api/src/models/import_organization_users_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ImportOrganizationUsersRequestModel { #[serde(rename = "groups", skip_serializing_if = "Option::is_none")] pub groups: Option>, diff --git a/crates/bitwarden-api-api/src/models/inner_project_export_response_model.rs b/crates/bitwarden-api-api/src/models/inner_project_export_response_model.rs index 2c14b4d3c..a34dab3a6 100644 --- a/crates/bitwarden-api-api/src/models/inner_project_export_response_model.rs +++ b/crates/bitwarden-api-api/src/models/inner_project_export_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InnerProjectExportResponseModel { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/crates/bitwarden-api-api/src/models/inner_project_import_request_model.rs b/crates/bitwarden-api-api/src/models/inner_project_import_request_model.rs index 1f3b7614d..808504d83 100644 --- a/crates/bitwarden-api-api/src/models/inner_project_import_request_model.rs +++ b/crates/bitwarden-api-api/src/models/inner_project_import_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InnerProjectImportRequestModel { #[serde(rename = "id")] pub id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/models/inner_secret.rs b/crates/bitwarden-api-api/src/models/inner_secret.rs deleted file mode 100644 index 43deb0f1a..000000000 --- a/crates/bitwarden-api-api/src/models/inner_secret.rs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Bitwarden Internal API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: latest - * - * Generated by: https://openapi-generator.tech - */ - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct InnerSecret { - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "organizationId", skip_serializing_if = "Option::is_none")] - pub organization_id: Option, - #[serde(rename = "key", skip_serializing_if = "Option::is_none")] - pub key: Option, - #[serde(rename = "creationDate", skip_serializing_if = "Option::is_none")] - pub creation_date: Option, - #[serde(rename = "revisionDate", skip_serializing_if = "Option::is_none")] - pub revision_date: Option, - #[serde(rename = "projects", skip_serializing_if = "Option::is_none")] - pub projects: Option>, - #[serde(rename = "read", skip_serializing_if = "Option::is_none")] - pub read: Option, - #[serde(rename = "write", skip_serializing_if = "Option::is_none")] - pub write: Option, -} - -impl InnerSecret { - pub fn new() -> InnerSecret { - InnerSecret { - id: None, - organization_id: None, - key: None, - creation_date: None, - revision_date: None, - projects: None, - read: None, - write: None, - } - } -} diff --git a/crates/bitwarden-api-api/src/models/inner_secret_export_response_model.rs b/crates/bitwarden-api-api/src/models/inner_secret_export_response_model.rs index d735029b9..7a55ad679 100644 --- a/crates/bitwarden-api-api/src/models/inner_secret_export_response_model.rs +++ b/crates/bitwarden-api-api/src/models/inner_secret_export_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InnerSecretExportResponseModel { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/crates/bitwarden-api-api/src/models/inner_secret_import_request_model.rs b/crates/bitwarden-api-api/src/models/inner_secret_import_request_model.rs index 594f14cce..bfe164eff 100644 --- a/crates/bitwarden-api-api/src/models/inner_secret_import_request_model.rs +++ b/crates/bitwarden-api-api/src/models/inner_secret_import_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InnerSecretImportRequestModel { #[serde(rename = "id")] pub id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/models/installation_request_model.rs b/crates/bitwarden-api-api/src/models/installation_request_model.rs index a8abba2d6..58b8924ef 100644 --- a/crates/bitwarden-api-api/src/models/installation_request_model.rs +++ b/crates/bitwarden-api-api/src/models/installation_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InstallationRequestModel { #[serde(rename = "email")] pub email: String, diff --git a/crates/bitwarden-api-api/src/models/installation_response_model.rs b/crates/bitwarden-api-api/src/models/installation_response_model.rs index 4fd14dce8..0d7009ff1 100644 --- a/crates/bitwarden-api-api/src/models/installation_response_model.rs +++ b/crates/bitwarden-api-api/src/models/installation_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct InstallationResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/int32_int32_key_value_pair.rs b/crates/bitwarden-api-api/src/models/int32_int32_key_value_pair.rs index 3ca10d2b3..831f0e03a 100644 --- a/crates/bitwarden-api-api/src/models/int32_int32_key_value_pair.rs +++ b/crates/bitwarden-api-api/src/models/int32_int32_key_value_pair.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Int32Int32KeyValuePair { #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, diff --git a/crates/bitwarden-api-api/src/models/kdf_request_model.rs b/crates/bitwarden-api-api/src/models/kdf_request_model.rs index bb903a84f..2f43e2f45 100644 --- a/crates/bitwarden-api-api/src/models/kdf_request_model.rs +++ b/crates/bitwarden-api-api/src/models/kdf_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct KdfRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/kdf_type.rs b/crates/bitwarden-api-api/src/models/kdf_type.rs index 83b611680..e371ee156 100644 --- a/crates/bitwarden-api-api/src/models/kdf_type.rs +++ b/crates/bitwarden-api-api/src/models/kdf_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum KdfType { - Variant0 = 0, - Variant1 = 1, + PBKDF2_SHA256 = 0, + Argon2id = 1, } impl ToString for KdfType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::PBKDF2_SHA256 => String::from("0"), + Self::Argon2id => String::from("1"), } } } impl Default for KdfType { fn default() -> KdfType { - Self::Variant0 + Self::PBKDF2_SHA256 } } diff --git a/crates/bitwarden-api-api/src/models/key_model.rs b/crates/bitwarden-api-api/src/models/key_model.rs index 20aa497de..78231697b 100644 --- a/crates/bitwarden-api-api/src/models/key_model.rs +++ b/crates/bitwarden-api-api/src/models/key_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct KeyModel { #[serde(rename = "name", skip_serializing_if = "Option::is_none")] pub name: Option, diff --git a/crates/bitwarden-api-api/src/models/keys_request_model.rs b/crates/bitwarden-api-api/src/models/keys_request_model.rs index f1db24fc9..d87329136 100644 --- a/crates/bitwarden-api-api/src/models/keys_request_model.rs +++ b/crates/bitwarden-api-api/src/models/keys_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct KeysRequestModel { #[serde(rename = "publicKey", skip_serializing_if = "Option::is_none")] pub public_key: Option, diff --git a/crates/bitwarden-api-api/src/models/keys_response_model.rs b/crates/bitwarden-api-api/src/models/keys_response_model.rs index 82f3e8804..21b998384 100644 --- a/crates/bitwarden-api-api/src/models/keys_response_model.rs +++ b/crates/bitwarden-api-api/src/models/keys_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct KeysResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/license_type.rs b/crates/bitwarden-api-api/src/models/license_type.rs index 0f887fa79..178b3433f 100644 --- a/crates/bitwarden-api-api/src/models/license_type.rs +++ b/crates/bitwarden-api-api/src/models/license_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum LicenseType { - Variant0 = 0, - Variant1 = 1, + User = 0, + Organization = 1, } impl ToString for LicenseType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::User => String::from("0"), + Self::Organization => String::from("1"), } } } impl Default for LicenseType { fn default() -> LicenseType { - Self::Variant0 + Self::User } } diff --git a/crates/bitwarden-api-api/src/models/master_password_policy_response_model.rs b/crates/bitwarden-api-api/src/models/master_password_policy_response_model.rs index 356a61f34..b1a53bdea 100644 --- a/crates/bitwarden-api-api/src/models/master_password_policy_response_model.rs +++ b/crates/bitwarden-api-api/src/models/master_password_policy_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MasterPasswordPolicyResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/member_decryption_type.rs b/crates/bitwarden-api-api/src/models/member_decryption_type.rs index e36344a9f..dba1b793b 100644 --- a/crates/bitwarden-api-api/src/models/member_decryption_type.rs +++ b/crates/bitwarden-api-api/src/models/member_decryption_type.rs @@ -14,23 +14,23 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum MemberDecryptionType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, + MasterPassword = 0, + KeyConnector = 1, + TrustedDeviceEncryption = 2, } impl ToString for MemberDecryptionType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::MasterPassword => String::from("0"), + Self::KeyConnector => String::from("1"), + Self::TrustedDeviceEncryption => String::from("2"), } } } impl Default for MemberDecryptionType { fn default() -> MemberDecryptionType { - Self::Variant0 + Self::MasterPassword } } diff --git a/crates/bitwarden-api-api/src/models/mod.rs b/crates/bitwarden-api-api/src/models/mod.rs index db4702827..8bed9f858 100644 --- a/crates/bitwarden-api-api/src/models/mod.rs +++ b/crates/bitwarden-api-api/src/models/mod.rs @@ -14,14 +14,22 @@ pub mod access_token_response_model_list_response_model; pub use self::access_token_response_model_list_response_model::AccessTokenResponseModelListResponseModel; pub mod admin_auth_request_update_request_model; pub use self::admin_auth_request_update_request_model::AdminAuthRequestUpdateRequestModel; +pub mod algorithm; +pub use self::algorithm::Algorithm; pub mod api_key_response_model; pub use self::api_key_response_model::ApiKeyResponseModel; +pub mod assertion_options; +pub use self::assertion_options::AssertionOptions; +pub mod assertion_response; +pub use self::assertion_response::AssertionResponse; pub mod attachment_request_model; pub use self::attachment_request_model::AttachmentRequestModel; pub mod attachment_response_model; pub use self::attachment_response_model::AttachmentResponseModel; pub mod attachment_upload_data_response_model; pub use self::attachment_upload_data_response_model::AttachmentUploadDataResponseModel; +pub mod attestation_conveyance_preference; +pub use self::attestation_conveyance_preference::AttestationConveyancePreference; pub mod auth_request_create_request_model; pub use self::auth_request_create_request_model::AuthRequestCreateRequestModel; pub mod auth_request_response_model; @@ -32,10 +40,20 @@ pub mod auth_request_type; pub use self::auth_request_type::AuthRequestType; pub mod auth_request_update_request_model; pub use self::auth_request_update_request_model::AuthRequestUpdateRequestModel; +pub mod authentication_extensions_client_inputs; +pub use self::authentication_extensions_client_inputs::AuthenticationExtensionsClientInputs; pub mod authentication_extensions_client_outputs; pub use self::authentication_extensions_client_outputs::AuthenticationExtensionsClientOutputs; +pub mod authenticator_assertion_raw_response; +pub use self::authenticator_assertion_raw_response::AuthenticatorAssertionRawResponse; +pub mod authenticator_attachment; +pub use self::authenticator_attachment::AuthenticatorAttachment; pub mod authenticator_attestation_raw_response; pub use self::authenticator_attestation_raw_response::AuthenticatorAttestationRawResponse; +pub mod authenticator_selection; +pub use self::authenticator_selection::AuthenticatorSelection; +pub mod authenticator_transport; +pub use self::authenticator_transport::AuthenticatorTransport; pub mod base_access_policy_response_model; pub use self::base_access_policy_response_model::BaseAccessPolicyResponseModel; pub mod base_secret_response_model; @@ -64,8 +82,8 @@ pub mod billing_transaction; pub use self::billing_transaction::BillingTransaction; pub mod bit_pay_invoice_request_model; pub use self::bit_pay_invoice_request_model::BitPayInvoiceRequestModel; -pub mod bitwarden_product_type; -pub use self::bitwarden_product_type::BitwardenProductType; +pub mod bulk_collection_access_request_model; +pub use self::bulk_collection_access_request_model::BulkCollectionAccessRequestModel; pub mod bulk_delete_response_model; pub use self::bulk_delete_response_model::BulkDeleteResponseModel; pub mod bulk_delete_response_model_list_response_model; @@ -92,6 +110,8 @@ pub mod cipher_details_response_model; pub use self::cipher_details_response_model::CipherDetailsResponseModel; pub mod cipher_details_response_model_list_response_model; pub use self::cipher_details_response_model_list_response_model::CipherDetailsResponseModelListResponseModel; +pub mod cipher_fido2_credential_model; +pub use self::cipher_fido2_credential_model::CipherFido2CredentialModel; pub mod cipher_field_model; pub use self::cipher_field_model::CipherFieldModel; pub mod cipher_identity_model; @@ -146,6 +166,8 @@ pub mod collection_with_id_request_model; pub use self::collection_with_id_request_model::CollectionWithIdRequestModel; pub mod config_response_model; pub use self::config_response_model::ConfigResponseModel; +pub mod credential_create_options; +pub use self::credential_create_options::CredentialCreateOptions; pub mod delete_recover_request_model; pub use self::delete_recover_request_model::DeleteRecoverRequestModel; pub mod device_keys_request_model; @@ -194,6 +216,8 @@ pub mod emergency_access_update_request_model; pub use self::emergency_access_update_request_model::EmergencyAccessUpdateRequestModel; pub mod emergency_access_view_response_model; pub use self::emergency_access_view_response_model::EmergencyAccessViewResponseModel; +pub mod emergency_access_with_id_request_model; +pub use self::emergency_access_with_id_request_model::EmergencyAccessWithIdRequestModel; pub mod environment_config_response_model; pub use self::environment_config_response_model::EnvironmentConfigResponseModel; pub mod event_response_model; @@ -204,6 +228,8 @@ pub mod event_system_user; pub use self::event_system_user::EventSystemUser; pub mod event_type; pub use self::event_type::EventType; +pub mod fido2_user; +pub use self::fido2_user::Fido2User; pub mod field_type; pub use self::field_type::FieldType; pub mod file_upload_type; @@ -240,8 +266,6 @@ pub mod group_response_model; pub use self::group_response_model::GroupResponseModel; pub mod group_service_account_access_policy_response_model; pub use self::group_service_account_access_policy_response_model::GroupServiceAccountAccessPolicyResponseModel; -pub mod iap_check_request_model; -pub use self::iap_check_request_model::IapCheckRequestModel; pub mod import_ciphers_request_model; pub use self::import_ciphers_request_model::ImportCiphersRequestModel; pub mod import_organization_ciphers_request_model; @@ -290,6 +314,8 @@ pub mod organization_api_key_type; pub use self::organization_api_key_type::OrganizationApiKeyType; pub mod organization_auto_enroll_status_response_model; pub use self::organization_auto_enroll_status_response_model::OrganizationAutoEnrollStatusResponseModel; +pub mod organization_collection_management_update_request_model; +pub use self::organization_collection_management_update_request_model::OrganizationCollectionManagementUpdateRequestModel; pub mod organization_connection_request_model; pub use self::organization_connection_request_model::OrganizationConnectionRequestModel; pub mod organization_connection_response_model; @@ -318,6 +344,8 @@ pub mod organization_public_key_response_model; pub use self::organization_public_key_response_model::OrganizationPublicKeyResponseModel; pub mod organization_response_model; pub use self::organization_response_model::OrganizationResponseModel; +pub mod organization_risks_subscription_failure_response_model; +pub use self::organization_risks_subscription_failure_response_model::OrganizationRisksSubscriptionFailureResponseModel; pub mod organization_seat_request_model; pub use self::organization_seat_request_model::OrganizationSeatRequestModel; pub mod organization_sponsorship_create_request_model; @@ -394,6 +422,8 @@ pub mod other_device_keys_update_request_model; pub use self::other_device_keys_update_request_model::OtherDeviceKeysUpdateRequestModel; pub mod password_hint_request_model; pub use self::password_hint_request_model::PasswordHintRequestModel; +pub mod password_manager_plan_features_response_model; +pub use self::password_manager_plan_features_response_model::PasswordManagerPlanFeaturesResponseModel; pub mod password_request_model; pub use self::password_request_model::PasswordRequestModel; pub mod payment_method_type; @@ -406,6 +436,8 @@ pub mod pending_organization_auth_request_response_model; pub use self::pending_organization_auth_request_response_model::PendingOrganizationAuthRequestResponseModel; pub mod pending_organization_auth_request_response_model_list_response_model; pub use self::pending_organization_auth_request_response_model_list_response_model::PendingOrganizationAuthRequestResponseModelListResponseModel; +pub mod people_access_policies_request_model; +pub use self::people_access_policies_request_model::PeopleAccessPoliciesRequestModel; pub mod permissions; pub use self::permissions::Permissions; pub mod plan_response_model; @@ -448,6 +480,8 @@ pub mod project_access_policies_response_model; pub use self::project_access_policies_response_model::ProjectAccessPoliciesResponseModel; pub mod project_create_request_model; pub use self::project_create_request_model::ProjectCreateRequestModel; +pub mod project_people_access_policies_response_model; +pub use self::project_people_access_policies_response_model::ProjectPeopleAccessPoliciesResponseModel; pub mod project_response_model; pub use self::project_response_model::ProjectResponseModel; pub mod project_response_model_list_response_model; @@ -506,6 +540,12 @@ pub mod provider_user_user_details_response_model; pub use self::provider_user_user_details_response_model::ProviderUserUserDetailsResponseModel; pub mod provider_user_user_details_response_model_list_response_model; pub use self::provider_user_user_details_response_model_list_response_model::ProviderUserUserDetailsResponseModelListResponseModel; +pub mod pub_key_cred_param; +pub use self::pub_key_cred_param::PubKeyCredParam; +pub mod public_key_credential_descriptor; +pub use self::public_key_credential_descriptor::PublicKeyCredentialDescriptor; +pub mod public_key_credential_rp_entity; +pub use self::public_key_credential_rp_entity::PublicKeyCredentialRpEntity; pub mod public_key_credential_type; pub use self::public_key_credential_type::PublicKeyCredentialType; pub mod push_registration_request_model; @@ -520,6 +560,8 @@ pub mod register_request_model; pub use self::register_request_model::RegisterRequestModel; pub mod register_response_model; pub use self::register_response_model::RegisterResponseModel; +pub mod reset_password_with_org_id_request_model; +pub use self::reset_password_with_org_id_request_model::ResetPasswordWithOrgIdRequestModel; pub mod response_data; pub use self::response_data::ResponseData; pub mod revoke_access_tokens_request; @@ -544,6 +586,8 @@ pub mod secret_with_projects_inner_project; pub use self::secret_with_projects_inner_project::SecretWithProjectsInnerProject; pub mod secret_with_projects_list_response_model; pub use self::secret_with_projects_list_response_model::SecretWithProjectsListResponseModel; +pub mod secrets_manager_plan_features_response_model; +pub use self::secrets_manager_plan_features_response_model::SecretsManagerPlanFeaturesResponseModel; pub mod secrets_manager_subscribe_request_model; pub use self::secrets_manager_subscribe_request_model::SecretsManagerSubscribeRequestModel; pub mod secrets_manager_subscription_update_request_model; @@ -578,10 +622,10 @@ pub mod send_with_id_request_model; pub use self::send_with_id_request_model::SendWithIdRequestModel; pub mod server_config_response_model; pub use self::server_config_response_model::ServerConfigResponseModel; -pub mod service_account_access_policies_response_model; -pub use self::service_account_access_policies_response_model::ServiceAccountAccessPoliciesResponseModel; pub mod service_account_create_request_model; pub use self::service_account_create_request_model::ServiceAccountCreateRequestModel; +pub mod service_account_people_access_policies_response_model; +pub use self::service_account_people_access_policies_response_model::ServiceAccountPeopleAccessPoliciesResponseModel; pub mod service_account_project_access_policy_response_model; pub use self::service_account_project_access_policy_response_model::ServiceAccountProjectAccessPolicyResponseModel; pub mod service_account_project_access_policy_response_model_list_response_model; @@ -686,9 +730,25 @@ pub mod user_project_access_policy_response_model; pub use self::user_project_access_policy_response_model::UserProjectAccessPolicyResponseModel; pub mod user_service_account_access_policy_response_model; pub use self::user_service_account_access_policy_response_model::UserServiceAccountAccessPolicyResponseModel; +pub mod user_verification_requirement; +pub use self::user_verification_requirement::UserVerificationRequirement; pub mod verify_delete_recover_request_model; pub use self::verify_delete_recover_request_model::VerifyDeleteRecoverRequestModel; pub mod verify_email_request_model; pub use self::verify_email_request_model::VerifyEmailRequestModel; pub mod verify_otp_request_model; pub use self::verify_otp_request_model::VerifyOtpRequestModel; +pub mod web_authn_credential_create_options_response_model; +pub use self::web_authn_credential_create_options_response_model::WebAuthnCredentialCreateOptionsResponseModel; +pub mod web_authn_credential_response_model; +pub use self::web_authn_credential_response_model::WebAuthnCredentialResponseModel; +pub mod web_authn_credential_response_model_list_response_model; +pub use self::web_authn_credential_response_model_list_response_model::WebAuthnCredentialResponseModelListResponseModel; +pub mod web_authn_login_assertion_options_response_model; +pub use self::web_authn_login_assertion_options_response_model::WebAuthnLoginAssertionOptionsResponseModel; +pub mod web_authn_login_credential_create_request_model; +pub use self::web_authn_login_credential_create_request_model::WebAuthnLoginCredentialCreateRequestModel; +pub mod web_authn_login_credential_update_request_model; +pub use self::web_authn_login_credential_update_request_model::WebAuthnLoginCredentialUpdateRequestModel; +pub mod web_authn_prf_status; +pub use self::web_authn_prf_status::WebAuthnPrfStatus; diff --git a/crates/bitwarden-api-api/src/models/open_id_connect_redirect_behavior.rs b/crates/bitwarden-api-api/src/models/open_id_connect_redirect_behavior.rs index 73fb93eb8..792a2dd9e 100644 --- a/crates/bitwarden-api-api/src/models/open_id_connect_redirect_behavior.rs +++ b/crates/bitwarden-api-api/src/models/open_id_connect_redirect_behavior.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum OpenIdConnectRedirectBehavior { - Variant0 = 0, - Variant1 = 1, + RedirectGet = 0, + FormPost = 1, } impl ToString for OpenIdConnectRedirectBehavior { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::RedirectGet => String::from("0"), + Self::FormPost => String::from("1"), } } } impl Default for OpenIdConnectRedirectBehavior { fn default() -> OpenIdConnectRedirectBehavior { - Self::Variant0 + Self::RedirectGet } } diff --git a/crates/bitwarden-api-api/src/models/organization_api_key_information.rs b/crates/bitwarden-api-api/src/models/organization_api_key_information.rs index fceb50762..94c56de5f 100644 --- a/crates/bitwarden-api-api/src/models/organization_api_key_information.rs +++ b/crates/bitwarden-api-api/src/models/organization_api_key_information.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationApiKeyInformation { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_api_key_information_list_response_model.rs b/crates/bitwarden-api-api/src/models/organization_api_key_information_list_response_model.rs index 129ebf4b9..63b65454c 100644 --- a/crates/bitwarden-api-api/src/models/organization_api_key_information_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_api_key_information_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationApiKeyInformationListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_api_key_request_model.rs b/crates/bitwarden-api-api/src/models/organization_api_key_request_model.rs index 5466d6cb1..3af42cef6 100644 --- a/crates/bitwarden-api-api/src/models/organization_api_key_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_api_key_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationApiKeyRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_api_key_type.rs b/crates/bitwarden-api-api/src/models/organization_api_key_type.rs index 4790406e5..83f76baaa 100644 --- a/crates/bitwarden-api-api/src/models/organization_api_key_type.rs +++ b/crates/bitwarden-api-api/src/models/organization_api_key_type.rs @@ -14,23 +14,23 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum OrganizationApiKeyType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, + Default = 0, + BillingSync = 1, + Scim = 2, } impl ToString for OrganizationApiKeyType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::Default => String::from("0"), + Self::BillingSync => String::from("1"), + Self::Scim => String::from("2"), } } } impl Default for OrganizationApiKeyType { fn default() -> OrganizationApiKeyType { - Self::Variant0 + Self::Default } } diff --git a/crates/bitwarden-api-api/src/models/organization_auto_enroll_status_response_model.rs b/crates/bitwarden-api-api/src/models/organization_auto_enroll_status_response_model.rs index c652f55fc..e068219ee 100644 --- a/crates/bitwarden-api-api/src/models/organization_auto_enroll_status_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_auto_enroll_status_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationAutoEnrollStatusResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_collection_management_update_request_model.rs b/crates/bitwarden-api-api/src/models/organization_collection_management_update_request_model.rs new file mode 100644 index 000000000..ce5d52f6d --- /dev/null +++ b/crates/bitwarden-api-api/src/models/organization_collection_management_update_request_model.rs @@ -0,0 +1,32 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OrganizationCollectionManagementUpdateRequestModel { + #[serde( + rename = "limitCreateDeleteOwnerAdmin", + skip_serializing_if = "Option::is_none" + )] + pub limit_create_delete_owner_admin: Option, + #[serde( + rename = "allowAdminAccessToAllCollectionItems", + skip_serializing_if = "Option::is_none" + )] + pub allow_admin_access_to_all_collection_items: Option, +} + +impl OrganizationCollectionManagementUpdateRequestModel { + pub fn new() -> OrganizationCollectionManagementUpdateRequestModel { + OrganizationCollectionManagementUpdateRequestModel { + limit_create_delete_owner_admin: None, + allow_admin_access_to_all_collection_items: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/organization_connection_request_model.rs b/crates/bitwarden-api-api/src/models/organization_connection_request_model.rs index 3105b2b3e..d201c54b2 100644 --- a/crates/bitwarden-api-api/src/models/organization_connection_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_connection_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationConnectionRequestModel { #[serde(rename = "type", skip_serializing_if = "Option::is_none")] pub r#type: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_connection_response_model.rs b/crates/bitwarden-api-api/src/models/organization_connection_response_model.rs index beb31068f..88ccf278c 100644 --- a/crates/bitwarden-api-api/src/models/organization_connection_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_connection_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationConnectionResponseModel { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_connection_type.rs b/crates/bitwarden-api-api/src/models/organization_connection_type.rs index eddf5460c..201c03ed2 100644 --- a/crates/bitwarden-api-api/src/models/organization_connection_type.rs +++ b/crates/bitwarden-api-api/src/models/organization_connection_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum OrganizationConnectionType { - Variant1 = 1, - Variant2 = 2, + CloudBillingSync = 1, + Scim = 2, } impl ToString for OrganizationConnectionType { fn to_string(&self) -> String { match self { - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::CloudBillingSync => String::from("1"), + Self::Scim => String::from("2"), } } } impl Default for OrganizationConnectionType { fn default() -> OrganizationConnectionType { - Self::Variant1 + Self::CloudBillingSync } } diff --git a/crates/bitwarden-api-api/src/models/organization_create_request_model.rs b/crates/bitwarden-api-api/src/models/organization_create_request_model.rs index 493737ccf..8c00b6888 100644 --- a/crates/bitwarden-api-api/src/models/organization_create_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_create_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationCreateRequestModel { #[serde(rename = "name")] pub name: String, @@ -77,6 +77,11 @@ pub struct OrganizationCreateRequestModel { pub additional_service_accounts: Option, #[serde(rename = "useSecretsManager")] pub use_secrets_manager: bool, + #[serde( + rename = "isFromSecretsManagerTrial", + skip_serializing_if = "Option::is_none" + )] + pub is_from_secrets_manager_trial: Option, } impl OrganizationCreateRequestModel { @@ -110,6 +115,7 @@ impl OrganizationCreateRequestModel { additional_sm_seats: None, additional_service_accounts: None, use_secrets_manager, + is_from_secrets_manager_trial: None, } } } diff --git a/crates/bitwarden-api-api/src/models/organization_domain_request_model.rs b/crates/bitwarden-api-api/src/models/organization_domain_request_model.rs index e17cfd936..b1dbe8395 100644 --- a/crates/bitwarden-api-api/src/models/organization_domain_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_domain_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationDomainRequestModel { #[serde(rename = "txt")] pub txt: String, diff --git a/crates/bitwarden-api-api/src/models/organization_domain_response_model.rs b/crates/bitwarden-api-api/src/models/organization_domain_response_model.rs index 919a18ffa..524a00f93 100644 --- a/crates/bitwarden-api-api/src/models/organization_domain_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_domain_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationDomainResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_domain_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/organization_domain_response_model_list_response_model.rs index 46db2791b..49224feb3 100644 --- a/crates/bitwarden-api-api/src/models/organization_domain_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_domain_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationDomainResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_domain_sso_details_request_model.rs b/crates/bitwarden-api-api/src/models/organization_domain_sso_details_request_model.rs index abef29d1e..a731af833 100644 --- a/crates/bitwarden-api-api/src/models/organization_domain_sso_details_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_domain_sso_details_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationDomainSsoDetailsRequestModel { #[serde(rename = "email")] pub email: String, diff --git a/crates/bitwarden-api-api/src/models/organization_domain_sso_details_response_model.rs b/crates/bitwarden-api-api/src/models/organization_domain_sso_details_response_model.rs index f9ce9db71..c409df706 100644 --- a/crates/bitwarden-api-api/src/models/organization_domain_sso_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_domain_sso_details_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationDomainSsoDetailsResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_enroll_secrets_manager_request_model.rs b/crates/bitwarden-api-api/src/models/organization_enroll_secrets_manager_request_model.rs deleted file mode 100644 index 16c34a3c5..000000000 --- a/crates/bitwarden-api-api/src/models/organization_enroll_secrets_manager_request_model.rs +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Bitwarden Internal API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: latest - * - * Generated by: https://openapi-generator.tech - */ - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct OrganizationEnrollSecretsManagerRequestModel { - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, -} - -impl OrganizationEnrollSecretsManagerRequestModel { - pub fn new() -> OrganizationEnrollSecretsManagerRequestModel { - OrganizationEnrollSecretsManagerRequestModel { enabled: None } - } -} diff --git a/crates/bitwarden-api-api/src/models/organization_keys_request_model.rs b/crates/bitwarden-api-api/src/models/organization_keys_request_model.rs index 3750a4e05..eccd5f5b3 100644 --- a/crates/bitwarden-api-api/src/models/organization_keys_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_keys_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationKeysRequestModel { #[serde(rename = "publicKey")] pub public_key: String, diff --git a/crates/bitwarden-api-api/src/models/organization_keys_response_model.rs b/crates/bitwarden-api-api/src/models/organization_keys_response_model.rs index b8bb486fb..6992abccb 100644 --- a/crates/bitwarden-api-api/src/models/organization_keys_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_keys_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationKeysResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_license.rs b/crates/bitwarden-api-api/src/models/organization_license.rs index b440b8e00..2497f073e 100644 --- a/crates/bitwarden-api-api/src/models/organization_license.rs +++ b/crates/bitwarden-api-api/src/models/organization_license.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationLicense { #[serde(rename = "licenseKey", skip_serializing_if = "Option::is_none")] pub license_key: Option, @@ -78,6 +78,24 @@ pub struct OrganizationLicense { skip_serializing_if = "Option::is_none" )] pub expiration_without_grace_period: Option, + #[serde(rename = "usePasswordManager", skip_serializing_if = "Option::is_none")] + pub use_password_manager: Option, + #[serde(rename = "useSecretsManager", skip_serializing_if = "Option::is_none")] + pub use_secrets_manager: Option, + #[serde(rename = "smSeats", skip_serializing_if = "Option::is_none")] + pub sm_seats: Option, + #[serde(rename = "smServiceAccounts", skip_serializing_if = "Option::is_none")] + pub sm_service_accounts: Option, + #[serde( + rename = "limitCollectionCreationDeletion", + skip_serializing_if = "Option::is_none" + )] + pub limit_collection_creation_deletion: Option, + #[serde( + rename = "allowAdminAccessToAllCollectionItems", + skip_serializing_if = "Option::is_none" + )] + pub allow_admin_access_to_all_collection_items: Option, #[serde(rename = "trial", skip_serializing_if = "Option::is_none")] pub trial: Option, #[serde(rename = "licenseType", skip_serializing_if = "Option::is_none")] @@ -122,6 +140,12 @@ impl OrganizationLicense { refresh: None, expires: None, expiration_without_grace_period: None, + use_password_manager: None, + use_secrets_manager: None, + sm_seats: None, + sm_service_accounts: None, + limit_collection_creation_deletion: None, + allow_admin_access_to_all_collection_items: None, trial: None, license_type: None, hash: None, diff --git a/crates/bitwarden-api-api/src/models/organization_public_key_response_model.rs b/crates/bitwarden-api-api/src/models/organization_public_key_response_model.rs index c5849d3e6..aca53523a 100644 --- a/crates/bitwarden-api-api/src/models/organization_public_key_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_public_key_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationPublicKeyResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_response_model.rs b/crates/bitwarden-api-api/src/models/organization_response_model.rs index 6618b1f79..e5c877fb0 100644 --- a/crates/bitwarden-api-api/src/models/organization_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, @@ -98,6 +98,21 @@ pub struct OrganizationResponseModel { skip_serializing_if = "Option::is_none" )] pub max_autoscale_sm_service_accounts: Option, + #[serde( + rename = "limitCollectionCreationDeletion", + skip_serializing_if = "Option::is_none" + )] + pub limit_collection_creation_deletion: Option, + #[serde( + rename = "allowAdminAccessToAllCollectionItems", + skip_serializing_if = "Option::is_none" + )] + pub allow_admin_access_to_all_collection_items: Option, + #[serde( + rename = "flexibleCollections", + skip_serializing_if = "Option::is_none" + )] + pub flexible_collections: Option, } impl OrganizationResponseModel { @@ -141,6 +156,9 @@ impl OrganizationResponseModel { sm_service_accounts: None, max_autoscale_sm_seats: None, max_autoscale_sm_service_accounts: None, + limit_collection_creation_deletion: None, + allow_admin_access_to_all_collection_items: None, + flexible_collections: None, } } } diff --git a/crates/bitwarden-api-api/src/models/organization_risks_subscription_failure_response_model.rs b/crates/bitwarden-api-api/src/models/organization_risks_subscription_failure_response_model.rs new file mode 100644 index 000000000..4e138cd85 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/organization_risks_subscription_failure_response_model.rs @@ -0,0 +1,32 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct OrganizationRisksSubscriptionFailureResponseModel { + #[serde(rename = "object", skip_serializing_if = "Option::is_none")] + pub object: Option, + #[serde(rename = "organizationId", skip_serializing_if = "Option::is_none")] + pub organization_id: Option, + #[serde( + rename = "risksSubscriptionFailure", + skip_serializing_if = "Option::is_none" + )] + pub risks_subscription_failure: Option, +} + +impl OrganizationRisksSubscriptionFailureResponseModel { + pub fn new() -> OrganizationRisksSubscriptionFailureResponseModel { + OrganizationRisksSubscriptionFailureResponseModel { + object: None, + organization_id: None, + risks_subscription_failure: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/organization_seat_request_model.rs b/crates/bitwarden-api-api/src/models/organization_seat_request_model.rs index e822b9f82..58f815f4b 100644 --- a/crates/bitwarden-api-api/src/models/organization_seat_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_seat_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationSeatRequestModel { #[serde(rename = "seatAdjustment")] pub seat_adjustment: i32, diff --git a/crates/bitwarden-api-api/src/models/organization_sponsorship_create_request_model.rs b/crates/bitwarden-api-api/src/models/organization_sponsorship_create_request_model.rs index f823b56fe..dbd33d616 100644 --- a/crates/bitwarden-api-api/src/models/organization_sponsorship_create_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_sponsorship_create_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationSponsorshipCreateRequestModel { #[serde(rename = "planSponsorshipType")] pub plan_sponsorship_type: crate::models::PlanSponsorshipType, diff --git a/crates/bitwarden-api-api/src/models/organization_sponsorship_redeem_request_model.rs b/crates/bitwarden-api-api/src/models/organization_sponsorship_redeem_request_model.rs index b978ff27c..08a3f3741 100644 --- a/crates/bitwarden-api-api/src/models/organization_sponsorship_redeem_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_sponsorship_redeem_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationSponsorshipRedeemRequestModel { #[serde(rename = "planSponsorshipType")] pub plan_sponsorship_type: crate::models::PlanSponsorshipType, diff --git a/crates/bitwarden-api-api/src/models/organization_sponsorship_request_model.rs b/crates/bitwarden-api-api/src/models/organization_sponsorship_request_model.rs index 94cd9a088..247e8f3ea 100644 --- a/crates/bitwarden-api-api/src/models/organization_sponsorship_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_sponsorship_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationSponsorshipRequestModel { #[serde( rename = "sponsoringOrganizationUserId", diff --git a/crates/bitwarden-api-api/src/models/organization_sponsorship_response_model.rs b/crates/bitwarden-api-api/src/models/organization_sponsorship_response_model.rs index 5798d3500..21f90016a 100644 --- a/crates/bitwarden-api-api/src/models/organization_sponsorship_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_sponsorship_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationSponsorshipResponseModel { #[serde( rename = "sponsoringOrganizationUserId", diff --git a/crates/bitwarden-api-api/src/models/organization_sponsorship_sync_request_model.rs b/crates/bitwarden-api-api/src/models/organization_sponsorship_sync_request_model.rs index cfffe3ec3..3aca9f7fc 100644 --- a/crates/bitwarden-api-api/src/models/organization_sponsorship_sync_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_sponsorship_sync_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationSponsorshipSyncRequestModel { #[serde(rename = "billingSyncKey", skip_serializing_if = "Option::is_none")] pub billing_sync_key: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_sponsorship_sync_response_model.rs b/crates/bitwarden-api-api/src/models/organization_sponsorship_sync_response_model.rs index 0d2b71f74..e3630d1ee 100644 --- a/crates/bitwarden-api-api/src/models/organization_sponsorship_sync_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_sponsorship_sync_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationSponsorshipSyncResponseModel { #[serde(rename = "sponsorshipsBatch", skip_serializing_if = "Option::is_none")] pub sponsorships_batch: Option>, diff --git a/crates/bitwarden-api-api/src/models/organization_sso_request_model.rs b/crates/bitwarden-api-api/src/models/organization_sso_request_model.rs index 1accd7a2e..4818e8e5d 100644 --- a/crates/bitwarden-api-api/src/models/organization_sso_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_sso_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationSsoRequestModel { #[serde(rename = "enabled")] pub enabled: bool, diff --git a/crates/bitwarden-api-api/src/models/organization_sso_response_model.rs b/crates/bitwarden-api-api/src/models/organization_sso_response_model.rs index 9a1676049..d0d73e4b0 100644 --- a/crates/bitwarden-api-api/src/models/organization_sso_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_sso_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationSsoResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_subscription_response_model.rs b/crates/bitwarden-api-api/src/models/organization_subscription_response_model.rs index b08184d43..1bbfc630f 100644 --- a/crates/bitwarden-api-api/src/models/organization_subscription_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_subscription_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationSubscriptionResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, @@ -98,12 +98,27 @@ pub struct OrganizationSubscriptionResponseModel { skip_serializing_if = "Option::is_none" )] pub max_autoscale_sm_service_accounts: Option, + #[serde( + rename = "limitCollectionCreationDeletion", + skip_serializing_if = "Option::is_none" + )] + pub limit_collection_creation_deletion: Option, + #[serde( + rename = "allowAdminAccessToAllCollectionItems", + skip_serializing_if = "Option::is_none" + )] + pub allow_admin_access_to_all_collection_items: Option, + #[serde( + rename = "flexibleCollections", + skip_serializing_if = "Option::is_none" + )] + pub flexible_collections: Option, #[serde(rename = "storageName", skip_serializing_if = "Option::is_none")] pub storage_name: Option, #[serde(rename = "storageGb", skip_serializing_if = "Option::is_none")] pub storage_gb: Option, - #[serde(rename = "discount", skip_serializing_if = "Option::is_none")] - pub discount: Option>, + #[serde(rename = "customerDiscount", skip_serializing_if = "Option::is_none")] + pub customer_discount: Option>, #[serde(rename = "subscription", skip_serializing_if = "Option::is_none")] pub subscription: Option>, #[serde(rename = "upcomingInvoice", skip_serializing_if = "Option::is_none")] @@ -117,8 +132,6 @@ pub struct OrganizationSubscriptionResponseModel { /// Date when a self-hosted organization expires (includes grace period). #[serde(rename = "expiration", skip_serializing_if = "Option::is_none")] pub expiration: Option, - #[serde(rename = "secretsManagerBeta", skip_serializing_if = "Option::is_none")] - pub secrets_manager_beta: Option, } impl OrganizationSubscriptionResponseModel { @@ -162,14 +175,16 @@ impl OrganizationSubscriptionResponseModel { sm_service_accounts: None, max_autoscale_sm_seats: None, max_autoscale_sm_service_accounts: None, + limit_collection_creation_deletion: None, + allow_admin_access_to_all_collection_items: None, + flexible_collections: None, storage_name: None, storage_gb: None, - discount: None, + customer_discount: None, subscription: None, upcoming_invoice: None, expiration_without_grace_period: None, expiration: None, - secrets_manager_beta: None, } } } diff --git a/crates/bitwarden-api-api/src/models/organization_subscription_update_request_model.rs b/crates/bitwarden-api-api/src/models/organization_subscription_update_request_model.rs index 9c919c759..d85f8d56a 100644 --- a/crates/bitwarden-api-api/src/models/organization_subscription_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_subscription_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationSubscriptionUpdateRequestModel { #[serde(rename = "seatAdjustment")] pub seat_adjustment: i32, diff --git a/crates/bitwarden-api-api/src/models/organization_tax_info_update_request_model.rs b/crates/bitwarden-api-api/src/models/organization_tax_info_update_request_model.rs index c6356037c..76a106b16 100644 --- a/crates/bitwarden-api-api/src/models/organization_tax_info_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_tax_info_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationTaxInfoUpdateRequestModel { #[serde(rename = "country")] pub country: String, diff --git a/crates/bitwarden-api-api/src/models/organization_update_request_model.rs b/crates/bitwarden-api-api/src/models/organization_update_request_model.rs index f4603d6a0..ede9d668a 100644 --- a/crates/bitwarden-api-api/src/models/organization_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUpdateRequestModel { #[serde(rename = "name")] pub name: String, diff --git a/crates/bitwarden-api-api/src/models/organization_upgrade_request_model.rs b/crates/bitwarden-api-api/src/models/organization_upgrade_request_model.rs index 23f605dab..45bc99dd7 100644 --- a/crates/bitwarden-api-api/src/models/organization_upgrade_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_upgrade_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUpgradeRequestModel { #[serde(rename = "businessName", skip_serializing_if = "Option::is_none")] pub business_name: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_user_accept_init_request_model.rs b/crates/bitwarden-api-api/src/models/organization_user_accept_init_request_model.rs index 3ef9d7ced..ab4f7f0ff 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_accept_init_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_accept_init_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserAcceptInitRequestModel { #[serde(rename = "token")] pub token: String, diff --git a/crates/bitwarden-api-api/src/models/organization_user_accept_request_model.rs b/crates/bitwarden-api-api/src/models/organization_user_accept_request_model.rs index b46fc5851..62732f1d3 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_accept_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_accept_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserAcceptRequestModel { #[serde(rename = "token")] pub token: String, diff --git a/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model.rs b/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model.rs index 7530bb3a7..468d654a3 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserBulkConfirmRequestModel { #[serde(rename = "keys")] pub keys: Vec, diff --git a/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model_entry.rs b/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model_entry.rs index a349578fa..f3ccb5e08 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model_entry.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model_entry.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserBulkConfirmRequestModelEntry { #[serde(rename = "id")] pub id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/models/organization_user_bulk_request_model.rs b/crates/bitwarden-api-api/src/models/organization_user_bulk_request_model.rs index 14fdaa561..6f973f960 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_bulk_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_bulk_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserBulkRequestModel { #[serde(rename = "ids")] pub ids: Vec, diff --git a/crates/bitwarden-api-api/src/models/organization_user_bulk_response_model.rs b/crates/bitwarden-api-api/src/models/organization_user_bulk_response_model.rs index ba66e6f1f..f84f1509d 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_bulk_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_bulk_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserBulkResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_user_bulk_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/organization_user_bulk_response_model_list_response_model.rs index 5adc0087e..0be2de9a1 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_bulk_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_bulk_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserBulkResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_user_confirm_request_model.rs b/crates/bitwarden-api-api/src/models/organization_user_confirm_request_model.rs index f5abe9011..e6a00ae6b 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_confirm_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_confirm_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserConfirmRequestModel { #[serde(rename = "key")] pub key: String, diff --git a/crates/bitwarden-api-api/src/models/organization_user_details_response_model.rs b/crates/bitwarden-api-api/src/models/organization_user_details_response_model.rs index 179bb4a54..5fe8caf42 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_details_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserDetailsResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_user_invite_request_model.rs b/crates/bitwarden-api-api/src/models/organization_user_invite_request_model.rs index 68de06fe1..0cf5c3429 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_invite_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_invite_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserInviteRequestModel { #[serde(rename = "emails")] pub emails: Vec, diff --git a/crates/bitwarden-api-api/src/models/organization_user_public_key_response_model.rs b/crates/bitwarden-api-api/src/models/organization_user_public_key_response_model.rs index b3dbf5991..5bb053f81 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_public_key_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_public_key_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserPublicKeyResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_user_public_key_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/organization_user_public_key_response_model_list_response_model.rs index d6de32d79..ae59cc365 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_public_key_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_public_key_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserPublicKeyResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_user_reset_password_details_response_model.rs b/crates/bitwarden-api-api/src/models/organization_user_reset_password_details_response_model.rs index 0dbd87182..07343bf5b 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_reset_password_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_reset_password_details_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserResetPasswordDetailsResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_user_reset_password_enrollment_request_model.rs b/crates/bitwarden-api-api/src/models/organization_user_reset_password_enrollment_request_model.rs index 7287c58a3..c11fcda48 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_reset_password_enrollment_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_reset_password_enrollment_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserResetPasswordEnrollmentRequestModel { #[serde(rename = "resetPasswordKey", skip_serializing_if = "Option::is_none")] pub reset_password_key: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_user_reset_password_request_model.rs b/crates/bitwarden-api-api/src/models/organization_user_reset_password_request_model.rs index 210aa2ec9..001086531 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_reset_password_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_reset_password_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserResetPasswordRequestModel { #[serde(rename = "newMasterPasswordHash")] pub new_master_password_hash: String, diff --git a/crates/bitwarden-api-api/src/models/organization_user_status_type.rs b/crates/bitwarden-api-api/src/models/organization_user_status_type.rs index 7486cab57..5d3c99199 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_status_type.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_status_type.rs @@ -14,25 +14,25 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum OrganizationUserStatusType { - _0 = 0, - _1 = 1, - _2 = 2, - __1 = -1, + Invited = 0, + Accepted = 1, + Confirmed = 2, + Revoked = -1, } impl ToString for OrganizationUserStatusType { fn to_string(&self) -> String { match self { - Self::_0 => String::from("0"), - Self::_1 => String::from("1"), - Self::_2 => String::from("2"), - Self::__1 => String::from("-1"), + Self::Invited => String::from("0"), + Self::Accepted => String::from("1"), + Self::Confirmed => String::from("2"), + Self::Revoked => String::from("-1"), } } } impl Default for OrganizationUserStatusType { fn default() -> OrganizationUserStatusType { - Self::_0 + Self::Invited } } diff --git a/crates/bitwarden-api-api/src/models/organization_user_type.rs b/crates/bitwarden-api-api/src/models/organization_user_type.rs index e3642946d..38e415f05 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_type.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_type.rs @@ -14,27 +14,27 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum OrganizationUserType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, + Owner = 0, + Admin = 1, + User = 2, + Manager = 3, + Custom = 4, } impl ToString for OrganizationUserType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), + Self::Owner => String::from("0"), + Self::Admin => String::from("1"), + Self::User => String::from("2"), + Self::Manager => String::from("3"), + Self::Custom => String::from("4"), } } } impl Default for OrganizationUserType { fn default() -> OrganizationUserType { - Self::Variant0 + Self::Owner } } diff --git a/crates/bitwarden-api-api/src/models/organization_user_update_groups_request_model.rs b/crates/bitwarden-api-api/src/models/organization_user_update_groups_request_model.rs index 38c9dafe7..c9b636fc9 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_update_groups_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_update_groups_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserUpdateGroupsRequestModel { #[serde(rename = "groupIds")] pub group_ids: Vec, diff --git a/crates/bitwarden-api-api/src/models/organization_user_update_request_model.rs b/crates/bitwarden-api-api/src/models/organization_user_update_request_model.rs index 1d83589ee..54b479dd6 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserUpdateRequestModel { #[serde(rename = "type")] pub r#type: crate::models::OrganizationUserType, diff --git a/crates/bitwarden-api-api/src/models/organization_user_user_details_response_model.rs b/crates/bitwarden-api-api/src/models/organization_user_user_details_response_model.rs index 96d06ff30..add9e86e4 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_user_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_user_details_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserUserDetailsResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_user_user_details_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/organization_user_user_details_response_model_list_response_model.rs index f0975fc2d..e3feac1db 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_user_details_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_user_details_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationUserUserDetailsResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/organization_verify_bank_request_model.rs b/crates/bitwarden-api-api/src/models/organization_verify_bank_request_model.rs index f46a657a0..e19bdb89d 100644 --- a/crates/bitwarden-api-api/src/models/organization_verify_bank_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_verify_bank_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OrganizationVerifyBankRequestModel { #[serde(rename = "amount1")] pub amount1: i32, diff --git a/crates/bitwarden-api-api/src/models/other_device_keys_update_request_model.rs b/crates/bitwarden-api-api/src/models/other_device_keys_update_request_model.rs index c163a4343..d7454c7cf 100644 --- a/crates/bitwarden-api-api/src/models/other_device_keys_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/other_device_keys_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct OtherDeviceKeysUpdateRequestModel { #[serde(rename = "encryptedPublicKey")] pub encrypted_public_key: String, diff --git a/crates/bitwarden-api-api/src/models/password_hint_request_model.rs b/crates/bitwarden-api-api/src/models/password_hint_request_model.rs index 6e4692bf2..8704c6fe1 100644 --- a/crates/bitwarden-api-api/src/models/password_hint_request_model.rs +++ b/crates/bitwarden-api-api/src/models/password_hint_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PasswordHintRequestModel { #[serde(rename = "email")] pub email: String, diff --git a/crates/bitwarden-api-api/src/models/password_manager_plan_features_response_model.rs b/crates/bitwarden-api-api/src/models/password_manager_plan_features_response_model.rs new file mode 100644 index 000000000..91fa49b6a --- /dev/null +++ b/crates/bitwarden-api-api/src/models/password_manager_plan_features_response_model.rs @@ -0,0 +1,98 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PasswordManagerPlanFeaturesResponseModel { + #[serde(rename = "stripePlanId", skip_serializing_if = "Option::is_none")] + pub stripe_plan_id: Option, + #[serde(rename = "stripeSeatPlanId", skip_serializing_if = "Option::is_none")] + pub stripe_seat_plan_id: Option, + #[serde(rename = "basePrice", skip_serializing_if = "Option::is_none")] + pub base_price: Option, + #[serde(rename = "seatPrice", skip_serializing_if = "Option::is_none")] + pub seat_price: Option, + #[serde(rename = "allowSeatAutoscale", skip_serializing_if = "Option::is_none")] + pub allow_seat_autoscale: Option, + #[serde( + rename = "hasAdditionalSeatsOption", + skip_serializing_if = "Option::is_none" + )] + pub has_additional_seats_option: Option, + #[serde(rename = "maxAdditionalSeats", skip_serializing_if = "Option::is_none")] + pub max_additional_seats: Option, + #[serde(rename = "baseSeats", skip_serializing_if = "Option::is_none")] + pub base_seats: Option, + #[serde( + rename = "hasPremiumAccessOption", + skip_serializing_if = "Option::is_none" + )] + pub has_premium_access_option: Option, + #[serde( + rename = "stripePremiumAccessPlanId", + skip_serializing_if = "Option::is_none" + )] + pub stripe_premium_access_plan_id: Option, + #[serde( + rename = "premiumAccessOptionPrice", + skip_serializing_if = "Option::is_none" + )] + pub premium_access_option_price: Option, + #[serde(rename = "maxSeats", skip_serializing_if = "Option::is_none")] + pub max_seats: Option, + #[serde(rename = "baseStorageGb", skip_serializing_if = "Option::is_none")] + pub base_storage_gb: Option, + #[serde( + rename = "hasAdditionalStorageOption", + skip_serializing_if = "Option::is_none" + )] + pub has_additional_storage_option: Option, + #[serde( + rename = "additionalStoragePricePerGb", + skip_serializing_if = "Option::is_none" + )] + pub additional_storage_price_per_gb: Option, + #[serde( + rename = "stripeStoragePlanId", + skip_serializing_if = "Option::is_none" + )] + pub stripe_storage_plan_id: Option, + #[serde( + rename = "maxAdditionalStorage", + skip_serializing_if = "Option::is_none" + )] + pub max_additional_storage: Option, + #[serde(rename = "maxCollections", skip_serializing_if = "Option::is_none")] + pub max_collections: Option, +} + +impl PasswordManagerPlanFeaturesResponseModel { + pub fn new() -> PasswordManagerPlanFeaturesResponseModel { + PasswordManagerPlanFeaturesResponseModel { + stripe_plan_id: None, + stripe_seat_plan_id: None, + base_price: None, + seat_price: None, + allow_seat_autoscale: None, + has_additional_seats_option: None, + max_additional_seats: None, + base_seats: None, + has_premium_access_option: None, + stripe_premium_access_plan_id: None, + premium_access_option_price: None, + max_seats: None, + base_storage_gb: None, + has_additional_storage_option: None, + additional_storage_price_per_gb: None, + stripe_storage_plan_id: None, + max_additional_storage: None, + max_collections: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/password_request_model.rs b/crates/bitwarden-api-api/src/models/password_request_model.rs index a1cac4dd2..c7fcb6e8b 100644 --- a/crates/bitwarden-api-api/src/models/password_request_model.rs +++ b/crates/bitwarden-api-api/src/models/password_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PasswordRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/payment_method_type.rs b/crates/bitwarden-api-api/src/models/payment_method_type.rs index 2b3cbd1f0..c4d6cf93c 100644 --- a/crates/bitwarden-api-api/src/models/payment_method_type.rs +++ b/crates/bitwarden-api-api/src/models/payment_method_type.rs @@ -14,37 +14,33 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum PaymentMethodType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant6 = 6, - Variant7 = 7, - Variant8 = 8, - Variant255 = 255, + Card = 0, + BankAccount = 1, + PayPal = 2, + BitPay = 3, + Credit = 4, + WireTransfer = 5, + Check = 8, + None = 255, } impl ToString for PaymentMethodType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant6 => String::from("6"), - Self::Variant7 => String::from("7"), - Self::Variant8 => String::from("8"), - Self::Variant255 => String::from("255"), + Self::Card => String::from("0"), + Self::BankAccount => String::from("1"), + Self::PayPal => String::from("2"), + Self::BitPay => String::from("3"), + Self::Credit => String::from("4"), + Self::WireTransfer => String::from("5"), + Self::Check => String::from("8"), + Self::None => String::from("255"), } } } impl Default for PaymentMethodType { fn default() -> PaymentMethodType { - Self::Variant0 + Self::Card } } diff --git a/crates/bitwarden-api-api/src/models/payment_request_model.rs b/crates/bitwarden-api-api/src/models/payment_request_model.rs index 08cb166cf..00e07ff11 100644 --- a/crates/bitwarden-api-api/src/models/payment_request_model.rs +++ b/crates/bitwarden-api-api/src/models/payment_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PaymentRequestModel { #[serde(rename = "country")] pub country: String, diff --git a/crates/bitwarden-api-api/src/models/payment_response_model.rs b/crates/bitwarden-api-api/src/models/payment_response_model.rs index 696b5ad10..2eddb498f 100644 --- a/crates/bitwarden-api-api/src/models/payment_response_model.rs +++ b/crates/bitwarden-api-api/src/models/payment_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PaymentResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/pending_organization_auth_request_response_model.rs b/crates/bitwarden-api-api/src/models/pending_organization_auth_request_response_model.rs index fafb94836..5a0bc7bcb 100644 --- a/crates/bitwarden-api-api/src/models/pending_organization_auth_request_response_model.rs +++ b/crates/bitwarden-api-api/src/models/pending_organization_auth_request_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PendingOrganizationAuthRequestResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/pending_organization_auth_request_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/pending_organization_auth_request_response_model_list_response_model.rs index 43b6a9d31..d97c8c4ba 100644 --- a/crates/bitwarden-api-api/src/models/pending_organization_auth_request_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/pending_organization_auth_request_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PendingOrganizationAuthRequestResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/people_access_policies_request_model.rs b/crates/bitwarden-api-api/src/models/people_access_policies_request_model.rs new file mode 100644 index 000000000..909ce9c30 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/people_access_policies_request_model.rs @@ -0,0 +1,32 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PeopleAccessPoliciesRequestModel { + #[serde( + rename = "userAccessPolicyRequests", + skip_serializing_if = "Option::is_none" + )] + pub user_access_policy_requests: Option>, + #[serde( + rename = "groupAccessPolicyRequests", + skip_serializing_if = "Option::is_none" + )] + pub group_access_policy_requests: Option>, +} + +impl PeopleAccessPoliciesRequestModel { + pub fn new() -> PeopleAccessPoliciesRequestModel { + PeopleAccessPoliciesRequestModel { + user_access_policy_requests: None, + group_access_policy_requests: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/permissions.rs b/crates/bitwarden-api-api/src/models/permissions.rs index d879faddc..3d3a6b7b7 100644 --- a/crates/bitwarden-api-api/src/models/permissions.rs +++ b/crates/bitwarden-api-api/src/models/permissions.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Permissions { #[serde(rename = "accessEventLogs", skip_serializing_if = "Option::is_none")] pub access_event_logs: Option, diff --git a/crates/bitwarden-api-api/src/models/plan_response_model.rs b/crates/bitwarden-api-api/src/models/plan_response_model.rs index 17dcb777b..e1e264e9a 100644 --- a/crates/bitwarden-api-api/src/models/plan_response_model.rs +++ b/crates/bitwarden-api-api/src/models/plan_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PlanResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, @@ -35,36 +35,6 @@ pub struct PlanResponseModel { skip_serializing_if = "Option::is_none" )] pub can_be_used_by_business: Option, - #[serde(rename = "baseSeats", skip_serializing_if = "Option::is_none")] - pub base_seats: Option, - #[serde(rename = "baseStorageGb", skip_serializing_if = "Option::is_none")] - pub base_storage_gb: Option, - #[serde(rename = "maxCollections", skip_serializing_if = "Option::is_none")] - pub max_collections: Option, - #[serde(rename = "maxUsers", skip_serializing_if = "Option::is_none")] - pub max_users: Option, - #[serde( - rename = "hasAdditionalSeatsOption", - skip_serializing_if = "Option::is_none" - )] - pub has_additional_seats_option: Option, - #[serde(rename = "maxAdditionalSeats", skip_serializing_if = "Option::is_none")] - pub max_additional_seats: Option, - #[serde( - rename = "hasAdditionalStorageOption", - skip_serializing_if = "Option::is_none" - )] - pub has_additional_storage_option: Option, - #[serde( - rename = "maxAdditionalStorage", - skip_serializing_if = "Option::is_none" - )] - pub max_additional_storage: Option, - #[serde( - rename = "hasPremiumAccessOption", - skip_serializing_if = "Option::is_none" - )] - pub has_premium_access_option: Option, #[serde(rename = "trialPeriodDays", skip_serializing_if = "Option::is_none")] pub trial_period_days: Option, #[serde(rename = "hasSelfHost", skip_serializing_if = "Option::is_none")] @@ -97,62 +67,10 @@ pub struct PlanResponseModel { pub legacy_year: Option, #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")] pub disabled: Option, - #[serde(rename = "stripePlanId", skip_serializing_if = "Option::is_none")] - pub stripe_plan_id: Option, - #[serde(rename = "stripeSeatPlanId", skip_serializing_if = "Option::is_none")] - pub stripe_seat_plan_id: Option, - #[serde( - rename = "stripeStoragePlanId", - skip_serializing_if = "Option::is_none" - )] - pub stripe_storage_plan_id: Option, - #[serde( - rename = "stripePremiumAccessPlanId", - skip_serializing_if = "Option::is_none" - )] - pub stripe_premium_access_plan_id: Option, - #[serde(rename = "basePrice", skip_serializing_if = "Option::is_none")] - pub base_price: Option, - #[serde(rename = "seatPrice", skip_serializing_if = "Option::is_none")] - pub seat_price: Option, - #[serde( - rename = "additionalStoragePricePerGb", - skip_serializing_if = "Option::is_none" - )] - pub additional_storage_price_per_gb: Option, - #[serde( - rename = "premiumAccessOptionPrice", - skip_serializing_if = "Option::is_none" - )] - pub premium_access_option_price: Option, - #[serde( - rename = "stripeServiceAccountPlanId", - skip_serializing_if = "Option::is_none" - )] - pub stripe_service_account_plan_id: Option, - #[serde( - rename = "additionalPricePerServiceAccount", - skip_serializing_if = "Option::is_none" - )] - pub additional_price_per_service_account: Option, - #[serde(rename = "baseServiceAccount", skip_serializing_if = "Option::is_none")] - pub base_service_account: Option, - #[serde(rename = "maxServiceAccounts", skip_serializing_if = "Option::is_none")] - pub max_service_accounts: Option, - #[serde( - rename = "maxAdditionalServiceAccounts", - skip_serializing_if = "Option::is_none" - )] - pub max_additional_service_accounts: Option, - #[serde( - rename = "hasAdditionalServiceAccountOption", - skip_serializing_if = "Option::is_none" - )] - pub has_additional_service_account_option: Option, - #[serde(rename = "maxProjects", skip_serializing_if = "Option::is_none")] - pub max_projects: Option, - #[serde(rename = "bitwardenProduct", skip_serializing_if = "Option::is_none")] - pub bitwarden_product: Option, + #[serde(rename = "secretsManager", skip_serializing_if = "Option::is_none")] + pub secrets_manager: Option>, + #[serde(rename = "passwordManager", skip_serializing_if = "Option::is_none")] + pub password_manager: Option>, } impl PlanResponseModel { @@ -166,15 +84,6 @@ impl PlanResponseModel { name_localization_key: None, description_localization_key: None, can_be_used_by_business: None, - base_seats: None, - base_storage_gb: None, - max_collections: None, - max_users: None, - has_additional_seats_option: None, - max_additional_seats: None, - has_additional_storage_option: None, - max_additional_storage: None, - has_premium_access_option: None, trial_period_days: None, has_self_host: None, has_policies: None, @@ -191,22 +100,8 @@ impl PlanResponseModel { display_sort_order: None, legacy_year: None, disabled: None, - stripe_plan_id: None, - stripe_seat_plan_id: None, - stripe_storage_plan_id: None, - stripe_premium_access_plan_id: None, - base_price: None, - seat_price: None, - additional_storage_price_per_gb: None, - premium_access_option_price: None, - stripe_service_account_plan_id: None, - additional_price_per_service_account: None, - base_service_account: None, - max_service_accounts: None, - max_additional_service_accounts: None, - has_additional_service_account_option: None, - max_projects: None, - bitwarden_product: None, + secrets_manager: None, + password_manager: None, } } } diff --git a/crates/bitwarden-api-api/src/models/plan_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/plan_response_model_list_response_model.rs index afbb0b849..15ce8c37a 100644 --- a/crates/bitwarden-api-api/src/models/plan_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/plan_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PlanResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/plan_sponsorship_type.rs b/crates/bitwarden-api-api/src/models/plan_sponsorship_type.rs index 5e2a55824..02a750f3d 100644 --- a/crates/bitwarden-api-api/src/models/plan_sponsorship_type.rs +++ b/crates/bitwarden-api-api/src/models/plan_sponsorship_type.rs @@ -14,19 +14,19 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum PlanSponsorshipType { - Variant0 = 0, + FamiliesForEnterprise = 0, } impl ToString for PlanSponsorshipType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), + Self::FamiliesForEnterprise => String::from("0"), } } } impl Default for PlanSponsorshipType { fn default() -> PlanSponsorshipType { - Self::Variant0 + Self::FamiliesForEnterprise } } diff --git a/crates/bitwarden-api-api/src/models/plan_type.rs b/crates/bitwarden-api-api/src/models/plan_type.rs index 62d713894..109e9250e 100644 --- a/crates/bitwarden-api-api/src/models/plan_type.rs +++ b/crates/bitwarden-api-api/src/models/plan_type.rs @@ -14,41 +14,51 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum PlanType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant6 = 6, - Variant7 = 7, - Variant8 = 8, - Variant9 = 9, - Variant10 = 10, - Variant11 = 11, + Free = 0, + FamiliesAnnually2019 = 1, + TeamsMonthly2019 = 2, + TeamsAnnually2019 = 3, + EnterpriseMonthly2019 = 4, + EnterpriseAnnually2019 = 5, + Custom = 6, + FamiliesAnnually = 7, + TeamsMonthly2020 = 8, + TeamsAnnually2020 = 9, + EnterpriseMonthly2020 = 10, + EnterpriseAnnually2020 = 11, + TeamsMonthly = 12, + TeamsAnnually = 13, + EnterpriseMonthly = 14, + EnterpriseAnnually = 15, + TeamsStarter = 16, } impl ToString for PlanType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant6 => String::from("6"), - Self::Variant7 => String::from("7"), - Self::Variant8 => String::from("8"), - Self::Variant9 => String::from("9"), - Self::Variant10 => String::from("10"), - Self::Variant11 => String::from("11"), + Self::Free => String::from("0"), + Self::FamiliesAnnually2019 => String::from("1"), + Self::TeamsMonthly2019 => String::from("2"), + Self::TeamsAnnually2019 => String::from("3"), + Self::EnterpriseMonthly2019 => String::from("4"), + Self::EnterpriseAnnually2019 => String::from("5"), + Self::Custom => String::from("6"), + Self::FamiliesAnnually => String::from("7"), + Self::TeamsMonthly2020 => String::from("8"), + Self::TeamsAnnually2020 => String::from("9"), + Self::EnterpriseMonthly2020 => String::from("10"), + Self::EnterpriseAnnually2020 => String::from("11"), + Self::TeamsMonthly => String::from("12"), + Self::TeamsAnnually => String::from("13"), + Self::EnterpriseMonthly => String::from("14"), + Self::EnterpriseAnnually => String::from("15"), + Self::TeamsStarter => String::from("16"), } } } impl Default for PlanType { fn default() -> PlanType { - Self::Variant0 + Self::Free } } diff --git a/crates/bitwarden-api-api/src/models/policy_request_model.rs b/crates/bitwarden-api-api/src/models/policy_request_model.rs index 509b98c83..31b3880ea 100644 --- a/crates/bitwarden-api-api/src/models/policy_request_model.rs +++ b/crates/bitwarden-api-api/src/models/policy_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PolicyRequestModel { #[serde(rename = "type")] pub r#type: crate::models::PolicyType, diff --git a/crates/bitwarden-api-api/src/models/policy_response_model.rs b/crates/bitwarden-api-api/src/models/policy_response_model.rs index 4c5d4a633..bda9e87a5 100644 --- a/crates/bitwarden-api-api/src/models/policy_response_model.rs +++ b/crates/bitwarden-api-api/src/models/policy_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PolicyResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/policy_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/policy_response_model_list_response_model.rs index 82ee4f996..bc96d434a 100644 --- a/crates/bitwarden-api-api/src/models/policy_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/policy_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PolicyResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/policy_type.rs b/crates/bitwarden-api-api/src/models/policy_type.rs index dbb186a21..fc9e6ca63 100644 --- a/crates/bitwarden-api-api/src/models/policy_type.rs +++ b/crates/bitwarden-api-api/src/models/policy_type.rs @@ -14,41 +14,41 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum PolicyType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant6 = 6, - Variant7 = 7, - Variant8 = 8, - Variant9 = 9, - Variant10 = 10, - Variant11 = 11, + TwoFactorAuthentication = 0, + MasterPassword = 1, + PasswordGenerator = 2, + SingleOrg = 3, + RequireSso = 4, + PersonalOwnership = 5, + DisableSend = 6, + SendOptions = 7, + ResetPassword = 8, + MaximumVaultTimeout = 9, + DisablePersonalVaultExport = 10, + ActivateAutofill = 11, } impl ToString for PolicyType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant6 => String::from("6"), - Self::Variant7 => String::from("7"), - Self::Variant8 => String::from("8"), - Self::Variant9 => String::from("9"), - Self::Variant10 => String::from("10"), - Self::Variant11 => String::from("11"), + Self::TwoFactorAuthentication => String::from("0"), + Self::MasterPassword => String::from("1"), + Self::PasswordGenerator => String::from("2"), + Self::SingleOrg => String::from("3"), + Self::RequireSso => String::from("4"), + Self::PersonalOwnership => String::from("5"), + Self::DisableSend => String::from("6"), + Self::SendOptions => String::from("7"), + Self::ResetPassword => String::from("8"), + Self::MaximumVaultTimeout => String::from("9"), + Self::DisablePersonalVaultExport => String::from("10"), + Self::ActivateAutofill => String::from("11"), } } } impl Default for PolicyType { fn default() -> PolicyType { - Self::Variant0 + Self::TwoFactorAuthentication } } diff --git a/crates/bitwarden-api-api/src/models/potential_grantee_response_model.rs b/crates/bitwarden-api-api/src/models/potential_grantee_response_model.rs index 895a48705..52adb76f6 100644 --- a/crates/bitwarden-api-api/src/models/potential_grantee_response_model.rs +++ b/crates/bitwarden-api-api/src/models/potential_grantee_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PotentialGranteeResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, @@ -20,6 +20,10 @@ pub struct PotentialGranteeResponseModel { pub r#type: Option, #[serde(rename = "email", skip_serializing_if = "Option::is_none")] pub email: Option, + #[serde(rename = "currentUserInGroup", skip_serializing_if = "Option::is_none")] + pub current_user_in_group: Option, + #[serde(rename = "currentUser", skip_serializing_if = "Option::is_none")] + pub current_user: Option, } impl PotentialGranteeResponseModel { @@ -30,6 +34,8 @@ impl PotentialGranteeResponseModel { name: None, r#type: None, email: None, + current_user_in_group: None, + current_user: None, } } } diff --git a/crates/bitwarden-api-api/src/models/potential_grantee_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/potential_grantee_response_model_list_response_model.rs index acbe8f4bb..65da6ae07 100644 --- a/crates/bitwarden-api-api/src/models/potential_grantee_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/potential_grantee_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PotentialGranteeResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/prelogin_request_model.rs b/crates/bitwarden-api-api/src/models/prelogin_request_model.rs index 4749b2abd..855c9fb09 100644 --- a/crates/bitwarden-api-api/src/models/prelogin_request_model.rs +++ b/crates/bitwarden-api-api/src/models/prelogin_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PreloginRequestModel { #[serde(rename = "email")] pub email: String, diff --git a/crates/bitwarden-api-api/src/models/prelogin_response_model.rs b/crates/bitwarden-api-api/src/models/prelogin_response_model.rs index 2b4589486..bf5d536d2 100644 --- a/crates/bitwarden-api-api/src/models/prelogin_response_model.rs +++ b/crates/bitwarden-api-api/src/models/prelogin_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PreloginResponseModel { #[serde(rename = "kdf", skip_serializing_if = "Option::is_none")] pub kdf: Option, diff --git a/crates/bitwarden-api-api/src/models/product_type.rs b/crates/bitwarden-api-api/src/models/product_type.rs index dd4882690..e60a9c57c 100644 --- a/crates/bitwarden-api-api/src/models/product_type.rs +++ b/crates/bitwarden-api-api/src/models/product_type.rs @@ -14,25 +14,27 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum ProductType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, + Free = 0, + Families = 1, + Teams = 2, + Enterprise = 3, + TeamsStarter = 4, } impl ToString for ProductType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), + Self::Free => String::from("0"), + Self::Families => String::from("1"), + Self::Teams => String::from("2"), + Self::Enterprise => String::from("3"), + Self::TeamsStarter => String::from("4"), } } } impl Default for ProductType { fn default() -> ProductType { - Self::Variant0 + Self::Free } } diff --git a/crates/bitwarden-api-api/src/models/profile_organization_response_model.rs b/crates/bitwarden-api-api/src/models/profile_organization_response_model.rs index ec818fb7d..5984d13ae 100644 --- a/crates/bitwarden-api-api/src/models/profile_organization_response_model.rs +++ b/crates/bitwarden-api-api/src/models/profile_organization_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProfileOrganizationResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, @@ -133,6 +133,21 @@ pub struct ProfileOrganizationResponseModel { skip_serializing_if = "Option::is_none" )] pub access_secrets_manager: Option, + #[serde( + rename = "limitCollectionCreationDeletion", + skip_serializing_if = "Option::is_none" + )] + pub limit_collection_creation_deletion: Option, + #[serde( + rename = "allowAdminAccessToAllCollectionItems", + skip_serializing_if = "Option::is_none" + )] + pub allow_admin_access_to_all_collection_items: Option, + #[serde( + rename = "flexibleCollections", + skip_serializing_if = "Option::is_none" + )] + pub flexible_collections: Option, } impl ProfileOrganizationResponseModel { @@ -183,6 +198,9 @@ impl ProfileOrganizationResponseModel { family_sponsorship_valid_until: None, family_sponsorship_to_delete: None, access_secrets_manager: None, + limit_collection_creation_deletion: None, + allow_admin_access_to_all_collection_items: None, + flexible_collections: None, } } } diff --git a/crates/bitwarden-api-api/src/models/profile_organization_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/profile_organization_response_model_list_response_model.rs index e794446dd..c1fb06209 100644 --- a/crates/bitwarden-api-api/src/models/profile_organization_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/profile_organization_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProfileOrganizationResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/profile_provider_organization_response_model.rs b/crates/bitwarden-api-api/src/models/profile_provider_organization_response_model.rs index 9f8a03ba9..af8b13fb6 100644 --- a/crates/bitwarden-api-api/src/models/profile_provider_organization_response_model.rs +++ b/crates/bitwarden-api-api/src/models/profile_provider_organization_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProfileProviderOrganizationResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, @@ -133,6 +133,21 @@ pub struct ProfileProviderOrganizationResponseModel { skip_serializing_if = "Option::is_none" )] pub access_secrets_manager: Option, + #[serde( + rename = "limitCollectionCreationDeletion", + skip_serializing_if = "Option::is_none" + )] + pub limit_collection_creation_deletion: Option, + #[serde( + rename = "allowAdminAccessToAllCollectionItems", + skip_serializing_if = "Option::is_none" + )] + pub allow_admin_access_to_all_collection_items: Option, + #[serde( + rename = "flexibleCollections", + skip_serializing_if = "Option::is_none" + )] + pub flexible_collections: Option, } impl ProfileProviderOrganizationResponseModel { @@ -183,6 +198,9 @@ impl ProfileProviderOrganizationResponseModel { family_sponsorship_valid_until: None, family_sponsorship_to_delete: None, access_secrets_manager: None, + limit_collection_creation_deletion: None, + allow_admin_access_to_all_collection_items: None, + flexible_collections: None, } } } diff --git a/crates/bitwarden-api-api/src/models/profile_provider_response_model.rs b/crates/bitwarden-api-api/src/models/profile_provider_response_model.rs index 06426a78b..f9a5cd392 100644 --- a/crates/bitwarden-api-api/src/models/profile_provider_response_model.rs +++ b/crates/bitwarden-api-api/src/models/profile_provider_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProfileProviderResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/profile_response_model.rs b/crates/bitwarden-api-api/src/models/profile_response_model.rs index 7ccf71a1f..a151875b1 100644 --- a/crates/bitwarden-api-api/src/models/profile_response_model.rs +++ b/crates/bitwarden-api-api/src/models/profile_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProfileResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, @@ -45,6 +45,8 @@ pub struct ProfileResponseModel { pub uses_key_connector: Option, #[serde(rename = "avatarColor", skip_serializing_if = "Option::is_none")] pub avatar_color: Option, + #[serde(rename = "creationDate", skip_serializing_if = "Option::is_none")] + pub creation_date: Option, #[serde(rename = "organizations", skip_serializing_if = "Option::is_none")] pub organizations: Option>, #[serde(rename = "providers", skip_serializing_if = "Option::is_none")] @@ -76,6 +78,7 @@ impl ProfileResponseModel { force_password_reset: None, uses_key_connector: None, avatar_color: None, + creation_date: None, organizations: None, providers: None, provider_organizations: None, diff --git a/crates/bitwarden-api-api/src/models/project_access_policies_response_model.rs b/crates/bitwarden-api-api/src/models/project_access_policies_response_model.rs index 9bb4bc4d8..17daba3d9 100644 --- a/crates/bitwarden-api-api/src/models/project_access_policies_response_model.rs +++ b/crates/bitwarden-api-api/src/models/project_access_policies_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProjectAccessPoliciesResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/project_create_request_model.rs b/crates/bitwarden-api-api/src/models/project_create_request_model.rs index a74931e1f..dcec98f62 100644 --- a/crates/bitwarden-api-api/src/models/project_create_request_model.rs +++ b/crates/bitwarden-api-api/src/models/project_create_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProjectCreateRequestModel { #[serde(rename = "name")] pub name: String, diff --git a/crates/bitwarden-api-api/src/models/project_people_access_policies_response_model.rs b/crates/bitwarden-api-api/src/models/project_people_access_policies_response_model.rs new file mode 100644 index 000000000..27655433f --- /dev/null +++ b/crates/bitwarden-api-api/src/models/project_people_access_policies_response_model.rs @@ -0,0 +1,32 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ProjectPeopleAccessPoliciesResponseModel { + #[serde(rename = "object", skip_serializing_if = "Option::is_none")] + pub object: Option, + #[serde(rename = "userAccessPolicies", skip_serializing_if = "Option::is_none")] + pub user_access_policies: Option>, + #[serde( + rename = "groupAccessPolicies", + skip_serializing_if = "Option::is_none" + )] + pub group_access_policies: Option>, +} + +impl ProjectPeopleAccessPoliciesResponseModel { + pub fn new() -> ProjectPeopleAccessPoliciesResponseModel { + ProjectPeopleAccessPoliciesResponseModel { + object: None, + user_access_policies: None, + group_access_policies: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/project_response_model.rs b/crates/bitwarden-api-api/src/models/project_response_model.rs index a6045885d..93bc6f14e 100644 --- a/crates/bitwarden-api-api/src/models/project_response_model.rs +++ b/crates/bitwarden-api-api/src/models/project_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProjectResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/project_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/project_response_model_list_response_model.rs index 4978edbe6..b6143ddf5 100644 --- a/crates/bitwarden-api-api/src/models/project_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/project_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProjectResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/project_update_request_model.rs b/crates/bitwarden-api-api/src/models/project_update_request_model.rs index a0c85cdf8..913168899 100644 --- a/crates/bitwarden-api-api/src/models/project_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/project_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProjectUpdateRequestModel { #[serde(rename = "name")] pub name: String, diff --git a/crates/bitwarden-api-api/src/models/protected_device_response_model.rs b/crates/bitwarden-api-api/src/models/protected_device_response_model.rs index f34e1128d..055d34c20 100644 --- a/crates/bitwarden-api-api/src/models/protected_device_response_model.rs +++ b/crates/bitwarden-api-api/src/models/protected_device_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProtectedDeviceResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/provider_organization_add_request_model.rs b/crates/bitwarden-api-api/src/models/provider_organization_add_request_model.rs index 2c8c66697..c25569d90 100644 --- a/crates/bitwarden-api-api/src/models/provider_organization_add_request_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_organization_add_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderOrganizationAddRequestModel { #[serde(rename = "organizationId")] pub organization_id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/models/provider_organization_create_request_model.rs b/crates/bitwarden-api-api/src/models/provider_organization_create_request_model.rs index 69e5c63d6..4cfb59343 100644 --- a/crates/bitwarden-api-api/src/models/provider_organization_create_request_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_organization_create_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderOrganizationCreateRequestModel { #[serde(rename = "clientOwnerEmail")] pub client_owner_email: String, diff --git a/crates/bitwarden-api-api/src/models/provider_organization_organization_details_response_model.rs b/crates/bitwarden-api-api/src/models/provider_organization_organization_details_response_model.rs index bb4e3a029..2c8e99a99 100644 --- a/crates/bitwarden-api-api/src/models/provider_organization_organization_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_organization_organization_details_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderOrganizationOrganizationDetailsResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/provider_organization_organization_details_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/provider_organization_organization_details_response_model_list_response_model.rs index 6e4671153..114240fc1 100644 --- a/crates/bitwarden-api-api/src/models/provider_organization_organization_details_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_organization_organization_details_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderOrganizationOrganizationDetailsResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/provider_organization_response_model.rs b/crates/bitwarden-api-api/src/models/provider_organization_response_model.rs index c72f7a9bf..a1d339190 100644 --- a/crates/bitwarden-api-api/src/models/provider_organization_response_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_organization_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderOrganizationResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/provider_response_model.rs b/crates/bitwarden-api-api/src/models/provider_response_model.rs index 2ca58e08c..83cfe0b69 100644 --- a/crates/bitwarden-api-api/src/models/provider_response_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, @@ -30,6 +30,8 @@ pub struct ProviderResponseModel { pub business_tax_number: Option, #[serde(rename = "billingEmail", skip_serializing_if = "Option::is_none")] pub billing_email: Option, + #[serde(rename = "creationDate", skip_serializing_if = "Option::is_none")] + pub creation_date: Option, } impl ProviderResponseModel { @@ -45,6 +47,7 @@ impl ProviderResponseModel { business_country: None, business_tax_number: None, billing_email: None, + creation_date: None, } } } diff --git a/crates/bitwarden-api-api/src/models/provider_setup_request_model.rs b/crates/bitwarden-api-api/src/models/provider_setup_request_model.rs index 5ffdc9a6e..dacc39a8d 100644 --- a/crates/bitwarden-api-api/src/models/provider_setup_request_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_setup_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderSetupRequestModel { #[serde(rename = "name")] pub name: String, diff --git a/crates/bitwarden-api-api/src/models/provider_type.rs b/crates/bitwarden-api-api/src/models/provider_type.rs index 340210d32..f2d30a6cd 100644 --- a/crates/bitwarden-api-api/src/models/provider_type.rs +++ b/crates/bitwarden-api-api/src/models/provider_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum ProviderType { - Variant0 = 0, - Variant1 = 1, + Msp = 0, + Reseller = 1, } impl ToString for ProviderType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::Msp => String::from("0"), + Self::Reseller => String::from("1"), } } } impl Default for ProviderType { fn default() -> ProviderType { - Self::Variant0 + Self::Msp } } diff --git a/crates/bitwarden-api-api/src/models/provider_update_request_model.rs b/crates/bitwarden-api-api/src/models/provider_update_request_model.rs index bf03dfc66..39d892904 100644 --- a/crates/bitwarden-api-api/src/models/provider_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderUpdateRequestModel { #[serde(rename = "name")] pub name: String, diff --git a/crates/bitwarden-api-api/src/models/provider_user_accept_request_model.rs b/crates/bitwarden-api-api/src/models/provider_user_accept_request_model.rs index 3f037c22b..cf526fa7c 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_accept_request_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_accept_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderUserAcceptRequestModel { #[serde(rename = "token")] pub token: String, diff --git a/crates/bitwarden-api-api/src/models/provider_user_bulk_confirm_request_model.rs b/crates/bitwarden-api-api/src/models/provider_user_bulk_confirm_request_model.rs index 0b80432ec..78bc34e17 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_bulk_confirm_request_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_bulk_confirm_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderUserBulkConfirmRequestModel { #[serde(rename = "keys")] pub keys: Vec, diff --git a/crates/bitwarden-api-api/src/models/provider_user_bulk_confirm_request_model_entry.rs b/crates/bitwarden-api-api/src/models/provider_user_bulk_confirm_request_model_entry.rs index eac03ea15..cc5c82d82 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_bulk_confirm_request_model_entry.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_bulk_confirm_request_model_entry.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderUserBulkConfirmRequestModelEntry { #[serde(rename = "id")] pub id: uuid::Uuid, diff --git a/crates/bitwarden-api-api/src/models/provider_user_bulk_request_model.rs b/crates/bitwarden-api-api/src/models/provider_user_bulk_request_model.rs index 697206108..5e4cdca5a 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_bulk_request_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_bulk_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderUserBulkRequestModel { #[serde(rename = "ids")] pub ids: Vec, diff --git a/crates/bitwarden-api-api/src/models/provider_user_bulk_response_model.rs b/crates/bitwarden-api-api/src/models/provider_user_bulk_response_model.rs index de52b31f7..00da85ac4 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_bulk_response_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_bulk_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderUserBulkResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/provider_user_bulk_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/provider_user_bulk_response_model_list_response_model.rs index 3954b0948..9f76667b9 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_bulk_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_bulk_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderUserBulkResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/provider_user_confirm_request_model.rs b/crates/bitwarden-api-api/src/models/provider_user_confirm_request_model.rs index 333809dfd..917b858cf 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_confirm_request_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_confirm_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderUserConfirmRequestModel { #[serde(rename = "key")] pub key: String, diff --git a/crates/bitwarden-api-api/src/models/provider_user_invite_request_model.rs b/crates/bitwarden-api-api/src/models/provider_user_invite_request_model.rs index c547d5cb5..6113957bb 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_invite_request_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_invite_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderUserInviteRequestModel { #[serde(rename = "emails")] pub emails: Vec, diff --git a/crates/bitwarden-api-api/src/models/provider_user_public_key_response_model.rs b/crates/bitwarden-api-api/src/models/provider_user_public_key_response_model.rs index 9743af7b1..8dbd5f0a7 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_public_key_response_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_public_key_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderUserPublicKeyResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/provider_user_public_key_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/provider_user_public_key_response_model_list_response_model.rs index 04a8e5584..154070458 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_public_key_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_public_key_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderUserPublicKeyResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/provider_user_response_model.rs b/crates/bitwarden-api-api/src/models/provider_user_response_model.rs index db7fac194..3ffeaa926 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_response_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderUserResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/provider_user_status_type.rs b/crates/bitwarden-api-api/src/models/provider_user_status_type.rs index 0918fe1d6..653dabbeb 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_status_type.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_status_type.rs @@ -14,23 +14,23 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum ProviderUserStatusType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, + Invited = 0, + Accepted = 1, + Confirmed = 2, } impl ToString for ProviderUserStatusType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::Invited => String::from("0"), + Self::Accepted => String::from("1"), + Self::Confirmed => String::from("2"), } } } impl Default for ProviderUserStatusType { fn default() -> ProviderUserStatusType { - Self::Variant0 + Self::Invited } } diff --git a/crates/bitwarden-api-api/src/models/provider_user_type.rs b/crates/bitwarden-api-api/src/models/provider_user_type.rs index 28b130f8d..c51a3b932 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_type.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum ProviderUserType { - Variant0 = 0, - Variant1 = 1, + ProviderAdmin = 0, + ServiceUser = 1, } impl ToString for ProviderUserType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::ProviderAdmin => String::from("0"), + Self::ServiceUser => String::from("1"), } } } impl Default for ProviderUserType { fn default() -> ProviderUserType { - Self::Variant0 + Self::ProviderAdmin } } diff --git a/crates/bitwarden-api-api/src/models/provider_user_update_request_model.rs b/crates/bitwarden-api-api/src/models/provider_user_update_request_model.rs index 8707fdb24..eeb36bff7 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderUserUpdateRequestModel { #[serde(rename = "type")] pub r#type: crate::models::ProviderUserType, diff --git a/crates/bitwarden-api-api/src/models/provider_user_user_details_response_model.rs b/crates/bitwarden-api-api/src/models/provider_user_user_details_response_model.rs index 774865640..74f6169cb 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_user_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_user_details_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderUserUserDetailsResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/provider_user_user_details_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/provider_user_user_details_response_model_list_response_model.rs index 963b28c90..7e9a171fe 100644 --- a/crates/bitwarden-api-api/src/models/provider_user_user_details_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/provider_user_user_details_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderUserUserDetailsResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/pub_key_cred_param.rs b/crates/bitwarden-api-api/src/models/pub_key_cred_param.rs new file mode 100644 index 000000000..670062fa1 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/pub_key_cred_param.rs @@ -0,0 +1,26 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PubKeyCredParam { + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "alg", skip_serializing_if = "Option::is_none")] + pub alg: Option, +} + +impl PubKeyCredParam { + pub fn new() -> PubKeyCredParam { + PubKeyCredParam { + r#type: None, + alg: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/public_key_credential_descriptor.rs b/crates/bitwarden-api-api/src/models/public_key_credential_descriptor.rs new file mode 100644 index 000000000..e266e1105 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/public_key_credential_descriptor.rs @@ -0,0 +1,29 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PublicKeyCredentialDescriptor { + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "transports", skip_serializing_if = "Option::is_none")] + pub transports: Option>, +} + +impl PublicKeyCredentialDescriptor { + pub fn new() -> PublicKeyCredentialDescriptor { + PublicKeyCredentialDescriptor { + r#type: None, + id: None, + transports: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/public_key_credential_rp_entity.rs b/crates/bitwarden-api-api/src/models/public_key_credential_rp_entity.rs new file mode 100644 index 000000000..318405f71 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/public_key_credential_rp_entity.rs @@ -0,0 +1,29 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PublicKeyCredentialRpEntity { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] + pub icon: Option, +} + +impl PublicKeyCredentialRpEntity { + pub fn new() -> PublicKeyCredentialRpEntity { + PublicKeyCredentialRpEntity { + id: None, + name: None, + icon: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/push_registration_request_model.rs b/crates/bitwarden-api-api/src/models/push_registration_request_model.rs index 190ce4555..aca447e3f 100644 --- a/crates/bitwarden-api-api/src/models/push_registration_request_model.rs +++ b/crates/bitwarden-api-api/src/models/push_registration_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PushRegistrationRequestModel { #[serde(rename = "deviceId")] pub device_id: String, diff --git a/crates/bitwarden-api-api/src/models/push_send_request_model.rs b/crates/bitwarden-api-api/src/models/push_send_request_model.rs index 2ef909c16..d064b78e2 100644 --- a/crates/bitwarden-api-api/src/models/push_send_request_model.rs +++ b/crates/bitwarden-api-api/src/models/push_send_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PushSendRequestModel { #[serde(rename = "userId", skip_serializing_if = "Option::is_none")] pub user_id: Option, diff --git a/crates/bitwarden-api-api/src/models/push_type.rs b/crates/bitwarden-api-api/src/models/push_type.rs index fe38f85a7..8e69b5a73 100644 --- a/crates/bitwarden-api-api/src/models/push_type.rs +++ b/crates/bitwarden-api-api/src/models/push_type.rs @@ -14,51 +14,51 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum PushType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant6 = 6, - Variant7 = 7, - Variant8 = 8, - Variant9 = 9, - Variant10 = 10, - Variant11 = 11, - Variant12 = 12, - Variant13 = 13, - Variant14 = 14, - Variant15 = 15, - Variant16 = 16, + SyncCipherUpdate = 0, + SyncCipherCreate = 1, + SyncLoginDelete = 2, + SyncFolderDelete = 3, + SyncCiphers = 4, + SyncVault = 5, + SyncOrgKeys = 6, + SyncFolderCreate = 7, + SyncFolderUpdate = 8, + SyncCipherDelete = 9, + SyncSettings = 10, + LogOut = 11, + SyncSendCreate = 12, + SyncSendUpdate = 13, + SyncSendDelete = 14, + AuthRequest = 15, + AuthRequestResponse = 16, } impl ToString for PushType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant6 => String::from("6"), - Self::Variant7 => String::from("7"), - Self::Variant8 => String::from("8"), - Self::Variant9 => String::from("9"), - Self::Variant10 => String::from("10"), - Self::Variant11 => String::from("11"), - Self::Variant12 => String::from("12"), - Self::Variant13 => String::from("13"), - Self::Variant14 => String::from("14"), - Self::Variant15 => String::from("15"), - Self::Variant16 => String::from("16"), + Self::SyncCipherUpdate => String::from("0"), + Self::SyncCipherCreate => String::from("1"), + Self::SyncLoginDelete => String::from("2"), + Self::SyncFolderDelete => String::from("3"), + Self::SyncCiphers => String::from("4"), + Self::SyncVault => String::from("5"), + Self::SyncOrgKeys => String::from("6"), + Self::SyncFolderCreate => String::from("7"), + Self::SyncFolderUpdate => String::from("8"), + Self::SyncCipherDelete => String::from("9"), + Self::SyncSettings => String::from("10"), + Self::LogOut => String::from("11"), + Self::SyncSendCreate => String::from("12"), + Self::SyncSendUpdate => String::from("13"), + Self::SyncSendDelete => String::from("14"), + Self::AuthRequest => String::from("15"), + Self::AuthRequestResponse => String::from("16"), } } } impl Default for PushType { fn default() -> PushType { - Self::Variant0 + Self::SyncCipherUpdate } } diff --git a/crates/bitwarden-api-api/src/models/push_update_request_model.rs b/crates/bitwarden-api-api/src/models/push_update_request_model.rs index a6030831a..2fda855bb 100644 --- a/crates/bitwarden-api-api/src/models/push_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/push_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PushUpdateRequestModel { #[serde(rename = "deviceIds")] pub device_ids: Vec, diff --git a/crates/bitwarden-api-api/src/models/register_request_model.rs b/crates/bitwarden-api-api/src/models/register_request_model.rs index dbdd37ad6..b4a0d4b8d 100644 --- a/crates/bitwarden-api-api/src/models/register_request_model.rs +++ b/crates/bitwarden-api-api/src/models/register_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RegisterRequestModel { #[serde(rename = "name", skip_serializing_if = "Option::is_none")] pub name: Option, diff --git a/crates/bitwarden-api-api/src/models/register_response_model.rs b/crates/bitwarden-api-api/src/models/register_response_model.rs index 55710d5b5..629d2af4f 100644 --- a/crates/bitwarden-api-api/src/models/register_response_model.rs +++ b/crates/bitwarden-api-api/src/models/register_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RegisterResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/reset_password_with_org_id_request_model.rs b/crates/bitwarden-api-api/src/models/reset_password_with_org_id_request_model.rs new file mode 100644 index 000000000..c74c02592 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/reset_password_with_org_id_request_model.rs @@ -0,0 +1,26 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ResetPasswordWithOrgIdRequestModel { + #[serde(rename = "resetPasswordKey", skip_serializing_if = "Option::is_none")] + pub reset_password_key: Option, + #[serde(rename = "organizationId")] + pub organization_id: uuid::Uuid, +} + +impl ResetPasswordWithOrgIdRequestModel { + pub fn new(organization_id: uuid::Uuid) -> ResetPasswordWithOrgIdRequestModel { + ResetPasswordWithOrgIdRequestModel { + reset_password_key: None, + organization_id, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/response_data.rs b/crates/bitwarden-api-api/src/models/response_data.rs index 33f138cd6..9ff2a66e0 100644 --- a/crates/bitwarden-api-api/src/models/response_data.rs +++ b/crates/bitwarden-api-api/src/models/response_data.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ResponseData { #[serde(rename = "attestationObject", skip_serializing_if = "Option::is_none")] pub attestation_object: Option, diff --git a/crates/bitwarden-api-api/src/models/revoke_access_tokens_request.rs b/crates/bitwarden-api-api/src/models/revoke_access_tokens_request.rs index 53fcece6d..20d18ab59 100644 --- a/crates/bitwarden-api-api/src/models/revoke_access_tokens_request.rs +++ b/crates/bitwarden-api-api/src/models/revoke_access_tokens_request.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RevokeAccessTokensRequest { #[serde(rename = "ids")] pub ids: Vec, diff --git a/crates/bitwarden-api-api/src/models/saml2_binding_type.rs b/crates/bitwarden-api-api/src/models/saml2_binding_type.rs index 039309cad..e01b398cd 100644 --- a/crates/bitwarden-api-api/src/models/saml2_binding_type.rs +++ b/crates/bitwarden-api-api/src/models/saml2_binding_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum Saml2BindingType { - Variant1 = 1, - Variant2 = 2, + HttpRedirect = 1, + HttpPost = 2, } impl ToString for Saml2BindingType { fn to_string(&self) -> String { match self { - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::HttpRedirect => String::from("1"), + Self::HttpPost => String::from("2"), } } } impl Default for Saml2BindingType { fn default() -> Saml2BindingType { - Self::Variant1 + Self::HttpRedirect } } diff --git a/crates/bitwarden-api-api/src/models/saml2_name_id_format.rs b/crates/bitwarden-api-api/src/models/saml2_name_id_format.rs index 6399c7f9b..e8680e9a6 100644 --- a/crates/bitwarden-api-api/src/models/saml2_name_id_format.rs +++ b/crates/bitwarden-api-api/src/models/saml2_name_id_format.rs @@ -14,35 +14,35 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum Saml2NameIdFormat { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant6 = 6, - Variant7 = 7, - Variant8 = 8, + NotConfigured = 0, + Unspecified = 1, + EmailAddress = 2, + X509SubjectName = 3, + WindowsDomainQualifiedName = 4, + KerberosPrincipalName = 5, + EntityIdentifier = 6, + Persistent = 7, + Transient = 8, } impl ToString for Saml2NameIdFormat { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant6 => String::from("6"), - Self::Variant7 => String::from("7"), - Self::Variant8 => String::from("8"), + Self::NotConfigured => String::from("0"), + Self::Unspecified => String::from("1"), + Self::EmailAddress => String::from("2"), + Self::X509SubjectName => String::from("3"), + Self::WindowsDomainQualifiedName => String::from("4"), + Self::KerberosPrincipalName => String::from("5"), + Self::EntityIdentifier => String::from("6"), + Self::Persistent => String::from("7"), + Self::Transient => String::from("8"), } } } impl Default for Saml2NameIdFormat { fn default() -> Saml2NameIdFormat { - Self::Variant0 + Self::NotConfigured } } diff --git a/crates/bitwarden-api-api/src/models/saml2_signing_behavior.rs b/crates/bitwarden-api-api/src/models/saml2_signing_behavior.rs index 3b0668865..12be578aa 100644 --- a/crates/bitwarden-api-api/src/models/saml2_signing_behavior.rs +++ b/crates/bitwarden-api-api/src/models/saml2_signing_behavior.rs @@ -14,23 +14,23 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum Saml2SigningBehavior { - Variant0 = 0, - Variant1 = 1, - Variant3 = 3, + IfIdpWantAuthnRequestsSigned = 0, + Always = 1, + Never = 3, } impl ToString for Saml2SigningBehavior { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant3 => String::from("3"), + Self::IfIdpWantAuthnRequestsSigned => String::from("0"), + Self::Always => String::from("1"), + Self::Never => String::from("3"), } } } impl Default for Saml2SigningBehavior { fn default() -> Saml2SigningBehavior { - Self::Variant0 + Self::IfIdpWantAuthnRequestsSigned } } diff --git a/crates/bitwarden-api-api/src/models/secret_create_request_model.rs b/crates/bitwarden-api-api/src/models/secret_create_request_model.rs index a99bc551e..7bc23b871 100644 --- a/crates/bitwarden-api-api/src/models/secret_create_request_model.rs +++ b/crates/bitwarden-api-api/src/models/secret_create_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SecretCreateRequestModel { #[serde(rename = "key")] pub key: String, diff --git a/crates/bitwarden-api-api/src/models/secret_response_inner_project.rs b/crates/bitwarden-api-api/src/models/secret_response_inner_project.rs index bdd2c4fe0..25be360ad 100644 --- a/crates/bitwarden-api-api/src/models/secret_response_inner_project.rs +++ b/crates/bitwarden-api-api/src/models/secret_response_inner_project.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SecretResponseInnerProject { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/crates/bitwarden-api-api/src/models/secret_response_model.rs b/crates/bitwarden-api-api/src/models/secret_response_model.rs index 2dcf8b192..dffea3122 100644 --- a/crates/bitwarden-api-api/src/models/secret_response_model.rs +++ b/crates/bitwarden-api-api/src/models/secret_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SecretResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/secret_update_request_model.rs b/crates/bitwarden-api-api/src/models/secret_update_request_model.rs index a4675c6ba..67ae4ade2 100644 --- a/crates/bitwarden-api-api/src/models/secret_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/secret_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SecretUpdateRequestModel { #[serde(rename = "key")] pub key: String, diff --git a/crates/bitwarden-api-api/src/models/secret_verification_request_model.rs b/crates/bitwarden-api-api/src/models/secret_verification_request_model.rs index f4774d5b6..85ceee419 100644 --- a/crates/bitwarden-api-api/src/models/secret_verification_request_model.rs +++ b/crates/bitwarden-api-api/src/models/secret_verification_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SecretVerificationRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/secret_with_projects_inner_project.rs b/crates/bitwarden-api-api/src/models/secret_with_projects_inner_project.rs index 3b68f65d5..cce3b239c 100644 --- a/crates/bitwarden-api-api/src/models/secret_with_projects_inner_project.rs +++ b/crates/bitwarden-api-api/src/models/secret_with_projects_inner_project.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SecretWithProjectsInnerProject { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/crates/bitwarden-api-api/src/models/secret_with_projects_list_response_model.rs b/crates/bitwarden-api-api/src/models/secret_with_projects_list_response_model.rs index 1a832ab48..046e698f4 100644 --- a/crates/bitwarden-api-api/src/models/secret_with_projects_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/secret_with_projects_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SecretWithProjectsListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/secrets_manager_plan_features_response_model.rs b/crates/bitwarden-api-api/src/models/secrets_manager_plan_features_response_model.rs new file mode 100644 index 000000000..ef8d32f04 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/secrets_manager_plan_features_response_model.rs @@ -0,0 +1,86 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SecretsManagerPlanFeaturesResponseModel { + #[serde(rename = "maxServiceAccounts", skip_serializing_if = "Option::is_none")] + pub max_service_accounts: Option, + #[serde( + rename = "allowServiceAccountsAutoscale", + skip_serializing_if = "Option::is_none" + )] + pub allow_service_accounts_autoscale: Option, + #[serde( + rename = "stripeServiceAccountPlanId", + skip_serializing_if = "Option::is_none" + )] + pub stripe_service_account_plan_id: Option, + #[serde( + rename = "additionalPricePerServiceAccount", + skip_serializing_if = "Option::is_none" + )] + pub additional_price_per_service_account: Option, + #[serde(rename = "baseServiceAccount", skip_serializing_if = "Option::is_none")] + pub base_service_account: Option, + #[serde( + rename = "maxAdditionalServiceAccount", + skip_serializing_if = "Option::is_none" + )] + pub max_additional_service_account: Option, + #[serde( + rename = "hasAdditionalServiceAccountOption", + skip_serializing_if = "Option::is_none" + )] + pub has_additional_service_account_option: Option, + #[serde(rename = "stripeSeatPlanId", skip_serializing_if = "Option::is_none")] + pub stripe_seat_plan_id: Option, + #[serde( + rename = "hasAdditionalSeatsOption", + skip_serializing_if = "Option::is_none" + )] + pub has_additional_seats_option: Option, + #[serde(rename = "basePrice", skip_serializing_if = "Option::is_none")] + pub base_price: Option, + #[serde(rename = "seatPrice", skip_serializing_if = "Option::is_none")] + pub seat_price: Option, + #[serde(rename = "baseSeats", skip_serializing_if = "Option::is_none")] + pub base_seats: Option, + #[serde(rename = "maxSeats", skip_serializing_if = "Option::is_none")] + pub max_seats: Option, + #[serde(rename = "maxAdditionalSeats", skip_serializing_if = "Option::is_none")] + pub max_additional_seats: Option, + #[serde(rename = "allowSeatAutoscale", skip_serializing_if = "Option::is_none")] + pub allow_seat_autoscale: Option, + #[serde(rename = "maxProjects", skip_serializing_if = "Option::is_none")] + pub max_projects: Option, +} + +impl SecretsManagerPlanFeaturesResponseModel { + pub fn new() -> SecretsManagerPlanFeaturesResponseModel { + SecretsManagerPlanFeaturesResponseModel { + max_service_accounts: None, + allow_service_accounts_autoscale: None, + stripe_service_account_plan_id: None, + additional_price_per_service_account: None, + base_service_account: None, + max_additional_service_account: None, + has_additional_service_account_option: None, + stripe_seat_plan_id: None, + has_additional_seats_option: None, + base_price: None, + seat_price: None, + base_seats: None, + max_seats: None, + max_additional_seats: None, + allow_seat_autoscale: None, + max_projects: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/secrets_manager_subscribe_request_model.rs b/crates/bitwarden-api-api/src/models/secrets_manager_subscribe_request_model.rs index 2510d8f2c..cf27fa764 100644 --- a/crates/bitwarden-api-api/src/models/secrets_manager_subscribe_request_model.rs +++ b/crates/bitwarden-api-api/src/models/secrets_manager_subscribe_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SecretsManagerSubscribeRequestModel { #[serde(rename = "additionalSmSeats")] pub additional_sm_seats: i32, diff --git a/crates/bitwarden-api-api/src/models/secrets_manager_subscription_update_request_model.rs b/crates/bitwarden-api-api/src/models/secrets_manager_subscription_update_request_model.rs index 406769bce..b61e9c2fe 100644 --- a/crates/bitwarden-api-api/src/models/secrets_manager_subscription_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/secrets_manager_subscription_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SecretsManagerSubscriptionUpdateRequestModel { #[serde(rename = "seatAdjustment")] pub seat_adjustment: i32, diff --git a/crates/bitwarden-api-api/src/models/secrets_with_projects_inner_secret.rs b/crates/bitwarden-api-api/src/models/secrets_with_projects_inner_secret.rs index 45dcbd9c1..2b6673ef1 100644 --- a/crates/bitwarden-api-api/src/models/secrets_with_projects_inner_secret.rs +++ b/crates/bitwarden-api-api/src/models/secrets_with_projects_inner_secret.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SecretsWithProjectsInnerSecret { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/crates/bitwarden-api-api/src/models/secure_note_type.rs b/crates/bitwarden-api-api/src/models/secure_note_type.rs index 9fd0a3158..dd8516f6e 100644 --- a/crates/bitwarden-api-api/src/models/secure_note_type.rs +++ b/crates/bitwarden-api-api/src/models/secure_note_type.rs @@ -14,19 +14,19 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum SecureNoteType { - Variant0 = 0, + Generic = 0, } impl ToString for SecureNoteType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), + Self::Generic => String::from("0"), } } } impl Default for SecureNoteType { fn default() -> SecureNoteType { - Self::Variant0 + Self::Generic } } diff --git a/crates/bitwarden-api-api/src/models/selection_read_only_request_model.rs b/crates/bitwarden-api-api/src/models/selection_read_only_request_model.rs index 2d7d0c4da..81695f1d7 100644 --- a/crates/bitwarden-api-api/src/models/selection_read_only_request_model.rs +++ b/crates/bitwarden-api-api/src/models/selection_read_only_request_model.rs @@ -8,22 +8,25 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SelectionReadOnlyRequestModel { #[serde(rename = "id")] - pub id: String, + pub id: uuid::Uuid, #[serde(rename = "readOnly", skip_serializing_if = "Option::is_none")] pub read_only: Option, #[serde(rename = "hidePasswords", skip_serializing_if = "Option::is_none")] pub hide_passwords: Option, + #[serde(rename = "manage", skip_serializing_if = "Option::is_none")] + pub manage: Option, } impl SelectionReadOnlyRequestModel { - pub fn new(id: String) -> SelectionReadOnlyRequestModel { + pub fn new(id: uuid::Uuid) -> SelectionReadOnlyRequestModel { SelectionReadOnlyRequestModel { id, read_only: None, hide_passwords: None, + manage: None, } } } diff --git a/crates/bitwarden-api-api/src/models/selection_read_only_response_model.rs b/crates/bitwarden-api-api/src/models/selection_read_only_response_model.rs index c989fccf0..b24fd8368 100644 --- a/crates/bitwarden-api-api/src/models/selection_read_only_response_model.rs +++ b/crates/bitwarden-api-api/src/models/selection_read_only_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SelectionReadOnlyResponseModel { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, @@ -16,6 +16,8 @@ pub struct SelectionReadOnlyResponseModel { pub read_only: Option, #[serde(rename = "hidePasswords", skip_serializing_if = "Option::is_none")] pub hide_passwords: Option, + #[serde(rename = "manage", skip_serializing_if = "Option::is_none")] + pub manage: Option, } impl SelectionReadOnlyResponseModel { @@ -24,6 +26,7 @@ impl SelectionReadOnlyResponseModel { id: None, read_only: None, hide_passwords: None, + manage: None, } } } diff --git a/crates/bitwarden-api-api/src/models/self_hosted_organization_license_request_model.rs b/crates/bitwarden-api-api/src/models/self_hosted_organization_license_request_model.rs index 935589714..3e5038e38 100644 --- a/crates/bitwarden-api-api/src/models/self_hosted_organization_license_request_model.rs +++ b/crates/bitwarden-api-api/src/models/self_hosted_organization_license_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SelfHostedOrganizationLicenseRequestModel { #[serde(rename = "licenseKey", skip_serializing_if = "Option::is_none")] pub license_key: Option, diff --git a/crates/bitwarden-api-api/src/models/send_access_request_model.rs b/crates/bitwarden-api-api/src/models/send_access_request_model.rs index 2cdff93c3..51192dc02 100644 --- a/crates/bitwarden-api-api/src/models/send_access_request_model.rs +++ b/crates/bitwarden-api-api/src/models/send_access_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SendAccessRequestModel { #[serde(rename = "password", skip_serializing_if = "Option::is_none")] pub password: Option, diff --git a/crates/bitwarden-api-api/src/models/send_file_model.rs b/crates/bitwarden-api-api/src/models/send_file_model.rs index 88d15c50e..e94c99ea2 100644 --- a/crates/bitwarden-api-api/src/models/send_file_model.rs +++ b/crates/bitwarden-api-api/src/models/send_file_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SendFileModel { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/crates/bitwarden-api-api/src/models/send_file_upload_data_response_model.rs b/crates/bitwarden-api-api/src/models/send_file_upload_data_response_model.rs index 0c22f4126..0f1329824 100644 --- a/crates/bitwarden-api-api/src/models/send_file_upload_data_response_model.rs +++ b/crates/bitwarden-api-api/src/models/send_file_upload_data_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SendFileUploadDataResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/send_request_model.rs b/crates/bitwarden-api-api/src/models/send_request_model.rs index 2d528623c..e117b82fb 100644 --- a/crates/bitwarden-api-api/src/models/send_request_model.rs +++ b/crates/bitwarden-api-api/src/models/send_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SendRequestModel { #[serde(rename = "type", skip_serializing_if = "Option::is_none")] pub r#type: Option, diff --git a/crates/bitwarden-api-api/src/models/send_response_model.rs b/crates/bitwarden-api-api/src/models/send_response_model.rs index 76af62ed4..c74ddd7c4 100644 --- a/crates/bitwarden-api-api/src/models/send_response_model.rs +++ b/crates/bitwarden-api-api/src/models/send_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SendResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/send_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/send_response_model_list_response_model.rs index 608927413..c0870e19c 100644 --- a/crates/bitwarden-api-api/src/models/send_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/send_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SendResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/send_text_model.rs b/crates/bitwarden-api-api/src/models/send_text_model.rs index 3c37ba152..58f2effd0 100644 --- a/crates/bitwarden-api-api/src/models/send_text_model.rs +++ b/crates/bitwarden-api-api/src/models/send_text_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SendTextModel { #[serde(rename = "text", skip_serializing_if = "Option::is_none")] pub text: Option, diff --git a/crates/bitwarden-api-api/src/models/send_type.rs b/crates/bitwarden-api-api/src/models/send_type.rs index 5ea1c2504..6364c4af2 100644 --- a/crates/bitwarden-api-api/src/models/send_type.rs +++ b/crates/bitwarden-api-api/src/models/send_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum SendType { - Variant0 = 0, - Variant1 = 1, + Text = 0, + File = 1, } impl ToString for SendType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::Text => String::from("0"), + Self::File => String::from("1"), } } } impl Default for SendType { fn default() -> SendType { - Self::Variant0 + Self::Text } } diff --git a/crates/bitwarden-api-api/src/models/send_with_id_request_model.rs b/crates/bitwarden-api-api/src/models/send_with_id_request_model.rs index 8c31ae2ff..06dc03a95 100644 --- a/crates/bitwarden-api-api/src/models/send_with_id_request_model.rs +++ b/crates/bitwarden-api-api/src/models/send_with_id_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SendWithIdRequestModel { #[serde(rename = "type", skip_serializing_if = "Option::is_none")] pub r#type: Option, diff --git a/crates/bitwarden-api-api/src/models/server_config_response_model.rs b/crates/bitwarden-api-api/src/models/server_config_response_model.rs index 46d417394..a5603808f 100644 --- a/crates/bitwarden-api-api/src/models/server_config_response_model.rs +++ b/crates/bitwarden-api-api/src/models/server_config_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServerConfigResponseModel { #[serde(rename = "name", skip_serializing_if = "Option::is_none")] pub name: Option, diff --git a/crates/bitwarden-api-api/src/models/service_account_create_request_model.rs b/crates/bitwarden-api-api/src/models/service_account_create_request_model.rs index f34686774..ebebc8f96 100644 --- a/crates/bitwarden-api-api/src/models/service_account_create_request_model.rs +++ b/crates/bitwarden-api-api/src/models/service_account_create_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceAccountCreateRequestModel { #[serde(rename = "name")] pub name: String, diff --git a/crates/bitwarden-api-api/src/models/service_account_access_policies_response_model.rs b/crates/bitwarden-api-api/src/models/service_account_people_access_policies_response_model.rs similarity index 74% rename from crates/bitwarden-api-api/src/models/service_account_access_policies_response_model.rs rename to crates/bitwarden-api-api/src/models/service_account_people_access_policies_response_model.rs index 22db48178..3b38851f4 100644 --- a/crates/bitwarden-api-api/src/models/service_account_access_policies_response_model.rs +++ b/crates/bitwarden-api-api/src/models/service_account_people_access_policies_response_model.rs @@ -8,8 +8,8 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServiceAccountAccessPoliciesResponseModel { +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ServiceAccountPeopleAccessPoliciesResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, #[serde(rename = "userAccessPolicies", skip_serializing_if = "Option::is_none")] @@ -23,9 +23,9 @@ pub struct ServiceAccountAccessPoliciesResponseModel { Option>, } -impl ServiceAccountAccessPoliciesResponseModel { - pub fn new() -> ServiceAccountAccessPoliciesResponseModel { - ServiceAccountAccessPoliciesResponseModel { +impl ServiceAccountPeopleAccessPoliciesResponseModel { + pub fn new() -> ServiceAccountPeopleAccessPoliciesResponseModel { + ServiceAccountPeopleAccessPoliciesResponseModel { object: None, user_access_policies: None, group_access_policies: None, diff --git a/crates/bitwarden-api-api/src/models/service_account_project_access_policy_response_model.rs b/crates/bitwarden-api-api/src/models/service_account_project_access_policy_response_model.rs index f734f6538..8eb850e01 100644 --- a/crates/bitwarden-api-api/src/models/service_account_project_access_policy_response_model.rs +++ b/crates/bitwarden-api-api/src/models/service_account_project_access_policy_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceAccountProjectAccessPolicyResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/service_account_project_access_policy_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/service_account_project_access_policy_response_model_list_response_model.rs index 307f2b333..531970536 100644 --- a/crates/bitwarden-api-api/src/models/service_account_project_access_policy_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/service_account_project_access_policy_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceAccountProjectAccessPolicyResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/service_account_response_model.rs b/crates/bitwarden-api-api/src/models/service_account_response_model.rs index ec43e6014..0cba8669a 100644 --- a/crates/bitwarden-api-api/src/models/service_account_response_model.rs +++ b/crates/bitwarden-api-api/src/models/service_account_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceAccountResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/service_account_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/service_account_response_model_list_response_model.rs deleted file mode 100644 index 41ad4c28a..000000000 --- a/crates/bitwarden-api-api/src/models/service_account_response_model_list_response_model.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Bitwarden Internal API - * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: latest - * - * Generated by: https://openapi-generator.tech - */ - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct ServiceAccountResponseModelListResponseModel { - #[serde(rename = "object", skip_serializing_if = "Option::is_none")] - pub object: Option, - #[serde(rename = "data", skip_serializing_if = "Option::is_none")] - pub data: Option>, - #[serde(rename = "continuationToken", skip_serializing_if = "Option::is_none")] - pub continuation_token: Option, -} - -impl ServiceAccountResponseModelListResponseModel { - pub fn new() -> ServiceAccountResponseModelListResponseModel { - ServiceAccountResponseModelListResponseModel { - object: None, - data: None, - continuation_token: None, - } - } -} diff --git a/crates/bitwarden-api-api/src/models/service_account_secrets_details_response_model.rs b/crates/bitwarden-api-api/src/models/service_account_secrets_details_response_model.rs index 5be4d8bb1..f8b8ce339 100644 --- a/crates/bitwarden-api-api/src/models/service_account_secrets_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/service_account_secrets_details_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceAccountSecretsDetailsResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/service_account_secrets_details_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/service_account_secrets_details_response_model_list_response_model.rs index 5edfbefba..81ac10efa 100644 --- a/crates/bitwarden-api-api/src/models/service_account_secrets_details_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/service_account_secrets_details_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceAccountSecretsDetailsResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/service_account_update_request_model.rs b/crates/bitwarden-api-api/src/models/service_account_update_request_model.rs index 842760819..400617ed8 100644 --- a/crates/bitwarden-api-api/src/models/service_account_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/service_account_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ServiceAccountUpdateRequestModel { #[serde(rename = "name")] pub name: String, diff --git a/crates/bitwarden-api-api/src/models/set_key_connector_key_request_model.rs b/crates/bitwarden-api-api/src/models/set_key_connector_key_request_model.rs index a39326e05..8da90aa4e 100644 --- a/crates/bitwarden-api-api/src/models/set_key_connector_key_request_model.rs +++ b/crates/bitwarden-api-api/src/models/set_key_connector_key_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SetKeyConnectorKeyRequestModel { #[serde(rename = "key")] pub key: String, diff --git a/crates/bitwarden-api-api/src/models/set_password_request_model.rs b/crates/bitwarden-api-api/src/models/set_password_request_model.rs index f7b3e3e61..30b04c9fc 100644 --- a/crates/bitwarden-api-api/src/models/set_password_request_model.rs +++ b/crates/bitwarden-api-api/src/models/set_password_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SetPasswordRequestModel { #[serde(rename = "masterPasswordHash")] pub master_password_hash: String, @@ -16,8 +16,8 @@ pub struct SetPasswordRequestModel { pub key: String, #[serde(rename = "masterPasswordHint", skip_serializing_if = "Option::is_none")] pub master_password_hint: Option, - #[serde(rename = "keys")] - pub keys: Box, + #[serde(rename = "keys", skip_serializing_if = "Option::is_none")] + pub keys: Option>, #[serde(rename = "kdf")] pub kdf: crate::models::KdfType, #[serde(rename = "kdfIterations")] @@ -34,7 +34,6 @@ impl SetPasswordRequestModel { pub fn new( master_password_hash: String, key: String, - keys: crate::models::KeysRequestModel, kdf: crate::models::KdfType, kdf_iterations: i32, ) -> SetPasswordRequestModel { @@ -42,7 +41,7 @@ impl SetPasswordRequestModel { master_password_hash, key, master_password_hint: None, - keys: Box::new(keys), + keys: None, kdf, kdf_iterations, kdf_memory: None, diff --git a/crates/bitwarden-api-api/src/models/sm_export_response_model.rs b/crates/bitwarden-api-api/src/models/sm_export_response_model.rs index 60ab8697c..71f821254 100644 --- a/crates/bitwarden-api-api/src/models/sm_export_response_model.rs +++ b/crates/bitwarden-api-api/src/models/sm_export_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SmExportResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/sm_import_request_model.rs b/crates/bitwarden-api-api/src/models/sm_import_request_model.rs index 431a87fe4..68e53efbb 100644 --- a/crates/bitwarden-api-api/src/models/sm_import_request_model.rs +++ b/crates/bitwarden-api-api/src/models/sm_import_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SmImportRequestModel { #[serde(rename = "projects", skip_serializing_if = "Option::is_none")] pub projects: Option>, diff --git a/crates/bitwarden-api-api/src/models/sso_configuration_data.rs b/crates/bitwarden-api-api/src/models/sso_configuration_data.rs index 2d898488e..1cf5ea714 100644 --- a/crates/bitwarden-api-api/src/models/sso_configuration_data.rs +++ b/crates/bitwarden-api-api/src/models/sso_configuration_data.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SsoConfigurationData { #[serde(rename = "configType", skip_serializing_if = "Option::is_none")] pub config_type: Option, @@ -108,6 +108,8 @@ pub struct SsoConfigurationData { skip_serializing_if = "Option::is_none" )] pub idp_want_authn_requests_signed: Option, + #[serde(rename = "spUniqueEntityId", skip_serializing_if = "Option::is_none")] + pub sp_unique_entity_id: Option, #[serde(rename = "spNameIdFormat", skip_serializing_if = "Option::is_none")] pub sp_name_id_format: Option, #[serde( @@ -163,6 +165,7 @@ impl SsoConfigurationData { idp_disable_outbound_logout_requests: None, idp_outbound_signing_algorithm: None, idp_want_authn_requests_signed: None, + sp_unique_entity_id: None, sp_name_id_format: None, sp_outbound_signing_algorithm: None, sp_signing_behavior: None, diff --git a/crates/bitwarden-api-api/src/models/sso_configuration_data_request.rs b/crates/bitwarden-api-api/src/models/sso_configuration_data_request.rs index 8e6f18ced..7b26413c8 100644 --- a/crates/bitwarden-api-api/src/models/sso_configuration_data_request.rs +++ b/crates/bitwarden-api-api/src/models/sso_configuration_data_request.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SsoConfigurationDataRequest { #[serde(rename = "configType")] pub config_type: crate::models::SsoType, @@ -63,6 +63,8 @@ pub struct SsoConfigurationDataRequest { skip_serializing_if = "Option::is_none" )] pub expected_return_acr_value: Option, + #[serde(rename = "spUniqueEntityId", skip_serializing_if = "Option::is_none")] + pub sp_unique_entity_id: Option, #[serde(rename = "spNameIdFormat", skip_serializing_if = "Option::is_none")] pub sp_name_id_format: Option, #[serde( @@ -149,6 +151,7 @@ impl SsoConfigurationDataRequest { additional_name_claim_types: None, acr_values: None, expected_return_acr_value: None, + sp_unique_entity_id: None, sp_name_id_format: None, sp_outbound_signing_algorithm: None, sp_signing_behavior: None, diff --git a/crates/bitwarden-api-api/src/models/sso_type.rs b/crates/bitwarden-api-api/src/models/sso_type.rs index 3e1aefa4d..9ff337676 100644 --- a/crates/bitwarden-api-api/src/models/sso_type.rs +++ b/crates/bitwarden-api-api/src/models/sso_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum SsoType { - Variant1 = 1, - Variant2 = 2, + OpenIdConnect = 1, + Saml2 = 2, } impl ToString for SsoType { fn to_string(&self) -> String { match self { - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), + Self::OpenIdConnect => String::from("1"), + Self::Saml2 => String::from("2"), } } } impl Default for SsoType { fn default() -> SsoType { - Self::Variant1 + Self::OpenIdConnect } } diff --git a/crates/bitwarden-api-api/src/models/sso_urls.rs b/crates/bitwarden-api-api/src/models/sso_urls.rs index 45bb286f0..fa0b03cfb 100644 --- a/crates/bitwarden-api-api/src/models/sso_urls.rs +++ b/crates/bitwarden-api-api/src/models/sso_urls.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SsoUrls { #[serde(rename = "callbackPath", skip_serializing_if = "Option::is_none")] pub callback_path: Option, @@ -19,6 +19,8 @@ pub struct SsoUrls { pub signed_out_callback_path: Option, #[serde(rename = "spEntityId", skip_serializing_if = "Option::is_none")] pub sp_entity_id: Option, + #[serde(rename = "spEntityIdStatic", skip_serializing_if = "Option::is_none")] + pub sp_entity_id_static: Option, #[serde(rename = "spMetadataUrl", skip_serializing_if = "Option::is_none")] pub sp_metadata_url: Option, #[serde(rename = "spAcsUrl", skip_serializing_if = "Option::is_none")] @@ -31,6 +33,7 @@ impl SsoUrls { callback_path: None, signed_out_callback_path: None, sp_entity_id: None, + sp_entity_id_static: None, sp_metadata_url: None, sp_acs_url: None, } diff --git a/crates/bitwarden-api-api/src/models/storage_request_model.rs b/crates/bitwarden-api-api/src/models/storage_request_model.rs index 5625f8874..8d7778a73 100644 --- a/crates/bitwarden-api-api/src/models/storage_request_model.rs +++ b/crates/bitwarden-api-api/src/models/storage_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct StorageRequestModel { #[serde(rename = "storageGbAdjustment")] pub storage_gb_adjustment: i32, diff --git a/crates/bitwarden-api-api/src/models/subscription_response_model.rs b/crates/bitwarden-api-api/src/models/subscription_response_model.rs index c21cbdbea..a3d80dba3 100644 --- a/crates/bitwarden-api-api/src/models/subscription_response_model.rs +++ b/crates/bitwarden-api-api/src/models/subscription_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SubscriptionResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, @@ -22,14 +22,10 @@ pub struct SubscriptionResponseModel { pub upcoming_invoice: Option>, #[serde(rename = "subscription", skip_serializing_if = "Option::is_none")] pub subscription: Option>, - #[serde(rename = "discount", skip_serializing_if = "Option::is_none")] - pub discount: Option>, #[serde(rename = "license", skip_serializing_if = "Option::is_none")] pub license: Option>, #[serde(rename = "expiration", skip_serializing_if = "Option::is_none")] pub expiration: Option, - #[serde(rename = "usingInAppPurchase", skip_serializing_if = "Option::is_none")] - pub using_in_app_purchase: Option, } impl SubscriptionResponseModel { @@ -41,10 +37,8 @@ impl SubscriptionResponseModel { max_storage_gb: None, upcoming_invoice: None, subscription: None, - discount: None, license: None, expiration: None, - using_in_app_purchase: None, } } } diff --git a/crates/bitwarden-api-api/src/models/sync_response_model.rs b/crates/bitwarden-api-api/src/models/sync_response_model.rs index 60b1d5f7b..757cecc14 100644 --- a/crates/bitwarden-api-api/src/models/sync_response_model.rs +++ b/crates/bitwarden-api-api/src/models/sync_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct SyncResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/tax_info_response_model.rs b/crates/bitwarden-api-api/src/models/tax_info_response_model.rs index 344e80f45..e7825b67c 100644 --- a/crates/bitwarden-api-api/src/models/tax_info_response_model.rs +++ b/crates/bitwarden-api-api/src/models/tax_info_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TaxInfoResponseModel { #[serde(rename = "taxIdNumber", skip_serializing_if = "Option::is_none")] pub tax_id_number: Option, diff --git a/crates/bitwarden-api-api/src/models/tax_info_update_request_model.rs b/crates/bitwarden-api-api/src/models/tax_info_update_request_model.rs index 969528e53..153fb27b0 100644 --- a/crates/bitwarden-api-api/src/models/tax_info_update_request_model.rs +++ b/crates/bitwarden-api-api/src/models/tax_info_update_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TaxInfoUpdateRequestModel { #[serde(rename = "country")] pub country: String, diff --git a/crates/bitwarden-api-api/src/models/tax_rate_response_model.rs b/crates/bitwarden-api-api/src/models/tax_rate_response_model.rs index 3ae819bf6..3980008c3 100644 --- a/crates/bitwarden-api-api/src/models/tax_rate_response_model.rs +++ b/crates/bitwarden-api-api/src/models/tax_rate_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TaxRateResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/tax_rate_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/tax_rate_response_model_list_response_model.rs index 5c23891b1..496b713ff 100644 --- a/crates/bitwarden-api-api/src/models/tax_rate_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/tax_rate_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TaxRateResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/transaction_type.rs b/crates/bitwarden-api-api/src/models/transaction_type.rs index c9cda7c76..1bb69ccbb 100644 --- a/crates/bitwarden-api-api/src/models/transaction_type.rs +++ b/crates/bitwarden-api-api/src/models/transaction_type.rs @@ -14,27 +14,27 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum TransactionType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, + Charge = 0, + Credit = 1, + PromotionalCredit = 2, + ReferralCredit = 3, + Refund = 4, } impl ToString for TransactionType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), + Self::Charge => String::from("0"), + Self::Credit => String::from("1"), + Self::PromotionalCredit => String::from("2"), + Self::ReferralCredit => String::from("3"), + Self::Refund => String::from("4"), } } } impl Default for TransactionType { fn default() -> TransactionType { - Self::Variant0 + Self::Charge } } diff --git a/crates/bitwarden-api-api/src/models/two_factor_authenticator_response_model.rs b/crates/bitwarden-api-api/src/models/two_factor_authenticator_response_model.rs index dde60927c..cf2707e15 100644 --- a/crates/bitwarden-api-api/src/models/two_factor_authenticator_response_model.rs +++ b/crates/bitwarden-api-api/src/models/two_factor_authenticator_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwoFactorAuthenticatorResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/two_factor_duo_response_model.rs b/crates/bitwarden-api-api/src/models/two_factor_duo_response_model.rs index 833a98a3d..e0afc8212 100644 --- a/crates/bitwarden-api-api/src/models/two_factor_duo_response_model.rs +++ b/crates/bitwarden-api-api/src/models/two_factor_duo_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwoFactorDuoResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/two_factor_email_request_model.rs b/crates/bitwarden-api-api/src/models/two_factor_email_request_model.rs index 614ad8f80..7d121412a 100644 --- a/crates/bitwarden-api-api/src/models/two_factor_email_request_model.rs +++ b/crates/bitwarden-api-api/src/models/two_factor_email_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwoFactorEmailRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/two_factor_email_response_model.rs b/crates/bitwarden-api-api/src/models/two_factor_email_response_model.rs index afbbafd8d..a976dba0f 100644 --- a/crates/bitwarden-api-api/src/models/two_factor_email_response_model.rs +++ b/crates/bitwarden-api-api/src/models/two_factor_email_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwoFactorEmailResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/two_factor_provider_request_model.rs b/crates/bitwarden-api-api/src/models/two_factor_provider_request_model.rs index 7c9b231b0..7b22d2a6b 100644 --- a/crates/bitwarden-api-api/src/models/two_factor_provider_request_model.rs +++ b/crates/bitwarden-api-api/src/models/two_factor_provider_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwoFactorProviderRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/two_factor_provider_response_model.rs b/crates/bitwarden-api-api/src/models/two_factor_provider_response_model.rs index dbca32167..0c97a3088 100644 --- a/crates/bitwarden-api-api/src/models/two_factor_provider_response_model.rs +++ b/crates/bitwarden-api-api/src/models/two_factor_provider_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwoFactorProviderResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/two_factor_provider_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/two_factor_provider_response_model_list_response_model.rs index 7b71fee31..73a7b4d57 100644 --- a/crates/bitwarden-api-api/src/models/two_factor_provider_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/two_factor_provider_response_model_list_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwoFactorProviderResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/two_factor_provider_type.rs b/crates/bitwarden-api-api/src/models/two_factor_provider_type.rs index 00188f0fd..94d20ee2a 100644 --- a/crates/bitwarden-api-api/src/models/two_factor_provider_type.rs +++ b/crates/bitwarden-api-api/src/models/two_factor_provider_type.rs @@ -14,33 +14,33 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum TwoFactorProviderType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, - Variant6 = 6, - Variant7 = 7, + Authenticator = 0, + Email = 1, + Duo = 2, + YubiKey = 3, + U2f = 4, + Remember = 5, + OrganizationDuo = 6, + WebAuthn = 7, } impl ToString for TwoFactorProviderType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), - Self::Variant6 => String::from("6"), - Self::Variant7 => String::from("7"), + Self::Authenticator => String::from("0"), + Self::Email => String::from("1"), + Self::Duo => String::from("2"), + Self::YubiKey => String::from("3"), + Self::U2f => String::from("4"), + Self::Remember => String::from("5"), + Self::OrganizationDuo => String::from("6"), + Self::WebAuthn => String::from("7"), } } } impl Default for TwoFactorProviderType { fn default() -> TwoFactorProviderType { - Self::Variant0 + Self::Authenticator } } diff --git a/crates/bitwarden-api-api/src/models/two_factor_recover_response_model.rs b/crates/bitwarden-api-api/src/models/two_factor_recover_response_model.rs index 2267c134a..c35ce8a17 100644 --- a/crates/bitwarden-api-api/src/models/two_factor_recover_response_model.rs +++ b/crates/bitwarden-api-api/src/models/two_factor_recover_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwoFactorRecoverResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/two_factor_recovery_request_model.rs b/crates/bitwarden-api-api/src/models/two_factor_recovery_request_model.rs index 2ceb17a83..425d528b3 100644 --- a/crates/bitwarden-api-api/src/models/two_factor_recovery_request_model.rs +++ b/crates/bitwarden-api-api/src/models/two_factor_recovery_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwoFactorRecoveryRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/two_factor_web_authn_delete_request_model.rs b/crates/bitwarden-api-api/src/models/two_factor_web_authn_delete_request_model.rs index f104792fd..e981d0e5d 100644 --- a/crates/bitwarden-api-api/src/models/two_factor_web_authn_delete_request_model.rs +++ b/crates/bitwarden-api-api/src/models/two_factor_web_authn_delete_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwoFactorWebAuthnDeleteRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/two_factor_web_authn_request_model.rs b/crates/bitwarden-api-api/src/models/two_factor_web_authn_request_model.rs index 34c7e1a9b..2139ad022 100644 --- a/crates/bitwarden-api-api/src/models/two_factor_web_authn_request_model.rs +++ b/crates/bitwarden-api-api/src/models/two_factor_web_authn_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwoFactorWebAuthnRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/two_factor_web_authn_response_model.rs b/crates/bitwarden-api-api/src/models/two_factor_web_authn_response_model.rs index 96cb72e96..c372f2f45 100644 --- a/crates/bitwarden-api-api/src/models/two_factor_web_authn_response_model.rs +++ b/crates/bitwarden-api-api/src/models/two_factor_web_authn_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwoFactorWebAuthnResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/two_factor_yubi_key_response_model.rs b/crates/bitwarden-api-api/src/models/two_factor_yubi_key_response_model.rs index 1fecc82f3..f2122d29a 100644 --- a/crates/bitwarden-api-api/src/models/two_factor_yubi_key_response_model.rs +++ b/crates/bitwarden-api-api/src/models/two_factor_yubi_key_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct TwoFactorYubiKeyResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/update_avatar_request_model.rs b/crates/bitwarden-api-api/src/models/update_avatar_request_model.rs index ea00c08c5..ea648983e 100644 --- a/crates/bitwarden-api-api/src/models/update_avatar_request_model.rs +++ b/crates/bitwarden-api-api/src/models/update_avatar_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateAvatarRequestModel { #[serde(rename = "avatarColor", skip_serializing_if = "Option::is_none")] pub avatar_color: Option, diff --git a/crates/bitwarden-api-api/src/models/update_devices_trust_request_model.rs b/crates/bitwarden-api-api/src/models/update_devices_trust_request_model.rs index e4d381d51..ab69cf249 100644 --- a/crates/bitwarden-api-api/src/models/update_devices_trust_request_model.rs +++ b/crates/bitwarden-api-api/src/models/update_devices_trust_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateDevicesTrustRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/update_domains_request_model.rs b/crates/bitwarden-api-api/src/models/update_domains_request_model.rs index 9c651953d..7bf75cb8a 100644 --- a/crates/bitwarden-api-api/src/models/update_domains_request_model.rs +++ b/crates/bitwarden-api-api/src/models/update_domains_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateDomainsRequestModel { #[serde(rename = "equivalentDomains", skip_serializing_if = "Option::is_none")] pub equivalent_domains: Option>>, diff --git a/crates/bitwarden-api-api/src/models/update_key_request_model.rs b/crates/bitwarden-api-api/src/models/update_key_request_model.rs index 155679c8b..c6b298251 100644 --- a/crates/bitwarden-api-api/src/models/update_key_request_model.rs +++ b/crates/bitwarden-api-api/src/models/update_key_request_model.rs @@ -8,37 +8,44 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateKeyRequestModel { #[serde(rename = "masterPasswordHash")] pub master_password_hash: String, - #[serde(rename = "ciphers")] - pub ciphers: Vec, - #[serde(rename = "folders")] - pub folders: Vec, - #[serde(rename = "sends", skip_serializing_if = "Option::is_none")] - pub sends: Option>, - #[serde(rename = "privateKey")] - pub private_key: String, #[serde(rename = "key")] pub key: String, + #[serde(rename = "privateKey")] + pub private_key: String, + #[serde(rename = "ciphers", skip_serializing_if = "Option::is_none")] + pub ciphers: Option>, + #[serde(rename = "folders", skip_serializing_if = "Option::is_none")] + pub folders: Option>, + #[serde(rename = "sends", skip_serializing_if = "Option::is_none")] + pub sends: Option>, + #[serde( + rename = "emergencyAccessKeys", + skip_serializing_if = "Option::is_none" + )] + pub emergency_access_keys: Option>, + #[serde(rename = "resetPasswordKeys", skip_serializing_if = "Option::is_none")] + pub reset_password_keys: Option>, } impl UpdateKeyRequestModel { pub fn new( master_password_hash: String, - ciphers: Vec, - folders: Vec, - private_key: String, key: String, + private_key: String, ) -> UpdateKeyRequestModel { UpdateKeyRequestModel { master_password_hash, - ciphers, - folders, - sends: None, - private_key, key, + private_key, + ciphers: None, + folders: None, + sends: None, + emergency_access_keys: None, + reset_password_keys: None, } } } diff --git a/crates/bitwarden-api-api/src/models/update_profile_request_model.rs b/crates/bitwarden-api-api/src/models/update_profile_request_model.rs index 06677e170..deb6a9d9e 100644 --- a/crates/bitwarden-api-api/src/models/update_profile_request_model.rs +++ b/crates/bitwarden-api-api/src/models/update_profile_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateProfileRequestModel { #[serde(rename = "name", skip_serializing_if = "Option::is_none")] pub name: Option, diff --git a/crates/bitwarden-api-api/src/models/update_temp_password_request_model.rs b/crates/bitwarden-api-api/src/models/update_temp_password_request_model.rs index abc8b00ca..40eebaab9 100644 --- a/crates/bitwarden-api-api/src/models/update_temp_password_request_model.rs +++ b/crates/bitwarden-api-api/src/models/update_temp_password_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateTempPasswordRequestModel { #[serde(rename = "newMasterPasswordHash")] pub new_master_password_hash: String, diff --git a/crates/bitwarden-api-api/src/models/update_two_factor_authenticator_request_model.rs b/crates/bitwarden-api-api/src/models/update_two_factor_authenticator_request_model.rs index c4e267218..245993415 100644 --- a/crates/bitwarden-api-api/src/models/update_two_factor_authenticator_request_model.rs +++ b/crates/bitwarden-api-api/src/models/update_two_factor_authenticator_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateTwoFactorAuthenticatorRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/update_two_factor_duo_request_model.rs b/crates/bitwarden-api-api/src/models/update_two_factor_duo_request_model.rs index 4bab5acb9..55a168af3 100644 --- a/crates/bitwarden-api-api/src/models/update_two_factor_duo_request_model.rs +++ b/crates/bitwarden-api-api/src/models/update_two_factor_duo_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateTwoFactorDuoRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/update_two_factor_email_request_model.rs b/crates/bitwarden-api-api/src/models/update_two_factor_email_request_model.rs index 93328b7c8..1dc4f190c 100644 --- a/crates/bitwarden-api-api/src/models/update_two_factor_email_request_model.rs +++ b/crates/bitwarden-api-api/src/models/update_two_factor_email_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateTwoFactorEmailRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/update_two_factor_yubico_otp_request_model.rs b/crates/bitwarden-api-api/src/models/update_two_factor_yubico_otp_request_model.rs index eddf00bfc..19c5e37ba 100644 --- a/crates/bitwarden-api-api/src/models/update_two_factor_yubico_otp_request_model.rs +++ b/crates/bitwarden-api-api/src/models/update_two_factor_yubico_otp_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateTwoFactorYubicoOtpRequestModel { #[serde(rename = "masterPasswordHash", skip_serializing_if = "Option::is_none")] pub master_password_hash: Option, diff --git a/crates/bitwarden-api-api/src/models/uri_match_type.rs b/crates/bitwarden-api-api/src/models/uri_match_type.rs index f4ee450c1..6ccf82edb 100644 --- a/crates/bitwarden-api-api/src/models/uri_match_type.rs +++ b/crates/bitwarden-api-api/src/models/uri_match_type.rs @@ -14,29 +14,29 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum UriMatchType { - Variant0 = 0, - Variant1 = 1, - Variant2 = 2, - Variant3 = 3, - Variant4 = 4, - Variant5 = 5, + Domain = 0, + Host = 1, + StartsWith = 2, + Exact = 3, + RegularExpression = 4, + Never = 5, } impl ToString for UriMatchType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - Self::Variant4 => String::from("4"), - Self::Variant5 => String::from("5"), + Self::Domain => String::from("0"), + Self::Host => String::from("1"), + Self::StartsWith => String::from("2"), + Self::Exact => String::from("3"), + Self::RegularExpression => String::from("4"), + Self::Never => String::from("5"), } } } impl Default for UriMatchType { fn default() -> UriMatchType { - Self::Variant0 + Self::Domain } } diff --git a/crates/bitwarden-api-api/src/models/user.rs b/crates/bitwarden-api-api/src/models/user.rs index e0ac14ed7..470a2837f 100644 --- a/crates/bitwarden-api-api/src/models/user.rs +++ b/crates/bitwarden-api-api/src/models/user.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct User { #[serde(rename = "email", skip_serializing_if = "Option::is_none")] pub email: Option, diff --git a/crates/bitwarden-api-api/src/models/user_key_response_model.rs b/crates/bitwarden-api-api/src/models/user_key_response_model.rs index 66bba4d5c..bb70b620d 100644 --- a/crates/bitwarden-api-api/src/models/user_key_response_model.rs +++ b/crates/bitwarden-api-api/src/models/user_key_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UserKeyResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-api/src/models/user_license.rs b/crates/bitwarden-api-api/src/models/user_license.rs index 3ec9ef334..508222fb7 100644 --- a/crates/bitwarden-api-api/src/models/user_license.rs +++ b/crates/bitwarden-api-api/src/models/user_license.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UserLicense { #[serde(rename = "licenseKey", skip_serializing_if = "Option::is_none")] pub license_key: Option, diff --git a/crates/bitwarden-api-api/src/models/user_project_access_policy_response_model.rs b/crates/bitwarden-api-api/src/models/user_project_access_policy_response_model.rs index f4a6d96ca..280657ec1 100644 --- a/crates/bitwarden-api-api/src/models/user_project_access_policy_response_model.rs +++ b/crates/bitwarden-api-api/src/models/user_project_access_policy_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UserProjectAccessPolicyResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, @@ -33,6 +33,8 @@ pub struct UserProjectAccessPolicyResponseModel { pub user_id: Option, #[serde(rename = "grantedProjectId", skip_serializing_if = "Option::is_none")] pub granted_project_id: Option, + #[serde(rename = "currentUser", skip_serializing_if = "Option::is_none")] + pub current_user: Option, } impl UserProjectAccessPolicyResponseModel { @@ -48,6 +50,7 @@ impl UserProjectAccessPolicyResponseModel { organization_user_name: None, user_id: None, granted_project_id: None, + current_user: None, } } } diff --git a/crates/bitwarden-api-api/src/models/user_service_account_access_policy_response_model.rs b/crates/bitwarden-api-api/src/models/user_service_account_access_policy_response_model.rs index dada10c97..a69bb2a7c 100644 --- a/crates/bitwarden-api-api/src/models/user_service_account_access_policy_response_model.rs +++ b/crates/bitwarden-api-api/src/models/user_service_account_access_policy_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct UserServiceAccountAccessPolicyResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, @@ -36,6 +36,8 @@ pub struct UserServiceAccountAccessPolicyResponseModel { skip_serializing_if = "Option::is_none" )] pub granted_service_account_id: Option, + #[serde(rename = "currentUser", skip_serializing_if = "Option::is_none")] + pub current_user: Option, } impl UserServiceAccountAccessPolicyResponseModel { @@ -51,6 +53,7 @@ impl UserServiceAccountAccessPolicyResponseModel { organization_user_name: None, user_id: None, granted_service_account_id: None, + current_user: None, } } } diff --git a/crates/bitwarden-api-api/src/models/user_verification_requirement.rs b/crates/bitwarden-api-api/src/models/user_verification_requirement.rs new file mode 100644 index 000000000..647b1f9b9 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/user_verification_requirement.rs @@ -0,0 +1,36 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UserVerificationRequirement { + #[serde(rename = "required")] + Required, + #[serde(rename = "preferred")] + Preferred, + #[serde(rename = "discouraged")] + Discouraged, +} + +impl ToString for UserVerificationRequirement { + fn to_string(&self) -> String { + match self { + Self::Required => String::from("required"), + Self::Preferred => String::from("preferred"), + Self::Discouraged => String::from("discouraged"), + } + } +} + +impl Default for UserVerificationRequirement { + fn default() -> UserVerificationRequirement { + Self::Required + } +} diff --git a/crates/bitwarden-api-api/src/models/verify_delete_recover_request_model.rs b/crates/bitwarden-api-api/src/models/verify_delete_recover_request_model.rs index ac4ec4902..0ad0e127c 100644 --- a/crates/bitwarden-api-api/src/models/verify_delete_recover_request_model.rs +++ b/crates/bitwarden-api-api/src/models/verify_delete_recover_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct VerifyDeleteRecoverRequestModel { #[serde(rename = "userId")] pub user_id: String, diff --git a/crates/bitwarden-api-api/src/models/verify_email_request_model.rs b/crates/bitwarden-api-api/src/models/verify_email_request_model.rs index ce66c6f2c..74304bcca 100644 --- a/crates/bitwarden-api-api/src/models/verify_email_request_model.rs +++ b/crates/bitwarden-api-api/src/models/verify_email_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct VerifyEmailRequestModel { #[serde(rename = "userId")] pub user_id: String, diff --git a/crates/bitwarden-api-api/src/models/verify_otp_request_model.rs b/crates/bitwarden-api-api/src/models/verify_otp_request_model.rs index db57d5f60..6c9be6992 100644 --- a/crates/bitwarden-api-api/src/models/verify_otp_request_model.rs +++ b/crates/bitwarden-api-api/src/models/verify_otp_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct VerifyOtpRequestModel { #[serde(rename = "otp")] pub otp: String, diff --git a/crates/bitwarden-api-api/src/models/web_authn_credential_create_options_response_model.rs b/crates/bitwarden-api-api/src/models/web_authn_credential_create_options_response_model.rs new file mode 100644 index 000000000..f13024a6f --- /dev/null +++ b/crates/bitwarden-api-api/src/models/web_authn_credential_create_options_response_model.rs @@ -0,0 +1,29 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebAuthnCredentialCreateOptionsResponseModel { + #[serde(rename = "object", skip_serializing_if = "Option::is_none")] + pub object: Option, + #[serde(rename = "options", skip_serializing_if = "Option::is_none")] + pub options: Option>, + #[serde(rename = "token", skip_serializing_if = "Option::is_none")] + pub token: Option, +} + +impl WebAuthnCredentialCreateOptionsResponseModel { + pub fn new() -> WebAuthnCredentialCreateOptionsResponseModel { + WebAuthnCredentialCreateOptionsResponseModel { + object: None, + options: None, + token: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/web_authn_credential_response_model.rs b/crates/bitwarden-api-api/src/models/web_authn_credential_response_model.rs new file mode 100644 index 000000000..852b3a527 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/web_authn_credential_response_model.rs @@ -0,0 +1,32 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebAuthnCredentialResponseModel { + #[serde(rename = "object", skip_serializing_if = "Option::is_none")] + pub object: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "prfStatus", skip_serializing_if = "Option::is_none")] + pub prf_status: Option, +} + +impl WebAuthnCredentialResponseModel { + pub fn new() -> WebAuthnCredentialResponseModel { + WebAuthnCredentialResponseModel { + object: None, + id: None, + name: None, + prf_status: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/cipher_response_model_list_response_model.rs b/crates/bitwarden-api-api/src/models/web_authn_credential_response_model_list_response_model.rs similarity index 63% rename from crates/bitwarden-api-api/src/models/cipher_response_model_list_response_model.rs rename to crates/bitwarden-api-api/src/models/web_authn_credential_response_model_list_response_model.rs index ca2541930..b0072c62f 100644 --- a/crates/bitwarden-api-api/src/models/cipher_response_model_list_response_model.rs +++ b/crates/bitwarden-api-api/src/models/web_authn_credential_response_model_list_response_model.rs @@ -8,19 +8,19 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct CipherResponseModelListResponseModel { +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebAuthnCredentialResponseModelListResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, #[serde(rename = "data", skip_serializing_if = "Option::is_none")] - pub data: Option>, + pub data: Option>, #[serde(rename = "continuationToken", skip_serializing_if = "Option::is_none")] pub continuation_token: Option, } -impl CipherResponseModelListResponseModel { - pub fn new() -> CipherResponseModelListResponseModel { - CipherResponseModelListResponseModel { +impl WebAuthnCredentialResponseModelListResponseModel { + pub fn new() -> WebAuthnCredentialResponseModelListResponseModel { + WebAuthnCredentialResponseModelListResponseModel { object: None, data: None, continuation_token: None, diff --git a/crates/bitwarden-api-api/src/models/web_authn_login_assertion_options_response_model.rs b/crates/bitwarden-api-api/src/models/web_authn_login_assertion_options_response_model.rs new file mode 100644 index 000000000..27ed6afc4 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/web_authn_login_assertion_options_response_model.rs @@ -0,0 +1,29 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebAuthnLoginAssertionOptionsResponseModel { + #[serde(rename = "object", skip_serializing_if = "Option::is_none")] + pub object: Option, + #[serde(rename = "options", skip_serializing_if = "Option::is_none")] + pub options: Option>, + #[serde(rename = "token", skip_serializing_if = "Option::is_none")] + pub token: Option, +} + +impl WebAuthnLoginAssertionOptionsResponseModel { + pub fn new() -> WebAuthnLoginAssertionOptionsResponseModel { + WebAuthnLoginAssertionOptionsResponseModel { + object: None, + options: None, + token: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/web_authn_login_credential_create_request_model.rs b/crates/bitwarden-api-api/src/models/web_authn_login_credential_create_request_model.rs new file mode 100644 index 000000000..f5565655a --- /dev/null +++ b/crates/bitwarden-api-api/src/models/web_authn_login_credential_create_request_model.rs @@ -0,0 +1,49 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebAuthnLoginCredentialCreateRequestModel { + #[serde(rename = "deviceResponse")] + pub device_response: Box, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "token")] + pub token: String, + #[serde(rename = "supportsPrf")] + pub supports_prf: bool, + #[serde(rename = "encryptedUserKey", skip_serializing_if = "Option::is_none")] + pub encrypted_user_key: Option, + #[serde(rename = "encryptedPublicKey", skip_serializing_if = "Option::is_none")] + pub encrypted_public_key: Option, + #[serde( + rename = "encryptedPrivateKey", + skip_serializing_if = "Option::is_none" + )] + pub encrypted_private_key: Option, +} + +impl WebAuthnLoginCredentialCreateRequestModel { + pub fn new( + device_response: crate::models::AuthenticatorAttestationRawResponse, + name: String, + token: String, + supports_prf: bool, + ) -> WebAuthnLoginCredentialCreateRequestModel { + WebAuthnLoginCredentialCreateRequestModel { + device_response: Box::new(device_response), + name, + token, + supports_prf, + encrypted_user_key: None, + encrypted_public_key: None, + encrypted_private_key: None, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/web_authn_login_credential_update_request_model.rs b/crates/bitwarden-api-api/src/models/web_authn_login_credential_update_request_model.rs new file mode 100644 index 000000000..ce12d0c43 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/web_authn_login_credential_update_request_model.rs @@ -0,0 +1,41 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebAuthnLoginCredentialUpdateRequestModel { + #[serde(rename = "deviceResponse")] + pub device_response: Box, + #[serde(rename = "token")] + pub token: String, + #[serde(rename = "encryptedUserKey")] + pub encrypted_user_key: String, + #[serde(rename = "encryptedPublicKey")] + pub encrypted_public_key: String, + #[serde(rename = "encryptedPrivateKey")] + pub encrypted_private_key: String, +} + +impl WebAuthnLoginCredentialUpdateRequestModel { + pub fn new( + device_response: crate::models::AuthenticatorAssertionRawResponse, + token: String, + encrypted_user_key: String, + encrypted_public_key: String, + encrypted_private_key: String, + ) -> WebAuthnLoginCredentialUpdateRequestModel { + WebAuthnLoginCredentialUpdateRequestModel { + device_response: Box::new(device_response), + token, + encrypted_user_key, + encrypted_public_key, + encrypted_private_key, + } + } +} diff --git a/crates/bitwarden-api-api/src/models/bitwarden_product_type.rs b/crates/bitwarden-api-api/src/models/web_authn_prf_status.rs similarity index 55% rename from crates/bitwarden-api-api/src/models/bitwarden_product_type.rs rename to crates/bitwarden-api-api/src/models/web_authn_prf_status.rs index 2224e9781..074c402dc 100644 --- a/crates/bitwarden-api-api/src/models/bitwarden_product_type.rs +++ b/crates/bitwarden-api-api/src/models/web_authn_prf_status.rs @@ -13,22 +13,24 @@ #[derive( Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] -pub enum BitwardenProductType { - Variant0 = 0, - Variant1 = 1, +pub enum WebAuthnPrfStatus { + Enabled = 0, + Supported = 1, + Unsupported = 2, } -impl ToString for BitwardenProductType { +impl ToString for WebAuthnPrfStatus { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::Enabled => String::from("0"), + Self::Supported => String::from("1"), + Self::Unsupported => String::from("2"), } } } -impl Default for BitwardenProductType { - fn default() -> BitwardenProductType { - Self::Variant0 +impl Default for WebAuthnPrfStatus { + fn default() -> WebAuthnPrfStatus { + Self::Enabled } } diff --git a/crates/bitwarden-api-identity/.openapi-generator/FILES b/crates/bitwarden-api-identity/.openapi-generator/FILES index af978071e..968fd8fe4 100644 --- a/crates/bitwarden-api-identity/.openapi-generator/FILES +++ b/crates/bitwarden-api-identity/.openapi-generator/FILES @@ -7,10 +7,17 @@ src/apis/info_api.rs src/apis/mod.rs src/apis/sso_api.rs src/lib.rs +src/models/assertion_options.rs +src/models/authentication_extensions_client_inputs.rs +src/models/authenticator_transport.rs src/models/kdf_type.rs src/models/keys_request_model.rs src/models/mod.rs src/models/prelogin_request_model.rs src/models/prelogin_response_model.rs +src/models/public_key_credential_descriptor.rs +src/models/public_key_credential_type.rs src/models/register_request_model.rs src/models/register_response_model.rs +src/models/user_verification_requirement.rs +src/models/web_authn_login_assertion_options_response_model.rs diff --git a/crates/bitwarden-api-identity/.openapi-generator/VERSION b/crates/bitwarden-api-identity/.openapi-generator/VERSION index 4be2c727a..4b49d9bb6 100644 --- a/crates/bitwarden-api-identity/.openapi-generator/VERSION +++ b/crates/bitwarden-api-identity/.openapi-generator/VERSION @@ -1 +1 @@ -6.5.0 \ No newline at end of file +7.2.0 \ No newline at end of file diff --git a/crates/bitwarden-api-identity/README.md b/crates/bitwarden-api-identity/README.md index 8288a18e5..bb190aaad 100644 --- a/crates/bitwarden-api-identity/README.md +++ b/crates/bitwarden-api-identity/README.md @@ -26,30 +26,38 @@ bitwarden-api-identity = { path = "./bitwarden-api-identity" } All URIs are relative to _http://localhost_ -| Class | Method | HTTP request | Description | -| ------------- | ----------------------------------------------------------------------------------- | ---------------------------------- | ----------- | -| _AccountsApi_ | [**accounts_prelogin_post**](docs/AccountsApi.md#accounts_prelogin_post) | **POST** /accounts/prelogin | -| _AccountsApi_ | [**accounts_register_post**](docs/AccountsApi.md#accounts_register_post) | **POST** /accounts/register | -| _InfoApi_ | [**alive_get**](docs/InfoApi.md#alive_get) | **GET** /alive | -| _InfoApi_ | [**now_get**](docs/InfoApi.md#now_get) | **GET** /now | -| _InfoApi_ | [**version_get**](docs/InfoApi.md#version_get) | **GET** /version | -| _SsoApi_ | [**account_external_callback_get**](docs/SsoApi.md#account_external_callback_get) | **GET** /account/ExternalCallback | -| _SsoApi_ | [**account_external_challenge_get**](docs/SsoApi.md#account_external_challenge_get) | **GET** /account/ExternalChallenge | -| _SsoApi_ | [**account_login_get**](docs/SsoApi.md#account_login_get) | **GET** /account/Login | -| _SsoApi_ | [**account_pre_validate_get**](docs/SsoApi.md#account_pre_validate_get) | **GET** /account/PreValidate | -| _SsoApi_ | [**sso_external_callback_get**](docs/SsoApi.md#sso_external_callback_get) | **GET** /sso/ExternalCallback | -| _SsoApi_ | [**sso_external_challenge_get**](docs/SsoApi.md#sso_external_challenge_get) | **GET** /sso/ExternalChallenge | -| _SsoApi_ | [**sso_login_get**](docs/SsoApi.md#sso_login_get) | **GET** /sso/Login | -| _SsoApi_ | [**sso_pre_validate_get**](docs/SsoApi.md#sso_pre_validate_get) | **GET** /sso/PreValidate | +| Class | Method | HTTP request | Description | +| ------------- | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ----------- | +| _AccountsApi_ | [**accounts_prelogin_post**](docs/AccountsApi.md#accounts_prelogin_post) | **POST** /accounts/prelogin | +| _AccountsApi_ | [**accounts_register_post**](docs/AccountsApi.md#accounts_register_post) | **POST** /accounts/register | +| _AccountsApi_ | [**accounts_webauthn_assertion_options_get**](docs/AccountsApi.md#accounts_webauthn_assertion_options_get) | **GET** /accounts/webauthn/assertion-options | +| _InfoApi_ | [**alive_get**](docs/InfoApi.md#alive_get) | **GET** /alive | +| _InfoApi_ | [**now_get**](docs/InfoApi.md#now_get) | **GET** /now | +| _InfoApi_ | [**version_get**](docs/InfoApi.md#version_get) | **GET** /version | +| _SsoApi_ | [**account_external_callback_get**](docs/SsoApi.md#account_external_callback_get) | **GET** /account/ExternalCallback | +| _SsoApi_ | [**account_external_challenge_get**](docs/SsoApi.md#account_external_challenge_get) | **GET** /account/ExternalChallenge | +| _SsoApi_ | [**account_login_get**](docs/SsoApi.md#account_login_get) | **GET** /account/Login | +| _SsoApi_ | [**account_pre_validate_get**](docs/SsoApi.md#account_pre_validate_get) | **GET** /account/PreValidate | +| _SsoApi_ | [**sso_external_callback_get**](docs/SsoApi.md#sso_external_callback_get) | **GET** /sso/ExternalCallback | +| _SsoApi_ | [**sso_external_challenge_get**](docs/SsoApi.md#sso_external_challenge_get) | **GET** /sso/ExternalChallenge | +| _SsoApi_ | [**sso_login_get**](docs/SsoApi.md#sso_login_get) | **GET** /sso/Login | +| _SsoApi_ | [**sso_pre_validate_get**](docs/SsoApi.md#sso_pre_validate_get) | **GET** /sso/PreValidate | ## Documentation For Models +- [AssertionOptions](docs/AssertionOptions.md) +- [AuthenticationExtensionsClientInputs](docs/AuthenticationExtensionsClientInputs.md) +- [AuthenticatorTransport](docs/AuthenticatorTransport.md) - [KdfType](docs/KdfType.md) - [KeysRequestModel](docs/KeysRequestModel.md) - [PreloginRequestModel](docs/PreloginRequestModel.md) - [PreloginResponseModel](docs/PreloginResponseModel.md) +- [PublicKeyCredentialDescriptor](docs/PublicKeyCredentialDescriptor.md) +- [PublicKeyCredentialType](docs/PublicKeyCredentialType.md) - [RegisterRequestModel](docs/RegisterRequestModel.md) - [RegisterResponseModel](docs/RegisterResponseModel.md) +- [UserVerificationRequirement](docs/UserVerificationRequirement.md) +- [WebAuthnLoginAssertionOptionsResponseModel](docs/WebAuthnLoginAssertionOptionsResponseModel.md) To get access to the crate's generated documentation, use: diff --git a/crates/bitwarden-api-identity/src/apis/accounts_api.rs b/crates/bitwarden-api-identity/src/apis/accounts_api.rs index efffdae3d..c7b0bd1fd 100644 --- a/crates/bitwarden-api-identity/src/apis/accounts_api.rs +++ b/crates/bitwarden-api-identity/src/apis/accounts_api.rs @@ -27,6 +27,13 @@ pub enum AccountsRegisterPostError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`accounts_webauthn_assertion_options_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AccountsWebauthnAssertionOptionsGetError { + UnknownValue(serde_json::Value), +} + pub async fn accounts_prelogin_post( configuration: &configuration::Configuration, prelogin_request_model: Option, @@ -102,3 +109,45 @@ pub async fn accounts_register_post( Err(Error::ResponseError(local_var_error)) } } + +pub async fn accounts_webauthn_assertion_options_get( + configuration: &configuration::Configuration, +) -> Result< + crate::models::WebAuthnLoginAssertionOptionsResponseModel, + Error, +> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!( + "{}/accounts/webauthn/assertion-options", + local_var_configuration.base_path + ); + let mut local_var_req_builder = + local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = + local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = + serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { + status: local_var_status, + content: local_var_content, + entity: local_var_entity, + }; + Err(Error::ResponseError(local_var_error)) + } +} diff --git a/crates/bitwarden-api-identity/src/apis/configuration.rs b/crates/bitwarden-api-identity/src/apis/configuration.rs index 46cf9212e..6ed785dc7 100644 --- a/crates/bitwarden-api-identity/src/apis/configuration.rs +++ b/crates/bitwarden-api-identity/src/apis/configuration.rs @@ -8,8 +8,6 @@ * Generated by: https://openapi-generator.tech */ -use reqwest; - #[derive(Debug, Clone)] pub struct Configuration { pub base_path: String, diff --git a/crates/bitwarden-api-identity/src/apis/mod.rs b/crates/bitwarden-api-identity/src/apis/mod.rs index f50e7d44a..907fffa89 100644 --- a/crates/bitwarden-api-identity/src/apis/mod.rs +++ b/crates/bitwarden-api-identity/src/apis/mod.rs @@ -60,6 +60,37 @@ pub fn urlencode>(s: T) -> String { ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() } +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + } + serde_json::Value::String(s) => { + params.push((format!("{}[{}]", prefix, key), s.clone())) + } + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + pub mod accounts_api; pub mod info_api; pub mod sso_api; diff --git a/crates/bitwarden-api-identity/src/models/assertion_options.rs b/crates/bitwarden-api-identity/src/models/assertion_options.rs new file mode 100644 index 000000000..f69580f77 --- /dev/null +++ b/crates/bitwarden-api-identity/src/models/assertion_options.rs @@ -0,0 +1,44 @@ +/* + * Bitwarden Identity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AssertionOptions { + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(rename = "errorMessage", skip_serializing_if = "Option::is_none")] + pub error_message: Option, + #[serde(rename = "challenge", skip_serializing_if = "Option::is_none")] + pub challenge: Option, + #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] + pub timeout: Option, + #[serde(rename = "rpId", skip_serializing_if = "Option::is_none")] + pub rp_id: Option, + #[serde(rename = "allowCredentials", skip_serializing_if = "Option::is_none")] + pub allow_credentials: Option>, + #[serde(rename = "userVerification", skip_serializing_if = "Option::is_none")] + pub user_verification: Option, + #[serde(rename = "extensions", skip_serializing_if = "Option::is_none")] + pub extensions: Option>, +} + +impl AssertionOptions { + pub fn new() -> AssertionOptions { + AssertionOptions { + status: None, + error_message: None, + challenge: None, + timeout: None, + rp_id: None, + allow_credentials: None, + user_verification: None, + extensions: None, + } + } +} diff --git a/crates/bitwarden-api-identity/src/models/authentication_extensions_client_inputs.rs b/crates/bitwarden-api-identity/src/models/authentication_extensions_client_inputs.rs new file mode 100644 index 000000000..2677278cc --- /dev/null +++ b/crates/bitwarden-api-identity/src/models/authentication_extensions_client_inputs.rs @@ -0,0 +1,35 @@ +/* + * Bitwarden Identity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AuthenticationExtensionsClientInputs { + #[serde(rename = "example.extension", skip_serializing_if = "Option::is_none")] + pub example_period_extension: Option, + #[serde(rename = "appid", skip_serializing_if = "Option::is_none")] + pub appid: Option, + #[serde(rename = "authnSel", skip_serializing_if = "Option::is_none")] + pub authn_sel: Option>, + #[serde(rename = "exts", skip_serializing_if = "Option::is_none")] + pub exts: Option, + #[serde(rename = "uvm", skip_serializing_if = "Option::is_none")] + pub uvm: Option, +} + +impl AuthenticationExtensionsClientInputs { + pub fn new() -> AuthenticationExtensionsClientInputs { + AuthenticationExtensionsClientInputs { + example_period_extension: None, + appid: None, + authn_sel: None, + exts: None, + uvm: None, + } + } +} diff --git a/crates/bitwarden-api-identity/src/models/authenticator_transport.rs b/crates/bitwarden-api-identity/src/models/authenticator_transport.rs new file mode 100644 index 000000000..bd3881305 --- /dev/null +++ b/crates/bitwarden-api-identity/src/models/authenticator_transport.rs @@ -0,0 +1,39 @@ +/* + * Bitwarden Identity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * Generated by: https://openapi-generator.tech + */ + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum AuthenticatorTransport { + #[serde(rename = "usb")] + Usb, + #[serde(rename = "nfc")] + Nfc, + #[serde(rename = "ble")] + Ble, + #[serde(rename = "internal")] + Internal, +} + +impl ToString for AuthenticatorTransport { + fn to_string(&self) -> String { + match self { + Self::Usb => String::from("usb"), + Self::Nfc => String::from("nfc"), + Self::Ble => String::from("ble"), + Self::Internal => String::from("internal"), + } + } +} + +impl Default for AuthenticatorTransport { + fn default() -> AuthenticatorTransport { + Self::Usb + } +} diff --git a/crates/bitwarden-api-identity/src/models/kdf_type.rs b/crates/bitwarden-api-identity/src/models/kdf_type.rs index 4b6acaef8..733fba272 100644 --- a/crates/bitwarden-api-identity/src/models/kdf_type.rs +++ b/crates/bitwarden-api-identity/src/models/kdf_type.rs @@ -14,21 +14,21 @@ Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr, )] pub enum KdfType { - Variant0 = 0, - Variant1 = 1, + PBKDF2_SHA256 = 0, + Argon2id = 1, } impl ToString for KdfType { fn to_string(&self) -> String { match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), + Self::PBKDF2_SHA256 => String::from("0"), + Self::Argon2id => String::from("1"), } } } impl Default for KdfType { fn default() -> KdfType { - Self::Variant0 + Self::PBKDF2_SHA256 } } diff --git a/crates/bitwarden-api-identity/src/models/keys_request_model.rs b/crates/bitwarden-api-identity/src/models/keys_request_model.rs index ebbb28145..579c08aed 100644 --- a/crates/bitwarden-api-identity/src/models/keys_request_model.rs +++ b/crates/bitwarden-api-identity/src/models/keys_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct KeysRequestModel { #[serde(rename = "publicKey", skip_serializing_if = "Option::is_none")] pub public_key: Option, diff --git a/crates/bitwarden-api-identity/src/models/mod.rs b/crates/bitwarden-api-identity/src/models/mod.rs index 0464a3ea9..715e29686 100644 --- a/crates/bitwarden-api-identity/src/models/mod.rs +++ b/crates/bitwarden-api-identity/src/models/mod.rs @@ -1,3 +1,9 @@ +pub mod assertion_options; +pub use self::assertion_options::AssertionOptions; +pub mod authentication_extensions_client_inputs; +pub use self::authentication_extensions_client_inputs::AuthenticationExtensionsClientInputs; +pub mod authenticator_transport; +pub use self::authenticator_transport::AuthenticatorTransport; pub mod kdf_type; pub use self::kdf_type::KdfType; pub mod keys_request_model; @@ -6,7 +12,15 @@ pub mod prelogin_request_model; pub use self::prelogin_request_model::PreloginRequestModel; pub mod prelogin_response_model; pub use self::prelogin_response_model::PreloginResponseModel; +pub mod public_key_credential_descriptor; +pub use self::public_key_credential_descriptor::PublicKeyCredentialDescriptor; +pub mod public_key_credential_type; +pub use self::public_key_credential_type::PublicKeyCredentialType; pub mod register_request_model; pub use self::register_request_model::RegisterRequestModel; pub mod register_response_model; pub use self::register_response_model::RegisterResponseModel; +pub mod user_verification_requirement; +pub use self::user_verification_requirement::UserVerificationRequirement; +pub mod web_authn_login_assertion_options_response_model; +pub use self::web_authn_login_assertion_options_response_model::WebAuthnLoginAssertionOptionsResponseModel; diff --git a/crates/bitwarden-api-identity/src/models/prelogin_request_model.rs b/crates/bitwarden-api-identity/src/models/prelogin_request_model.rs index e56b1beb1..eb845142b 100644 --- a/crates/bitwarden-api-identity/src/models/prelogin_request_model.rs +++ b/crates/bitwarden-api-identity/src/models/prelogin_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PreloginRequestModel { #[serde(rename = "email")] pub email: String, diff --git a/crates/bitwarden-api-identity/src/models/prelogin_response_model.rs b/crates/bitwarden-api-identity/src/models/prelogin_response_model.rs index 583577ea6..a8935137d 100644 --- a/crates/bitwarden-api-identity/src/models/prelogin_response_model.rs +++ b/crates/bitwarden-api-identity/src/models/prelogin_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct PreloginResponseModel { #[serde(rename = "kdf", skip_serializing_if = "Option::is_none")] pub kdf: Option, diff --git a/crates/bitwarden-api-identity/src/models/public_key_credential_descriptor.rs b/crates/bitwarden-api-identity/src/models/public_key_credential_descriptor.rs new file mode 100644 index 000000000..67a4750ca --- /dev/null +++ b/crates/bitwarden-api-identity/src/models/public_key_credential_descriptor.rs @@ -0,0 +1,29 @@ +/* + * Bitwarden Identity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PublicKeyCredentialDescriptor { + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "transports", skip_serializing_if = "Option::is_none")] + pub transports: Option>, +} + +impl PublicKeyCredentialDescriptor { + pub fn new() -> PublicKeyCredentialDescriptor { + PublicKeyCredentialDescriptor { + r#type: None, + id: None, + transports: None, + } + } +} diff --git a/crates/bitwarden-api-identity/src/models/public_key_credential_type.rs b/crates/bitwarden-api-identity/src/models/public_key_credential_type.rs new file mode 100644 index 000000000..85027f09e --- /dev/null +++ b/crates/bitwarden-api-identity/src/models/public_key_credential_type.rs @@ -0,0 +1,30 @@ +/* + * Bitwarden Identity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * Generated by: https://openapi-generator.tech + */ + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum PublicKeyCredentialType { + #[serde(rename = "public-key")] + PublicKey, +} + +impl ToString for PublicKeyCredentialType { + fn to_string(&self) -> String { + match self { + Self::PublicKey => String::from("public-key"), + } + } +} + +impl Default for PublicKeyCredentialType { + fn default() -> PublicKeyCredentialType { + Self::PublicKey + } +} diff --git a/crates/bitwarden-api-identity/src/models/register_request_model.rs b/crates/bitwarden-api-identity/src/models/register_request_model.rs index 884702a6d..6034235a8 100644 --- a/crates/bitwarden-api-identity/src/models/register_request_model.rs +++ b/crates/bitwarden-api-identity/src/models/register_request_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RegisterRequestModel { #[serde(rename = "name", skip_serializing_if = "Option::is_none")] pub name: Option, diff --git a/crates/bitwarden-api-identity/src/models/register_response_model.rs b/crates/bitwarden-api-identity/src/models/register_response_model.rs index da2b4a79a..d2dbf37be 100644 --- a/crates/bitwarden-api-identity/src/models/register_response_model.rs +++ b/crates/bitwarden-api-identity/src/models/register_response_model.rs @@ -8,7 +8,7 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct RegisterResponseModel { #[serde(rename = "object", skip_serializing_if = "Option::is_none")] pub object: Option, diff --git a/crates/bitwarden-api-identity/src/models/user_verification_requirement.rs b/crates/bitwarden-api-identity/src/models/user_verification_requirement.rs new file mode 100644 index 000000000..ca0ddadb0 --- /dev/null +++ b/crates/bitwarden-api-identity/src/models/user_verification_requirement.rs @@ -0,0 +1,36 @@ +/* + * Bitwarden Identity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * Generated by: https://openapi-generator.tech + */ + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UserVerificationRequirement { + #[serde(rename = "required")] + Required, + #[serde(rename = "preferred")] + Preferred, + #[serde(rename = "discouraged")] + Discouraged, +} + +impl ToString for UserVerificationRequirement { + fn to_string(&self) -> String { + match self { + Self::Required => String::from("required"), + Self::Preferred => String::from("preferred"), + Self::Discouraged => String::from("discouraged"), + } + } +} + +impl Default for UserVerificationRequirement { + fn default() -> UserVerificationRequirement { + Self::Required + } +} diff --git a/crates/bitwarden-api-identity/src/models/web_authn_login_assertion_options_response_model.rs b/crates/bitwarden-api-identity/src/models/web_authn_login_assertion_options_response_model.rs new file mode 100644 index 000000000..199b12111 --- /dev/null +++ b/crates/bitwarden-api-identity/src/models/web_authn_login_assertion_options_response_model.rs @@ -0,0 +1,29 @@ +/* + * Bitwarden Identity + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: v1 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct WebAuthnLoginAssertionOptionsResponseModel { + #[serde(rename = "object", skip_serializing_if = "Option::is_none")] + pub object: Option, + #[serde(rename = "options", skip_serializing_if = "Option::is_none")] + pub options: Option>, + #[serde(rename = "token", skip_serializing_if = "Option::is_none")] + pub token: Option, +} + +impl WebAuthnLoginAssertionOptionsResponseModel { + pub fn new() -> WebAuthnLoginAssertionOptionsResponseModel { + WebAuthnLoginAssertionOptionsResponseModel { + object: None, + options: None, + token: None, + } + } +} diff --git a/crates/bitwarden-c/src/c.rs b/crates/bitwarden-c/src/c.rs index f9ac57f30..934b20359 100644 --- a/crates/bitwarden-c/src/c.rs +++ b/crates/bitwarden-c/src/c.rs @@ -8,7 +8,7 @@ use crate::{box_ptr, ffi_ref}; #[tokio::main] pub async extern "C" fn run_command( c_str_ptr: *const c_char, - client_ptr: *mut Client, + client_ptr: *const Client, ) -> *mut c_char { let client = unsafe { ffi_ref!(client_ptr) }; let input_str = str::from_utf8(unsafe { CStr::from_ptr(c_str_ptr).to_bytes() }).unwrap(); diff --git a/crates/bitwarden-c/src/macros/ffi.rs b/crates/bitwarden-c/src/macros/ffi.rs index 3325838d1..d7384cd48 100644 --- a/crates/bitwarden-c/src/macros/ffi.rs +++ b/crates/bitwarden-c/src/macros/ffi.rs @@ -3,7 +3,7 @@ macro_rules! ffi_ref { ($name:ident) => {{ assert!(!$name.is_null()); - &mut *$name + &*$name }}; } diff --git a/crates/bitwarden-crypto/Cargo.toml b/crates/bitwarden-crypto/Cargo.toml index 6f1de0789..54a9f760e 100644 --- a/crates/bitwarden-crypto/Cargo.toml +++ b/crates/bitwarden-crypto/Cargo.toml @@ -32,6 +32,7 @@ num-bigint = ">=0.4, <0.5" num-traits = ">=0.2.15, <0.3" pbkdf2 = { version = ">=0.12.1, <0.13", default-features = false } rand = ">=0.8.5, <0.9" +rayon = ">=1.8.1, <2.0" rsa = ">=0.9.2, <0.10" schemars = { version = ">=0.8, <0.9", features = ["uuid1"] } serde = { version = ">=1.0, <2.0", features = ["derive"] } diff --git a/crates/bitwarden-crypto/src/aes.rs b/crates/bitwarden-crypto/src/aes.rs index 195b818b7..ee76f9936 100644 --- a/crates/bitwarden-crypto/src/aes.rs +++ b/crates/bitwarden-crypto/src/aes.rs @@ -6,7 +6,9 @@ //! [KeyEncryptable][crate::KeyEncryptable] & [KeyDecryptable][crate::KeyDecryptable] instead. use aes::cipher::{ - block_padding::Pkcs7, typenum::U32, BlockDecryptMut, BlockEncryptMut, KeyIvInit, + block_padding::Pkcs7, + typenum::{U16, U32}, + BlockDecryptMut, BlockEncryptMut, KeyIvInit, }; use generic_array::GenericArray; use hmac::Mac; @@ -109,6 +111,42 @@ fn encrypt_aes256_internal( (iv, data) } +/// Decrypt using AES-128 in CBC mode. +/// +/// Behaves similar to [decrypt_aes128_hmac], but does not validate the MAC. +fn decrypt_aes128(iv: &[u8; 16], data: Vec, key: &GenericArray) -> Result> { + // Decrypt data + let iv = GenericArray::from_slice(iv); + let mut data = data; + let decrypted_key_slice = cbc::Decryptor::::new(key, iv) + .decrypt_padded_mut::(&mut data) + .map_err(|_| CryptoError::KeyDecrypt)?; + + // Data is decrypted in place and returns a subslice of the original Vec, to avoid cloning it, + // we truncate to the subslice length + let decrypted_len = decrypted_key_slice.len(); + data.truncate(decrypted_len); + + Ok(data) +} + +/// Decrypt using AES-128 in CBC mode with MAC. +/// +/// Behaves similar to [decrypt_aes128], but also validates the MAC. +pub fn decrypt_aes128_hmac( + iv: &[u8; 16], + mac: &[u8; 32], + data: Vec, + mac_key: &GenericArray, + key: &GenericArray, +) -> Result> { + let res = generate_mac(mac_key, iv, &data)?; + if res.ct_ne(mac).into() { + return Err(CryptoError::InvalidMac); + } + decrypt_aes128(iv, data, key) +} + /// Generate a MAC using HMAC-SHA256. fn generate_mac(mac_key: &[u8], iv: &[u8], data: &[u8]) -> Result<[u8; 32]> { let mut hmac = PbkdfSha256Hmac::new_from_slice(mac_key).expect("HMAC can take key of any size"); @@ -124,14 +162,17 @@ fn generate_mac(mac_key: &[u8], iv: &[u8], data: &[u8]) -> Result<[u8; 32]> { #[cfg(test)] mod tests { use base64::{engine::general_purpose::STANDARD, Engine}; - use generic_array::sequence::GenericSequence; + use generic_array::{sequence::GenericSequence, ArrayLength}; use rand::SeedableRng; use super::*; /// Helper function for generating a `GenericArray` of size 32 with each element being /// a multiple of a given increment, starting from a given offset. - fn generate_generic_array(offset: u8, increment: u8) -> GenericArray { + fn generate_generic_array>( + offset: u8, + increment: u8, + ) -> GenericArray { GenericArray::generate(|i| offset + i as u8 * increment) } @@ -170,6 +211,19 @@ mod tests { assert_eq!(mac.len(), 32); } + #[test] + fn test_decrypt_aes128() { + let iv = generate_vec(16, 0, 1); + let iv: &[u8; 16] = iv.as_slice().try_into().unwrap(); + let key = generate_generic_array(0, 1); + + let data = STANDARD.decode("dC0X+2IjFbeL4WLLg2jX7Q==").unwrap(); + + let decrypted = decrypt_aes128(iv, data, &key).unwrap(); + + assert_eq!(String::from_utf8(decrypted).unwrap(), "EncryptMe!"); + } + #[test] fn test_decrypt_aes256() { let iv = generate_vec(16, 0, 1); diff --git a/crates/bitwarden-crypto/src/enc_string/symmetric.rs b/crates/bitwarden-crypto/src/enc_string/symmetric.rs index a7768de23..d5489fc96 100644 --- a/crates/bitwarden-crypto/src/enc_string/symmetric.rs +++ b/crates/bitwarden-crypto/src/enc_string/symmetric.rs @@ -236,13 +236,26 @@ impl KeyEncryptable for &[u8] { impl KeyDecryptable> for EncString { fn decrypt_with_key(&self, key: &SymmetricCryptoKey) -> Result> { match self { + EncString::AesCbc256_B64 { iv, data } => { + let dec = crate::aes::decrypt_aes256(iv, data.clone(), &key.key)?; + Ok(dec) + } + EncString::AesCbc128_HmacSha256_B64 { iv, mac, data } => { + // TODO: SymmetricCryptoKey is designed to handle 32 byte keys only, but this + // variant uses a 16 byte key This means the key+mac are going to be + // parsed as a single 32 byte key, at the moment we split it manually + // When refactoring the key handling, this should be fixed. + let enc_key = key.key[0..16].into(); + let mac_key = key.key[16..32].into(); + let dec = crate::aes::decrypt_aes128_hmac(iv, mac, data.clone(), mac_key, enc_key)?; + Ok(dec) + } EncString::AesCbc256_HmacSha256_B64 { iv, mac, data } => { let mac_key = key.mac_key.as_ref().ok_or(CryptoError::InvalidMac)?; let dec = crate::aes::decrypt_aes256_hmac(iv, mac, data.clone(), mac_key, &key.key)?; Ok(dec) } - _ => Err(CryptoError::InvalidKey), } } } @@ -277,7 +290,7 @@ mod tests { use schemars::schema_for; use super::EncString; - use crate::{derive_symmetric_key, KeyDecryptable, KeyEncryptable}; + use crate::{derive_symmetric_key, KeyDecryptable, KeyEncryptable, SymmetricCryptoKey}; #[test] fn test_enc_string_roundtrip() { @@ -343,7 +356,9 @@ mod tests { data, &[93, 118, 241, 43, 16, 211, 135, 233, 150, 136, 221, 71, 140, 125, 141, 215] ); - } + } else { + panic!("Invalid variant") + }; } #[test] @@ -368,7 +383,35 @@ mod tests { data, &[50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69] ); - } + } else { + panic!("Invalid variant") + }; + } + + #[test] + fn test_decrypt_cbc256() { + let key = "hvBMMb1t79YssFZkpetYsM3deyVuQv4r88Uj9gvYe08="; + let key: SymmetricCryptoKey = key.parse().unwrap(); + + let enc_str = "0.NQfjHLr6za7VQVAbrpL81w==|wfrjmyJ0bfwkQlySrhw8dA=="; + let enc_string: EncString = enc_str.parse().unwrap(); + assert_eq!(enc_string.enc_type(), 0); + + let dec_str: String = enc_string.decrypt_with_key(&key).unwrap(); + assert_eq!(dec_str, "EncryptMe!"); + } + + #[test] + fn test_decrypt_cbc128_hmac() { + let key = "Gt1aZ8kTTgkF80bLtb7LiMZBcxEA2FA5mbvV4x7K208="; + let key: SymmetricCryptoKey = key.parse().unwrap(); + + let enc_str = "1.CU/oG4VZuxbHoZSDZjCLQw==|kb1HGwAk+fQ275ORfLf5Ew==|8UaEYHyqRZcG37JWhYBOBdEatEXd1u1/wN7OuImolcM="; + let enc_string: EncString = enc_str.parse().unwrap(); + assert_eq!(enc_string.enc_type(), 1); + + let dec_str: String = enc_string.decrypt_with_key(&key).unwrap(); + assert_eq!(dec_str, "EncryptMe!"); } #[test] diff --git a/crates/bitwarden-crypto/src/encryptable.rs b/crates/bitwarden-crypto/src/encryptable.rs index 9f1256afa..a9882629f 100644 --- a/crates/bitwarden-crypto/src/encryptable.rs +++ b/crates/bitwarden-crypto/src/encryptable.rs @@ -1,10 +1,11 @@ use std::{collections::HashMap, hash::Hash}; +use rayon::prelude::*; use uuid::Uuid; use crate::{CryptoError, KeyDecryptable, KeyEncryptable, Result, SymmetricCryptoKey}; -pub trait KeyContainer { +pub trait KeyContainer: Send + Sync { fn get_key(&self, org_id: &Option) -> Option<&SymmetricCryptoKey>; } @@ -46,37 +47,48 @@ impl + LocateKey, Output> Decrypta } } -impl, Output> Encryptable> for Vec { +impl + Send + Sync, Output: Send + Sync> Encryptable> + for Vec +{ fn encrypt(self, enc: &dyn KeyContainer, org_id: &Option) -> Result> { - self.into_iter().map(|e| e.encrypt(enc, org_id)).collect() + self.into_par_iter() + .map(|e| e.encrypt(enc, org_id)) + .collect() } } -impl, Output> Decryptable> for Vec { +impl + Send + Sync, Output: Send + Sync> Decryptable> + for Vec +{ fn decrypt(&self, enc: &dyn KeyContainer, org_id: &Option) -> Result> { - self.iter().map(|e| e.decrypt(enc, org_id)).collect() + self.into_par_iter() + .map(|e| e.decrypt(enc, org_id)) + .collect() } } -impl, Output, Id: Hash + Eq> Encryptable> - for HashMap +impl + Send + Sync, Output: Send + Sync, Id: Hash + Eq + Send + Sync> + Encryptable> for HashMap { fn encrypt(self, enc: &dyn KeyContainer, org_id: &Option) -> Result> { - self.into_iter() + self.into_par_iter() .map(|(id, e)| Ok((id, e.encrypt(enc, org_id)?))) .collect() } } -impl, Output, Id: Hash + Eq + Copy> Decryptable> - for HashMap +impl< + T: Decryptable + Send + Sync, + Output: Send + Sync, + Id: Hash + Eq + Copy + Send + Sync, + > Decryptable> for HashMap { fn decrypt( &self, enc: &dyn KeyContainer, org_id: &Option, ) -> Result> { - self.iter() + self.into_par_iter() .map(|(id, e)| Ok((*id, e.decrypt(enc, org_id)?))) .collect() } diff --git a/crates/bitwarden-crypto/src/keys/key_encryptable.rs b/crates/bitwarden-crypto/src/keys/key_encryptable.rs index 852b55c62..750647ee8 100644 --- a/crates/bitwarden-crypto/src/keys/key_encryptable.rs +++ b/crates/bitwarden-crypto/src/keys/key_encryptable.rs @@ -1,5 +1,7 @@ use std::{collections::HashMap, hash::Hash}; +use rayon::prelude::*; + use crate::error::Result; pub trait CryptoKey {} @@ -44,37 +46,55 @@ impl, Key: CryptoKey, Output> KeyDecryptable, Key: CryptoKey, Output> KeyEncryptable> - for Vec +impl< + T: KeyEncryptable + Send + Sync, + Key: CryptoKey + Send + Sync, + Output: Send + Sync, + > KeyEncryptable> for Vec { fn encrypt_with_key(self, key: &Key) -> Result> { - self.into_iter().map(|e| e.encrypt_with_key(key)).collect() + self.into_par_iter() + .map(|e| e.encrypt_with_key(key)) + .collect() } } -impl, Key: CryptoKey, Output> KeyDecryptable> - for Vec +impl< + T: KeyDecryptable + Send + Sync, + Key: CryptoKey + Send + Sync, + Output: Send + Sync, + > KeyDecryptable> for Vec { fn decrypt_with_key(&self, key: &Key) -> Result> { - self.iter().map(|e| e.decrypt_with_key(key)).collect() + self.into_par_iter() + .map(|e| e.decrypt_with_key(key)) + .collect() } } -impl, Key: CryptoKey, Output, Id: Hash + Eq> - KeyEncryptable> for HashMap +impl< + T: KeyEncryptable + Send + Sync, + Key: CryptoKey + Send + Sync, + Output: Send + Sync, + Id: Hash + Eq + Send + Sync, + > KeyEncryptable> for HashMap { fn encrypt_with_key(self, key: &Key) -> Result> { - self.into_iter() + self.into_par_iter() .map(|(id, e)| Ok((id, e.encrypt_with_key(key)?))) .collect() } } -impl, Key: CryptoKey, Output, Id: Hash + Eq + Copy> - KeyDecryptable> for HashMap +impl< + T: KeyDecryptable + Send + Sync, + Key: CryptoKey + Send + Sync, + Output: Send + Sync, + Id: Hash + Eq + Copy + Send + Sync, + > KeyDecryptable> for HashMap { fn decrypt_with_key(&self, key: &Key) -> Result> { - self.iter() + self.into_par_iter() .map(|(id, e)| Ok((*id, e.decrypt_with_key(key)?))) .collect() } diff --git a/crates/bitwarden-crypto/src/keys/master_key.rs b/crates/bitwarden-crypto/src/keys/master_key.rs index 0a435ed88..aff403c59 100644 --- a/crates/bitwarden-crypto/src/keys/master_key.rs +++ b/crates/bitwarden-crypto/src/keys/master_key.rs @@ -1,16 +1,11 @@ -use std::{num::NonZeroU32, pin::Pin}; +use std::num::NonZeroU32; -use aes::cipher::typenum::U32; use base64::{engine::general_purpose::STANDARD, Engine}; -use generic_array::GenericArray; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use sha2::Digest; -use crate::{ - util::{self, hkdf_expand}, - EncString, KeyDecryptable, Result, SymmetricCryptoKey, UserKey, -}; +use super::utils::{derive_kdf_key, stretch_kdf_key}; +use crate::{util, EncString, KeyDecryptable, Result, SymmetricCryptoKey, UserKey}; #[derive(Serialize, Deserialize, Debug, JsonSchema, Clone)] #[serde(rename_all = "camelCase", deny_unknown_fields)] @@ -45,7 +40,7 @@ impl MasterKey { /// Derives a users master key from their password, email and KDF. pub fn derive(password: &[u8], email: &[u8], kdf: &Kdf) -> Result { - derive_key(password, email, kdf).map(Self) + derive_kdf_key(password, email, kdf).map(Self) } /// Derive the master key hash, used for local and remote password validation. @@ -62,14 +57,14 @@ impl MasterKey { /// Decrypt the users user key pub fn decrypt_user_key(&self, user_key: EncString) -> Result { - let stretched_key = stretch_master_key(self)?; + let stretched_key = stretch_kdf_key(&self.0)?; let mut dec: Vec = user_key.decrypt_with_key(&stretched_key)?; SymmetricCryptoKey::try_from(dec.as_mut_slice()) } pub fn encrypt_user_key(&self, user_key: &SymmetricCryptoKey) -> Result { - let stretched_key = stretch_master_key(self)?; + let stretched_key = stretch_kdf_key(&self.0)?; EncString::encrypt_aes256_hmac( user_key.to_vec().as_slice(), @@ -89,55 +84,13 @@ fn make_user_key( Ok((UserKey::new(user_key), protected)) } -/// Derive a generic key from a secret and salt using the provided KDF. -fn derive_key(secret: &[u8], salt: &[u8], kdf: &Kdf) -> Result { - let mut hash = match kdf { - Kdf::PBKDF2 { iterations } => crate::util::pbkdf2(secret, salt, iterations.get()), - - Kdf::Argon2id { - iterations, - memory, - parallelism, - } => { - use argon2::*; - - let argon = Argon2::new( - Algorithm::Argon2id, - Version::V0x13, - Params::new( - memory.get() * 1024, // Convert MiB to KiB - iterations.get(), - parallelism.get(), - Some(32), - ) - .unwrap(), - ); - - let salt_sha = sha2::Sha256::new().chain_update(salt).finalize(); - - let mut hash = [0u8; 32]; - argon - .hash_password_into(secret, &salt_sha, &mut hash) - .unwrap(); - hash - } - }; - SymmetricCryptoKey::try_from(hash.as_mut_slice()) -} - -fn stretch_master_key(master_key: &MasterKey) -> Result { - let key: Pin>> = hkdf_expand(&master_key.0.key, Some("enc"))?; - let mac_key: Pin>> = hkdf_expand(&master_key.0.key, Some("mac"))?; - Ok(SymmetricCryptoKey::new(key, Some(mac_key))) -} - #[cfg(test)] mod tests { use std::num::NonZeroU32; use rand::SeedableRng; - use super::{make_user_key, stretch_master_key, HashPurpose, Kdf, MasterKey}; + use super::{make_user_key, HashPurpose, Kdf, MasterKey}; use crate::{keys::symmetric_crypto_key::derive_symmetric_key, SymmetricCryptoKey}; #[test] @@ -184,37 +137,6 @@ mod tests { assert_eq!(None, master_key.0.mac_key); } - #[test] - fn test_stretch_master_key() { - let master_key = MasterKey(SymmetricCryptoKey::new( - Box::pin( - [ - 31, 79, 104, 226, 150, 71, 177, 90, 194, 80, 172, 209, 17, 129, 132, 81, 138, - 167, 69, 167, 254, 149, 2, 27, 39, 197, 64, 42, 22, 195, 86, 75, - ] - .into(), - ), - None, - )); - - let stretched = stretch_master_key(&master_key).unwrap(); - - assert_eq!( - [ - 111, 31, 178, 45, 238, 152, 37, 114, 143, 215, 124, 83, 135, 173, 195, 23, 142, - 134, 120, 249, 61, 132, 163, 182, 113, 197, 189, 204, 188, 21, 237, 96 - ], - stretched.key.as_slice() - ); - assert_eq!( - [ - 221, 127, 206, 234, 101, 27, 202, 38, 86, 52, 34, 28, 78, 28, 185, 16, 48, 61, 127, - 166, 209, 247, 194, 87, 232, 26, 48, 85, 193, 249, 179, 155 - ], - stretched.mac_key.as_ref().unwrap().as_slice() - ); - } - #[test] fn test_password_hash_pbkdf2() { let password = "asdfasdf".as_bytes(); diff --git a/crates/bitwarden-crypto/src/keys/mod.rs b/crates/bitwarden-crypto/src/keys/mod.rs index 285e58b55..5bfd32b8b 100644 --- a/crates/bitwarden-crypto/src/keys/mod.rs +++ b/crates/bitwarden-crypto/src/keys/mod.rs @@ -12,8 +12,10 @@ mod asymmetric_crypto_key; pub use asymmetric_crypto_key::{ AsymmetricCryptoKey, AsymmetricEncryptable, AsymmetricPublicCryptoKey, }; - mod user_key; pub use user_key::UserKey; mod device_key; pub use device_key::{DeviceKey, TrustDeviceResponse}; +mod pin_key; +pub use pin_key::PinKey; +mod utils; diff --git a/crates/bitwarden-crypto/src/keys/pin_key.rs b/crates/bitwarden-crypto/src/keys/pin_key.rs new file mode 100644 index 000000000..475b7ffd9 --- /dev/null +++ b/crates/bitwarden-crypto/src/keys/pin_key.rs @@ -0,0 +1,39 @@ +use crate::{ + keys::{ + key_encryptable::CryptoKey, + utils::{derive_kdf_key, stretch_kdf_key}, + }, + EncString, Kdf, KeyEncryptable, Result, SymmetricCryptoKey, +}; + +/// Pin Key. +/// +/// Derived from a specific password, used for pin encryption and exports. +pub struct PinKey(SymmetricCryptoKey); + +impl PinKey { + pub fn new(key: SymmetricCryptoKey) -> Self { + Self(key) + } + + /// Derives a users pin key from their password, email and KDF. + pub fn derive(password: &[u8], salt: &[u8], kdf: &Kdf) -> Result { + derive_kdf_key(password, salt, kdf).map(Self) + } +} + +impl CryptoKey for PinKey {} + +impl KeyEncryptable for &[u8] { + fn encrypt_with_key(self, key: &PinKey) -> Result { + let stretched_key = stretch_kdf_key(&key.0)?; + + self.encrypt_with_key(&stretched_key) + } +} + +impl KeyEncryptable for String { + fn encrypt_with_key(self, key: &PinKey) -> Result { + self.as_bytes().encrypt_with_key(key) + } +} diff --git a/crates/bitwarden-crypto/src/keys/utils.rs b/crates/bitwarden-crypto/src/keys/utils.rs new file mode 100644 index 000000000..d83e212d0 --- /dev/null +++ b/crates/bitwarden-crypto/src/keys/utils.rs @@ -0,0 +1,85 @@ +use std::pin::Pin; + +use generic_array::{typenum::U32, GenericArray}; +use sha2::Digest; + +use crate::{util::hkdf_expand, Kdf, Result, SymmetricCryptoKey}; + +/// Derive a generic key from a secret and salt using the provided KDF. +pub(super) fn derive_kdf_key(secret: &[u8], salt: &[u8], kdf: &Kdf) -> Result { + let mut hash = match kdf { + Kdf::PBKDF2 { iterations } => crate::util::pbkdf2(secret, salt, iterations.get()), + + Kdf::Argon2id { + iterations, + memory, + parallelism, + } => { + use argon2::*; + + let argon = Argon2::new( + Algorithm::Argon2id, + Version::V0x13, + Params::new( + memory.get() * 1024, // Convert MiB to KiB + iterations.get(), + parallelism.get(), + Some(32), + ) + .unwrap(), + ); + + let salt_sha = sha2::Sha256::new().chain_update(salt).finalize(); + + let mut hash = [0u8; 32]; + argon + .hash_password_into(secret, &salt_sha, &mut hash) + .unwrap(); + hash + } + }; + SymmetricCryptoKey::try_from(hash.as_mut_slice()) +} + +pub(super) fn stretch_kdf_key(k: &SymmetricCryptoKey) -> Result { + let key: Pin>> = hkdf_expand(&k.key, Some("enc"))?; + let mac_key: Pin>> = hkdf_expand(&k.key, Some("mac"))?; + + Ok(SymmetricCryptoKey::new(key, Some(mac_key))) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_stretch_kdf_key() { + let key = SymmetricCryptoKey::new( + Box::pin( + [ + 31, 79, 104, 226, 150, 71, 177, 90, 194, 80, 172, 209, 17, 129, 132, 81, 138, + 167, 69, 167, 254, 149, 2, 27, 39, 197, 64, 42, 22, 195, 86, 75, + ] + .into(), + ), + None, + ); + + let stretched = stretch_kdf_key(&key).unwrap(); + + assert_eq!( + [ + 111, 31, 178, 45, 238, 152, 37, 114, 143, 215, 124, 83, 135, 173, 195, 23, 142, + 134, 120, 249, 61, 132, 163, 182, 113, 197, 189, 204, 188, 21, 237, 96 + ], + stretched.key.as_slice() + ); + assert_eq!( + [ + 221, 127, 206, 234, 101, 27, 202, 38, 86, 52, 34, 28, 78, 28, 185, 16, 48, 61, 127, + 166, 209, 247, 194, 87, 232, 26, 48, 85, 193, 249, 179, 155 + ], + stretched.mac_key.as_ref().unwrap().as_slice() + ); + } +} diff --git a/crates/bitwarden-exporters/Cargo.toml b/crates/bitwarden-exporters/Cargo.toml index 0008fbb49..40316437f 100644 --- a/crates/bitwarden-exporters/Cargo.toml +++ b/crates/bitwarden-exporters/Cargo.toml @@ -14,6 +14,8 @@ rust-version = "1.57" exclude = ["/resources"] [dependencies] +base64 = ">=0.21.2, <0.22" +bitwarden-crypto = { path = "../bitwarden-crypto", version = "=0.1.0" } chrono = { version = ">=0.4.26, <0.5", features = [ "clock", "serde", @@ -23,4 +25,4 @@ csv = "1.3.0" serde = { version = ">=1.0, <2.0", features = ["derive"] } serde_json = ">=1.0.96, <2.0" thiserror = ">=1.0.40, <2.0" -uuid = { version = ">=1.3.3, <2.0", features = ["serde"] } +uuid = { version = ">=1.3.3, <2.0", features = ["serde", "v4"] } diff --git a/crates/bitwarden-exporters/src/encrypted_json.rs b/crates/bitwarden-exporters/src/encrypted_json.rs new file mode 100644 index 000000000..1bbfd2660 --- /dev/null +++ b/crates/bitwarden-exporters/src/encrypted_json.rs @@ -0,0 +1,246 @@ +use base64::{engine::general_purpose::STANDARD, Engine}; +use bitwarden_crypto::{generate_random_bytes, Kdf, KeyEncryptable, PinKey}; +use serde::Serialize; +use thiserror::Error; +use uuid::Uuid; + +use crate::{ + json::{self, export_json}, + Cipher, Folder, +}; + +#[derive(Error, Debug)] +pub enum EncryptedJsonError { + #[error(transparent)] + JsonExport(#[from] json::JsonError), + + #[error("JSON error: {0}")] + Serde(#[from] serde_json::Error), + + #[error("Cryptography error, {0}")] + Crypto(#[from] bitwarden_crypto::CryptoError), +} + +pub(crate) fn export_encrypted_json( + folders: Vec, + ciphers: Vec, + password: String, + kdf: Kdf, +) -> Result { + let decrypted_export = export_json(folders, ciphers)?; + + let (kdf_type, kdf_iterations, kdf_memory, kdf_parallelism) = match kdf { + Kdf::PBKDF2 { iterations } => (0, iterations.get(), None, None), + Kdf::Argon2id { + iterations, + memory, + parallelism, + } => ( + 1, + iterations.get(), + Some(memory.get()), + Some(parallelism.get()), + ), + }; + + let salt: [u8; 16] = generate_random_bytes(); + let salt = STANDARD.encode(salt); + let key = PinKey::derive(password.as_bytes(), salt.as_bytes(), &kdf)?; + + let enc_key_validation = Uuid::new_v4().to_string(); + + let encrypted_export = EncryptedJsonExport { + encrypted: true, + password_protected: true, + salt, + kdf_type, + kdf_iterations, + kdf_memory, + kdf_parallelism, + enc_key_validation: enc_key_validation.encrypt_with_key(&key)?.to_string(), + data: decrypted_export.encrypt_with_key(&key)?.to_string(), + }; + + Ok(serde_json::to_string_pretty(&encrypted_export)?) +} + +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +pub(crate) struct EncryptedJsonExport { + encrypted: bool, + password_protected: bool, + salt: String, + kdf_type: u32, + kdf_iterations: u32, + kdf_memory: Option, + kdf_parallelism: Option, + #[serde(rename = "encKeyValidation_DO_NOT_EDIT")] + enc_key_validation: String, + data: String, +} + +#[cfg(test)] +mod tests { + use std::num::NonZeroU32; + + use super::*; + use crate::{ + Card, Cipher, CipherType, Field, Identity, Login, LoginUri, SecureNote, SecureNoteType, + }; + + #[test] + pub fn test_export() { + let _export = export_encrypted_json( + vec![Folder { + id: "942e2984-1b9a-453b-b039-b107012713b9".parse().unwrap(), + name: "Important".to_string(), + }], + vec![ + Cipher { + id: "25c8c414-b446-48e9-a1bd-b10700bbd740".parse().unwrap(), + folder_id: Some("942e2984-1b9a-453b-b039-b107012713b9".parse().unwrap()), + + name: "Bitwarden".to_string(), + notes: Some("My note".to_string()), + + r#type: CipherType::Login(Box::new(Login { + username: Some("test@bitwarden.com".to_string()), + password: Some("asdfasdfasdf".to_string()), + login_uris: vec![LoginUri { + uri: Some("https://vault.bitwarden.com".to_string()), + r#match: None, + }], + totp: Some("ABC".to_string()), + })), + + favorite: true, + reprompt: 0, + + fields: vec![ + Field { + name: Some("Text".to_string()), + value: Some("A".to_string()), + r#type: 0, + linked_id: None, + }, + Field { + name: Some("Hidden".to_string()), + value: Some("B".to_string()), + r#type: 1, + linked_id: None, + }, + Field { + name: Some("Boolean (true)".to_string()), + value: Some("true".to_string()), + r#type: 2, + linked_id: None, + }, + Field { + name: Some("Boolean (false)".to_string()), + value: Some("false".to_string()), + r#type: 2, + linked_id: None, + }, + Field { + name: Some("Linked".to_string()), + value: None, + r#type: 3, + linked_id: Some(101), + }, + ], + + revision_date: "2024-01-30T14:09:33.753Z".parse().unwrap(), + creation_date: "2024-01-30T11:23:54.416Z".parse().unwrap(), + deleted_date: None, + }, + Cipher { + id: "23f0f877-42b1-4820-a850-b10700bc41eb".parse().unwrap(), + folder_id: None, + + name: "My secure note".to_string(), + notes: Some("Very secure!".to_string()), + + r#type: CipherType::SecureNote(Box::new(SecureNote { + r#type: SecureNoteType::Generic, + })), + + favorite: false, + reprompt: 0, + + fields: vec![], + + revision_date: "2024-01-30T11:25:25.466Z".parse().unwrap(), + creation_date: "2024-01-30T11:25:25.466Z".parse().unwrap(), + deleted_date: None, + }, + Cipher { + id: "3ed8de45-48ee-4e26-a2dc-b10701276c53".parse().unwrap(), + folder_id: None, + + name: "My card".to_string(), + notes: None, + + r#type: CipherType::Card(Box::new(Card { + cardholder_name: Some("John Doe".to_string()), + exp_month: Some("1".to_string()), + exp_year: Some("2032".to_string()), + code: Some("123".to_string()), + brand: Some("Visa".to_string()), + number: Some("4111111111111111".to_string()), + })), + + favorite: false, + reprompt: 0, + + fields: vec![], + + revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + deleted_date: None, + }, + Cipher { + id: "41cc3bc1-c3d9-4637-876c-b10701273712".parse().unwrap(), + folder_id: Some("942e2984-1b9a-453b-b039-b107012713b9".parse().unwrap()), + + name: "My identity".to_string(), + notes: None, + + r#type: CipherType::Identity(Box::new(Identity { + title: Some("Mr".to_string()), + first_name: Some("John".to_string()), + middle_name: None, + last_name: Some("Doe".to_string()), + address1: None, + address2: None, + address3: None, + city: None, + state: None, + postal_code: None, + country: None, + company: Some("Bitwarden".to_string()), + email: None, + phone: None, + ssn: None, + username: Some("JDoe".to_string()), + passport_number: None, + license_number: None, + })), + + favorite: false, + reprompt: 0, + + fields: vec![], + + revision_date: "2024-01-30T17:54:50.706Z".parse().unwrap(), + creation_date: "2024-01-30T17:54:50.706Z".parse().unwrap(), + deleted_date: None, + }, + ], + "password".to_string(), + Kdf::PBKDF2 { + iterations: NonZeroU32::new(600_000).unwrap(), + }, + ) + .unwrap(); + } +} diff --git a/crates/bitwarden-exporters/src/lib.rs b/crates/bitwarden-exporters/src/lib.rs index c9a82dece..f17d31a2d 100644 --- a/crates/bitwarden-exporters/src/lib.rs +++ b/crates/bitwarden-exporters/src/lib.rs @@ -1,3 +1,4 @@ +use bitwarden_crypto::Kdf; use chrono::{DateTime, Utc}; use thiserror::Error; use uuid::Uuid; @@ -6,11 +7,13 @@ mod csv; use crate::csv::export_csv; mod json; use json::export_json; +mod encrypted_json; +use encrypted_json::export_encrypted_json; pub enum Format { Csv, Json, - EncryptedJson { password: String }, + EncryptedJson { password: String, kdf: Kdf }, } /// Export representation of a Bitwarden folder. @@ -127,6 +130,8 @@ pub enum ExportError { Csv(#[from] csv::CsvError), #[error("JSON error: {0}")] Json(#[from] json::JsonError), + #[error("Encrypted JSON error: {0}")] + EncryptedJsonError(#[from] encrypted_json::EncryptedJsonError), } pub fn export( @@ -137,6 +142,8 @@ pub fn export( match format { Format::Csv => Ok(export_csv(folders, ciphers)?), Format::Json => Ok(export_json(folders, ciphers)?), - Format::EncryptedJson { password: _ } => todo!(), + Format::EncryptedJson { password, kdf } => { + Ok(export_encrypted_json(folders, ciphers, password, kdf)?) + } } } diff --git a/crates/bitwarden-generators/Cargo.toml b/crates/bitwarden-generators/Cargo.toml index 800f6f765..8f06de664 100644 --- a/crates/bitwarden-generators/Cargo.toml +++ b/crates/bitwarden-generators/Cargo.toml @@ -30,4 +30,4 @@ uniffi = { version = "=0.26.1", optional = true } [dev-dependencies] rand_chacha = "0.3.1" tokio = { version = "1.36.0", features = ["rt", "macros"] } -wiremock = "0.5.22" +wiremock = "0.6.0" diff --git a/crates/bitwarden-json/Cargo.toml b/crates/bitwarden-json/Cargo.toml index 26d3f600a..5949ce8cf 100644 --- a/crates/bitwarden-json/Cargo.toml +++ b/crates/bitwarden-json/Cargo.toml @@ -18,6 +18,7 @@ internal = ["bitwarden/internal"] # Internal testing methods secrets = ["bitwarden/secrets"] # Secrets manager API [dependencies] +async-lock = ">=3.3.0, <4.0" log = ">=0.4.18, <0.5" schemars = ">=0.8.12, <0.9" serde = { version = ">=1.0, <2.0", features = ["derive"] } diff --git a/crates/bitwarden-json/src/client.rs b/crates/bitwarden-json/src/client.rs index d484c7b50..ef9414f12 100644 --- a/crates/bitwarden-json/src/client.rs +++ b/crates/bitwarden-json/src/client.rs @@ -1,3 +1,4 @@ +use async_lock::Mutex; use bitwarden::client::client_settings::ClientSettings; #[cfg(feature = "secrets")] @@ -7,15 +8,15 @@ use crate::{ response::{Response, ResponseIntoString}, }; -pub struct Client(bitwarden::Client); +pub struct Client(Mutex); impl Client { pub fn new(settings_input: Option) -> Self { let settings = Self::parse_settings(settings_input); - Self(bitwarden::Client::new(settings)) + Self(Mutex::new(bitwarden::Client::new(settings))) } - pub async fn run_command(&mut self, input_str: &str) -> String { + pub async fn run_command(&self, input_str: &str) -> String { const SUBCOMMANDS_TO_CLEAN: &[&str] = &["Secrets"]; let mut cmd_value: serde_json::Value = match serde_json::from_str(input_str) { Ok(cmd) => cmd, @@ -44,41 +45,43 @@ impl Client { } }; + let mut client = self.0.lock().await; + match cmd { #[cfg(feature = "internal")] - Command::PasswordLogin(req) => self.0.auth().login_password(&req).await.into_string(), + Command::PasswordLogin(req) => client.auth().login_password(&req).await.into_string(), #[cfg(feature = "secrets")] Command::AccessTokenLogin(req) => { - self.0.auth().login_access_token(&req).await.into_string() + client.auth().login_access_token(&req).await.into_string() } #[cfg(feature = "internal")] - Command::GetUserApiKey(req) => self.0.get_user_api_key(&req).await.into_string(), + Command::GetUserApiKey(req) => client.get_user_api_key(&req).await.into_string(), #[cfg(feature = "internal")] - Command::ApiKeyLogin(req) => self.0.auth().login_api_key(&req).await.into_string(), + Command::ApiKeyLogin(req) => client.auth().login_api_key(&req).await.into_string(), #[cfg(feature = "internal")] - Command::Sync(req) => self.0.sync(&req).await.into_string(), + Command::Sync(req) => client.sync(&req).await.into_string(), #[cfg(feature = "internal")] - Command::Fingerprint(req) => self.0.platform().fingerprint(&req).into_string(), + Command::Fingerprint(req) => client.platform().fingerprint(&req).into_string(), #[cfg(feature = "secrets")] Command::Secrets(cmd) => match cmd { - SecretsCommand::Get(req) => self.0.secrets().get(&req).await.into_string(), + SecretsCommand::Get(req) => client.secrets().get(&req).await.into_string(), SecretsCommand::GetByIds(req) => { - self.0.secrets().get_by_ids(req).await.into_string() + client.secrets().get_by_ids(req).await.into_string() } - SecretsCommand::Create(req) => self.0.secrets().create(&req).await.into_string(), - SecretsCommand::List(req) => self.0.secrets().list(&req).await.into_string(), - SecretsCommand::Update(req) => self.0.secrets().update(&req).await.into_string(), - SecretsCommand::Delete(req) => self.0.secrets().delete(req).await.into_string(), + SecretsCommand::Create(req) => client.secrets().create(&req).await.into_string(), + SecretsCommand::List(req) => client.secrets().list(&req).await.into_string(), + SecretsCommand::Update(req) => client.secrets().update(&req).await.into_string(), + SecretsCommand::Delete(req) => client.secrets().delete(req).await.into_string(), }, #[cfg(feature = "secrets")] Command::Projects(cmd) => match cmd { - ProjectsCommand::Get(req) => self.0.projects().get(&req).await.into_string(), - ProjectsCommand::Create(req) => self.0.projects().create(&req).await.into_string(), - ProjectsCommand::List(req) => self.0.projects().list(&req).await.into_string(), - ProjectsCommand::Update(req) => self.0.projects().update(&req).await.into_string(), - ProjectsCommand::Delete(req) => self.0.projects().delete(req).await.into_string(), + ProjectsCommand::Get(req) => client.projects().get(&req).await.into_string(), + ProjectsCommand::Create(req) => client.projects().create(&req).await.into_string(), + ProjectsCommand::List(req) => client.projects().list(&req).await.into_string(), + ProjectsCommand::Update(req) => client.projects().update(&req).await.into_string(), + ProjectsCommand::Delete(req) => client.projects().delete(req).await.into_string(), }, } } diff --git a/crates/bitwarden-napi/src/client.rs b/crates/bitwarden-napi/src/client.rs index 712cd4ffd..f41d5c351 100644 --- a/crates/bitwarden-napi/src/client.rs +++ b/crates/bitwarden-napi/src/client.rs @@ -38,7 +38,7 @@ impl BitwardenClient { } #[napi] - pub async unsafe fn run_command(&mut self, command_input: String) -> String { + pub async fn run_command(&self, command_input: String) -> String { self.0.run_command(&command_input).await } } diff --git a/crates/bitwarden-py/src/client.rs b/crates/bitwarden-py/src/client.rs index 1cfd078bb..f1d282b41 100644 --- a/crates/bitwarden-py/src/client.rs +++ b/crates/bitwarden-py/src/client.rs @@ -13,12 +13,12 @@ impl BitwardenClient { } #[pyo3(text_signature = "($self, command_input)")] - fn run_command(&mut self, command_input: String) -> String { - run_command(&mut self.0, &command_input) + fn run_command(&self, command_input: String) -> String { + run_command(&self.0, &command_input) } } #[tokio::main] -async fn run_command(client: &mut JsonClient, input_str: &str) -> String { +async fn run_command(client: &JsonClient, input_str: &str) -> String { client.run_command(input_str).await } diff --git a/crates/bitwarden-wasm/Cargo.toml b/crates/bitwarden-wasm/Cargo.toml index a5242822a..547ea25ff 100644 --- a/crates/bitwarden-wasm/Cargo.toml +++ b/crates/bitwarden-wasm/Cargo.toml @@ -10,11 +10,11 @@ crate-type = ["cdylib"] [dependencies] console_error_panic_hook = "0.1.7" console_log = { version = "1.0.0", features = ["color"] } -js-sys = "0.3.67" +js-sys = "0.3.68" log = "0.4.20" serde = { version = "1.0.196", features = ["derive"] } -wasm-bindgen = { version = "0.2.90", features = ["serde-serialize"] } -wasm-bindgen-futures = "0.4.40" +wasm-bindgen = { version = "0.2.91", features = ["serde-serialize"] } +wasm-bindgen-futures = "0.4.41" bitwarden-json = { path = "../bitwarden-json", features = [ "secrets", @@ -22,4 +22,4 @@ bitwarden-json = { path = "../bitwarden-json", features = [ ] } [dev-dependencies] -wasm-bindgen-test = "0.3.40" +wasm-bindgen-test = "0.3.41" diff --git a/crates/bitwarden-wasm/src/client.rs b/crates/bitwarden-wasm/src/client.rs index b9f6723a6..542759731 100644 --- a/crates/bitwarden-wasm/src/client.rs +++ b/crates/bitwarden-wasm/src/client.rs @@ -1,5 +1,5 @@ extern crate console_error_panic_hook; -use std::{rc::Rc, sync::RwLock}; +use std::rc::Rc; use bitwarden_json::client::Client as JsonClient; use js_sys::Promise; @@ -26,10 +26,10 @@ fn convert_level(level: LogLevel) -> Level { } } -// Rc> is to avoid needing to take ownership of the Client during our async run_command +// Rc<...> is to avoid needing to take ownership of the Client during our async run_command // function https://github.com/rustwasm/wasm-bindgen/issues/2195#issuecomment-799588401 #[wasm_bindgen] -pub struct BitwardenClient(Rc>); +pub struct BitwardenClient(Rc); #[wasm_bindgen] impl BitwardenClient { @@ -42,20 +42,14 @@ impl BitwardenClient { panic!("failed to initialize logger: {:?}", e); } - Self(Rc::new(RwLock::new(bitwarden_json::client::Client::new( - settings_input, - )))) + Self(Rc::new(bitwarden_json::client::Client::new(settings_input))) } #[wasm_bindgen] - pub fn run_command(&mut self, js_input: String) -> Promise { + pub fn run_command(&self, js_input: String) -> Promise { let rc = self.0.clone(); - // TODO: We should probably switch to an async-aware RwLock here, - // but it probably doesn't matter much in a single threaded environment - #[allow(clippy::await_holding_lock)] future_to_promise(async move { - let mut client = rc.write().unwrap(); - let result = client.run_command(&js_input).await; + let result = rc.run_command(&js_input).await; Ok(result.into()) }) } diff --git a/crates/bitwarden/Cargo.toml b/crates/bitwarden/Cargo.toml index 74ce9f6e3..9950a788a 100644 --- a/crates/bitwarden/Cargo.toml +++ b/crates/bitwarden/Cargo.toml @@ -78,5 +78,5 @@ reqwest = { version = "*", features = [ [dev-dependencies] rand_chacha = "0.3.1" tokio = { version = "1.36.0", features = ["rt", "macros"] } -wiremock = "0.5.22" +wiremock = "0.6.0" zeroize = { version = ">=1.7.0, <2.0", features = ["derive", "aarch64"] } diff --git a/crates/bitwarden/src/admin_console/policy.rs b/crates/bitwarden/src/admin_console/policy.rs index 9a4b0d16f..7e87b8623 100644 --- a/crates/bitwarden/src/admin_console/policy.rs +++ b/crates/bitwarden/src/admin_console/policy.rs @@ -53,20 +53,28 @@ impl TryFrom for Policy { impl From for PolicyType { fn from(policy_type: bitwarden_api_api::models::PolicyType) -> Self { match policy_type { - bitwarden_api_api::models::PolicyType::Variant0 => PolicyType::TwoFactorAuthentication, - bitwarden_api_api::models::PolicyType::Variant1 => PolicyType::MasterPassword, - bitwarden_api_api::models::PolicyType::Variant2 => PolicyType::PasswordGenerator, - bitwarden_api_api::models::PolicyType::Variant3 => PolicyType::SingleOrg, - bitwarden_api_api::models::PolicyType::Variant4 => PolicyType::RequireSso, - bitwarden_api_api::models::PolicyType::Variant5 => PolicyType::PersonalOwnership, - bitwarden_api_api::models::PolicyType::Variant6 => PolicyType::DisableSend, - bitwarden_api_api::models::PolicyType::Variant7 => PolicyType::SendOptions, - bitwarden_api_api::models::PolicyType::Variant8 => PolicyType::ResetPassword, - bitwarden_api_api::models::PolicyType::Variant9 => PolicyType::MaximumVaultTimeout, - bitwarden_api_api::models::PolicyType::Variant10 => { + bitwarden_api_api::models::PolicyType::TwoFactorAuthentication => { + PolicyType::TwoFactorAuthentication + } + bitwarden_api_api::models::PolicyType::MasterPassword => PolicyType::MasterPassword, + bitwarden_api_api::models::PolicyType::PasswordGenerator => { + PolicyType::PasswordGenerator + } + bitwarden_api_api::models::PolicyType::SingleOrg => PolicyType::SingleOrg, + bitwarden_api_api::models::PolicyType::RequireSso => PolicyType::RequireSso, + bitwarden_api_api::models::PolicyType::PersonalOwnership => { + PolicyType::PersonalOwnership + } + bitwarden_api_api::models::PolicyType::DisableSend => PolicyType::DisableSend, + bitwarden_api_api::models::PolicyType::SendOptions => PolicyType::SendOptions, + bitwarden_api_api::models::PolicyType::ResetPassword => PolicyType::ResetPassword, + bitwarden_api_api::models::PolicyType::MaximumVaultTimeout => { + PolicyType::MaximumVaultTimeout + } + bitwarden_api_api::models::PolicyType::DisablePersonalVaultExport => { PolicyType::DisablePersonalVaultExport } - bitwarden_api_api::models::PolicyType::Variant11 => PolicyType::ActivateAutofill, + bitwarden_api_api::models::PolicyType::ActivateAutofill => PolicyType::ActivateAutofill, } } } diff --git a/crates/bitwarden/src/auth/api/response/identity_success_response.rs b/crates/bitwarden/src/auth/api/response/identity_success_response.rs index e59f91b7b..fb59c1caa 100644 --- a/crates/bitwarden/src/auth/api/response/identity_success_response.rs +++ b/crates/bitwarden/src/auth/api/response/identity_success_response.rs @@ -53,7 +53,7 @@ mod test { private_key: Default::default(), key: Default::default(), two_factor_token: Default::default(), - kdf: KdfType::Variant0, + kdf: KdfType::default(), kdf_iterations: crate::util::default_pbkdf2_iterations(), reset_master_password: Default::default(), force_password_reset: Default::default(), diff --git a/crates/bitwarden/src/auth/login/auth_request.rs b/crates/bitwarden/src/auth/login/auth_request.rs index 30db06124..1d85c75d6 100644 --- a/crates/bitwarden/src/auth/login/auth_request.rs +++ b/crates/bitwarden/src/auth/login/auth_request.rs @@ -41,7 +41,7 @@ pub(crate) async fn send_new_auth_request( public_key: auth.public_key, device_identifier: device_identifier.clone(), access_code: auth.access_code.clone(), - r#type: AuthRequestType::Variant0, // AuthenticateAndUnlock + r#type: AuthRequestType::AuthenticateAndUnlock, }; let res = auth_requests_post(&config.api, Some(req)).await?; diff --git a/crates/bitwarden/src/auth/login/mod.rs b/crates/bitwarden/src/auth/login/mod.rs index a36d27ae9..53ea712cc 100644 --- a/crates/bitwarden/src/auth/login/mod.rs +++ b/crates/bitwarden/src/auth/login/mod.rs @@ -67,13 +67,13 @@ pub(crate) fn parse_prelogin(response: PreloginResponseModel) -> Result { let kdf = response.kdf.ok_or("KDF not found")?; Ok(match kdf { - KdfType::Variant0 => Kdf::PBKDF2 { + KdfType::PBKDF2_SHA256 => Kdf::PBKDF2 { iterations: response .kdf_iterations .and_then(|e| NonZeroU32::new(e as u32)) .unwrap_or_else(default_pbkdf2_iterations), }, - KdfType::Variant1 => Kdf::Argon2id { + KdfType::Argon2id => Kdf::Argon2id { iterations: response .kdf_iterations .and_then(|e| NonZeroU32::new(e as u32)) diff --git a/crates/bitwarden/src/auth/register.rs b/crates/bitwarden/src/auth/register.rs index 2b0c9503b..31b69c515 100644 --- a/crates/bitwarden/src/auth/register.rs +++ b/crates/bitwarden/src/auth/register.rs @@ -42,7 +42,7 @@ pub(super) async fn register(client: &mut Client, req: &RegisterRequest) -> Resu })), token: None, organization_user_id: None, - kdf: Some(bitwarden_api_identity::models::KdfType::Variant0), + kdf: Some(bitwarden_api_identity::models::KdfType::PBKDF2_SHA256), kdf_iterations: Some(default_pbkdf2_iterations().get() as i32), kdf_memory: None, kdf_parallelism: None, diff --git a/crates/bitwarden/src/tool/exporters/mod.rs b/crates/bitwarden/src/tool/exporters/mod.rs index cbdb5bb86..9e9e99ed5 100644 --- a/crates/bitwarden/src/tool/exporters/mod.rs +++ b/crates/bitwarden/src/tool/exporters/mod.rs @@ -3,6 +3,7 @@ use bitwarden_exporters::export; use schemars::JsonSchema; use crate::{ + client::{LoginMethod, UserLoginMethod}, error::{Error, Result}, vault::{ login::LoginUriView, Cipher, CipherType, CipherView, Collection, FieldView, Folder, @@ -38,7 +39,35 @@ pub(super) fn export_vault( let ciphers: Vec = ciphers.into_iter().flat_map(|c| c.try_into()).collect(); - Ok(export(folders, ciphers, format.into())?) + let format = convert_format(client, format)?; + + Ok(export(folders, ciphers, format)?) +} + +fn convert_format( + client: &Client, + format: ExportFormat, +) -> Result { + let login_method = client + .login_method + .as_ref() + .ok_or(Error::NotAuthenticated)?; + + let kdf = match login_method { + LoginMethod::User( + UserLoginMethod::Username { kdf, .. } | UserLoginMethod::ApiKey { kdf, .. }, + ) => kdf, + _ => return Err(Error::NotAuthenticated), + }; + + Ok(match format { + ExportFormat::Csv => bitwarden_exporters::Format::Csv, + ExportFormat::Json => bitwarden_exporters::Format::Json, + ExportFormat::EncryptedJson { password } => bitwarden_exporters::Format::EncryptedJson { + password, + kdf: kdf.clone(), + }, + }) } pub(super) fn export_organization_vault( @@ -173,18 +202,11 @@ impl From for bitwarden_exporters::SecureNoteType { } } -impl From for bitwarden_exporters::Format { - fn from(value: ExportFormat) -> Self { - match value { - ExportFormat::Csv => Self::Csv, - ExportFormat::Json => Self::Json, - ExportFormat::EncryptedJson { password } => Self::EncryptedJson { password }, - } - } -} - #[cfg(test)] mod tests { + use std::num::NonZeroU32; + + use bitwarden_crypto::Kdf; use chrono::{DateTime, Utc}; use super::*; @@ -276,19 +298,32 @@ mod tests { } #[test] - fn test_from_export_format() { + fn test_convert_format() { + let mut client = Client::new(None); + client.set_login_method(LoginMethod::User(UserLoginMethod::Username { + client_id: "7b821276-e27c-400b-9853-606393c87f18".to_owned(), + email: "test@bitwarden.com".to_owned(), + kdf: Kdf::PBKDF2 { + iterations: NonZeroU32::new(600_000).unwrap(), + }, + })); + assert!(matches!( - bitwarden_exporters::Format::from(ExportFormat::Csv), + convert_format(&client, ExportFormat::Csv).unwrap(), bitwarden_exporters::Format::Csv )); assert!(matches!( - bitwarden_exporters::Format::from(ExportFormat::Json), + convert_format(&client, ExportFormat::Json).unwrap(), bitwarden_exporters::Format::Json )); assert!(matches!( - bitwarden_exporters::Format::from(ExportFormat::EncryptedJson { - password: "password".to_string() - }), + convert_format( + &client, + ExportFormat::EncryptedJson { + password: "password".to_string() + } + ) + .unwrap(), bitwarden_exporters::Format::EncryptedJson { .. } )); } diff --git a/crates/bitwarden/src/vault/cipher/cipher.rs b/crates/bitwarden/src/vault/cipher/cipher.rs index bbd944871..9223462a1 100644 --- a/crates/bitwarden/src/vault/cipher/cipher.rs +++ b/crates/bitwarden/src/vault/cipher/cipher.rs @@ -385,10 +385,10 @@ impl TryFrom for Cipher { impl From for CipherType { fn from(t: bitwarden_api_api::models::CipherType) -> Self { match t { - bitwarden_api_api::models::CipherType::Variant1 => CipherType::Login, - bitwarden_api_api::models::CipherType::Variant2 => CipherType::SecureNote, - bitwarden_api_api::models::CipherType::Variant3 => CipherType::Card, - bitwarden_api_api::models::CipherType::Variant4 => CipherType::Identity, + bitwarden_api_api::models::CipherType::Login => CipherType::Login, + bitwarden_api_api::models::CipherType::SecureNote => CipherType::SecureNote, + bitwarden_api_api::models::CipherType::Card => CipherType::Card, + bitwarden_api_api::models::CipherType::Identity => CipherType::Identity, } } } @@ -396,8 +396,8 @@ impl From for CipherType { impl From for CipherRepromptType { fn from(t: bitwarden_api_api::models::CipherRepromptType) -> Self { match t { - bitwarden_api_api::models::CipherRepromptType::Variant0 => CipherRepromptType::None, - bitwarden_api_api::models::CipherRepromptType::Variant1 => CipherRepromptType::Password, + bitwarden_api_api::models::CipherRepromptType::None => CipherRepromptType::None, + bitwarden_api_api::models::CipherRepromptType::Password => CipherRepromptType::Password, } } } diff --git a/crates/bitwarden/src/vault/cipher/field.rs b/crates/bitwarden/src/vault/cipher/field.rs index bde713a05..25a318d6f 100644 --- a/crates/bitwarden/src/vault/cipher/field.rs +++ b/crates/bitwarden/src/vault/cipher/field.rs @@ -82,10 +82,10 @@ impl TryFrom for Field { impl From for FieldType { fn from(model: bitwarden_api_api::models::FieldType) -> Self { match model { - bitwarden_api_api::models::FieldType::Variant0 => FieldType::Text, - bitwarden_api_api::models::FieldType::Variant1 => FieldType::Hidden, - bitwarden_api_api::models::FieldType::Variant2 => FieldType::Boolean, - bitwarden_api_api::models::FieldType::Variant3 => FieldType::Linked, + bitwarden_api_api::models::FieldType::Text => FieldType::Text, + bitwarden_api_api::models::FieldType::Hidden => FieldType::Hidden, + bitwarden_api_api::models::FieldType::Boolean => FieldType::Boolean, + bitwarden_api_api::models::FieldType::Linked => FieldType::Linked, } } } diff --git a/crates/bitwarden/src/vault/cipher/login.rs b/crates/bitwarden/src/vault/cipher/login.rs index ea5b1f357..5e2156a83 100644 --- a/crates/bitwarden/src/vault/cipher/login.rs +++ b/crates/bitwarden/src/vault/cipher/login.rs @@ -143,12 +143,12 @@ impl TryFrom for LoginUri { impl From for UriMatchType { fn from(value: bitwarden_api_api::models::UriMatchType) -> Self { match value { - bitwarden_api_api::models::UriMatchType::Variant0 => Self::Domain, - bitwarden_api_api::models::UriMatchType::Variant1 => Self::Host, - bitwarden_api_api::models::UriMatchType::Variant2 => Self::StartsWith, - bitwarden_api_api::models::UriMatchType::Variant3 => Self::Exact, - bitwarden_api_api::models::UriMatchType::Variant4 => Self::RegularExpression, - bitwarden_api_api::models::UriMatchType::Variant5 => Self::Never, + bitwarden_api_api::models::UriMatchType::Domain => Self::Domain, + bitwarden_api_api::models::UriMatchType::Host => Self::Host, + bitwarden_api_api::models::UriMatchType::StartsWith => Self::StartsWith, + bitwarden_api_api::models::UriMatchType::Exact => Self::Exact, + bitwarden_api_api::models::UriMatchType::RegularExpression => Self::RegularExpression, + bitwarden_api_api::models::UriMatchType::Never => Self::Never, } } } diff --git a/crates/bitwarden/src/vault/cipher/secure_note.rs b/crates/bitwarden/src/vault/cipher/secure_note.rs index 2433a9c2a..eba4ea2fb 100644 --- a/crates/bitwarden/src/vault/cipher/secure_note.rs +++ b/crates/bitwarden/src/vault/cipher/secure_note.rs @@ -56,7 +56,7 @@ impl TryFrom for SecureNote { impl From for SecureNoteType { fn from(model: bitwarden_api_api::models::SecureNoteType) -> Self { match model { - bitwarden_api_api::models::SecureNoteType::Variant0 => SecureNoteType::Generic, + bitwarden_api_api::models::SecureNoteType::Generic => SecureNoteType::Generic, } } } diff --git a/crates/bitwarden/src/vault/send.rs b/crates/bitwarden/src/vault/send.rs index aba67e00c..144933899 100644 --- a/crates/bitwarden/src/vault/send.rs +++ b/crates/bitwarden/src/vault/send.rs @@ -329,8 +329,8 @@ impl TryFrom for Send { impl From for SendType { fn from(t: bitwarden_api_api::models::SendType) -> Self { match t { - bitwarden_api_api::models::SendType::Variant0 => SendType::Text, - bitwarden_api_api::models::SendType::Variant1 => SendType::File, + bitwarden_api_api::models::SendType::Text => SendType::Text, + bitwarden_api_api::models::SendType::File => SendType::File, } } } diff --git a/crates/bw/Cargo.toml b/crates/bw/Cargo.toml index b96b4a5ae..068094039 100644 --- a/crates/bw/Cargo.toml +++ b/crates/bw/Cargo.toml @@ -27,4 +27,4 @@ bitwarden = { path = "../bitwarden", version = "0.4.0", features = [ bitwarden-cli = { path = "../bitwarden-cli", version = "0.1.0" } [dev-dependencies] -tempfile = "3.9.0" +tempfile = "3.10.0" diff --git a/crates/bws/Cargo.toml b/crates/bws/Cargo.toml index 84554e9c1..2ceab6499 100644 --- a/crates/bws/Cargo.toml +++ b/crates/bws/Cargo.toml @@ -16,7 +16,7 @@ keywords = ["bitwarden", "secrets-manager", "cli"] bat = { version = "0.24.0", features = [ "regex-onig", ], default-features = false } -chrono = { version = "0.4.33", features = [ +chrono = { version = "0.4.34", features = [ "clock", "std", ], default-features = false } @@ -35,12 +35,12 @@ serde = "^1.0.196" serde_json = "^1.0.113" serde_yaml = "0.9" supports-color = "3.0.0" -thiserror = "1.0.56" +thiserror = "1.0.57" tokio = { version = "1.36.0", features = ["rt-multi-thread", "macros"] } -toml = "0.8.9" +toml = "0.8.10" uuid = { version = "^1.7.0", features = ["serde"] } bitwarden = { path = "../bitwarden", version = "0.4.0", features = ["secrets"] } [dev-dependencies] -tempfile = "3.9.0" +tempfile = "3.10.0" diff --git a/languages/js/example/index.js b/languages/js/example/index.js new file mode 100644 index 000000000..8da3fc582 --- /dev/null +++ b/languages/js/example/index.js @@ -0,0 +1,32 @@ +const { BitwardenClient: BitwardenClientWasm, LogLevel } = require("@bitwarden/sdk-wasm"); +const sdk = require("@bitwarden/sdk-client"); + +async function main() { + const settings = { + apiUrl: process.env.API_URL, + identityUrl: process.env.IDENTITY_URL, + }; + + const client = new sdk.BitwardenClient( + new BitwardenClientWasm(JSON.stringify(settings), LogLevel.Debug), + ); + + const organization_id = process.env.ORGANIZATION_ID; + await client.accessTokenLogin(process.env.ACCESS_TOKEN); + + const project = await client.projects().create("test", organization_id); + const projects = await client.projects().list(organization_id); + console.log(projects.data); + + const secret = await client + .secrets() + .create("test-secret", "My secret!", "This is my secret", [project.id], organization_id); + const secrets = await client.secrets().list(organization_id); + console.log(secrets.data); + + console.log(project, secret); + + await client.projects().delete([project.id]); + await client.secrets().delete([secret.id]); +} +main(); diff --git a/languages/js/example/package-lock.json b/languages/js/example/package-lock.json new file mode 100644 index 000000000..f6cab6536 --- /dev/null +++ b/languages/js/example/package-lock.json @@ -0,0 +1,34 @@ +{ + "name": "sdk-example", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sdk-example", + "dependencies": { + "@bitwarden/sdk-client": "../sdk-client", + "@bitwarden/sdk-wasm": "../wasm" + } + }, + "../sdk-client": { + "name": "@bitwarden/sdk-client", + "devDependencies": { + "@types/node": "^18.15.11", + "rimraf": "^5.0.0", + "typescript": "^5.0.3" + } + }, + "../wasm": { + "name": "@bitwarden/sdk-wasm", + "version": "0.1.0" + }, + "node_modules/@bitwarden/sdk-client": { + "resolved": "../sdk-client", + "link": true + }, + "node_modules/@bitwarden/sdk-wasm": { + "resolved": "../wasm", + "link": true + } + } +} diff --git a/languages/js/example/package.json b/languages/js/example/package.json new file mode 100644 index 000000000..836e53085 --- /dev/null +++ b/languages/js/example/package.json @@ -0,0 +1,11 @@ +{ + "name": "sdk-example", + "main": "index.js", + "scripts": { + "start": "node index.js" + }, + "dependencies": { + "@bitwarden/sdk-client": "../sdk-client", + "@bitwarden/sdk-wasm": "../wasm" + } +} diff --git a/languages/js/sdk-client/src/client.ts b/languages/js/sdk-client/src/client.ts index f77ba1420..0f06889c1 100644 --- a/languages/js/sdk-client/src/client.ts +++ b/languages/js/sdk-client/src/client.ts @@ -1,18 +1,24 @@ import { Convert, - ResponseForFingerprintResponse, - ResponseForPasswordLoginResponse, - ResponseForSecretIdentifiersResponse, - ResponseForSecretResponse, - ResponseForSecretsDeleteResponse, - ResponseForSyncResponse, - ResponseForUserAPIKeyResponse, + ProjectResponse, + ProjectsDeleteResponse, + ProjectsResponse, + SecretIdentifiersResponse, + SecretResponse, + SecretsDeleteResponse, } from "./schemas"; interface BitwardenSDKClient { run_command(js_input: string): Promise; } +function handleResponse(response: { success: boolean; errorMessage?: string; data?: T }): T { + if (!response.success) { + throw new Error(response.errorMessage); + } + return response.data as T; +} + export class BitwardenClient { client: BitwardenSDKClient; @@ -20,64 +26,25 @@ export class BitwardenClient { this.client = client; } - async login(email: string, password: string, pbkdf_iter: number): Promise { + async accessTokenLogin(accessToken: string): Promise { const response = await this.client.run_command( Convert.commandToJson({ - passwordLogin: { - email: email, - password: password, - kdf: { - pBKDF2: { - iterations: pbkdf_iter, - } - }, + accessTokenLogin: { + accessToken, }, - }) + }), ); - return Convert.toResponseForPasswordLoginResponse(response); + handleResponse(Convert.toResponseForAccessTokenLoginResponse(response)); } - async getUserApiKey( - secret: string, - isOtp: boolean = false - ): Promise { - const response = await this.client.run_command( - Convert.commandToJson({ - getUserApiKey: { - masterPassword: isOtp ? null : secret, - otp: isOtp ? secret : null, - }, - }) - ); - - return Convert.toResponseForUserAPIKeyResponse(response); + secrets(): SecretsClient { + return new SecretsClient(this.client); } - async sync(excludeSubdomains: boolean = false): Promise { - const response = await this.client.run_command( - Convert.commandToJson({ - sync: { - excludeSubdomains, - }, - }) - ); - - return Convert.toResponseForSyncResponse(response); + projects(): ProjectsClient { + return new ProjectsClient(this.client); } - - async fingerprint(fingerprintMaterial: string, publicKey: string): Promise { - const response = await this.client.run_command( - Convert.commandToJson({ - fingerprint: { - fingerprintMaterial: fingerprintMaterial, - publicKey: publicKey, - } - }) - ) - - return Convert.toResponseForFingerprintResponse(response).data.fingerprint; - }; } export class SecretsClient { @@ -87,74 +54,144 @@ export class SecretsClient { this.client = client; } - async get(id: string): Promise { + async get(id: string): Promise { const response = await this.client.run_command( Convert.commandToJson({ secrets: { get: { id }, }, - }) + }), ); - return Convert.toResponseForSecretResponse(response); + return handleResponse(Convert.toResponseForSecretResponse(response)); } async create( key: string, + value: string, note: string, + projectIds: string[], organizationId: string, - value: string - ): Promise { + ): Promise { const response = await this.client.run_command( Convert.commandToJson({ secrets: { - create: { key, note, organizationId, value }, + create: { key, value, note, projectIds, organizationId }, }, - }) + }), ); - return Convert.toResponseForSecretResponse(response); + return handleResponse(Convert.toResponseForSecretResponse(response)); } - async list(organizationId: string): Promise { + async list(organizationId: string): Promise { const response = await this.client.run_command( Convert.commandToJson({ secrets: { list: { organizationId }, }, - }) + }), ); - return Convert.toResponseForSecretIdentifiersResponse(response); + return handleResponse(Convert.toResponseForSecretIdentifiersResponse(response)); } async update( id: string, key: string, + value: string, note: string, + projectIds: string[], organizationId: string, - value: string - ): Promise { + ): Promise { const response = await this.client.run_command( Convert.commandToJson({ secrets: { - update: { id, key, note, organizationId, value }, + update: { id, key, value, note, projectIds, organizationId }, }, - }) + }), ); - return Convert.toResponseForSecretResponse(response); + return handleResponse(Convert.toResponseForSecretResponse(response)); } - async delete(ids: string[]): Promise { + async delete(ids: string[]): Promise { const response = await this.client.run_command( Convert.commandToJson({ secrets: { delete: { ids }, }, - }) + }), + ); + + return handleResponse(Convert.toResponseForSecretsDeleteResponse(response)); + } +} + +export class ProjectsClient { + client: BitwardenSDKClient; + + constructor(client: BitwardenSDKClient) { + this.client = client; + } + + async get(id: string): Promise { + const response = await this.client.run_command( + Convert.commandToJson({ + projects: { + get: { id }, + }, + }), + ); + + return handleResponse(Convert.toResponseForProjectResponse(response)); + } + + async create(name: string, organizationId: string): Promise { + const response = await this.client.run_command( + Convert.commandToJson({ + projects: { + create: { name, organizationId }, + }, + }), + ); + + return handleResponse(Convert.toResponseForProjectResponse(response)); + } + + async list(organizationId: string): Promise { + const response = await this.client.run_command( + Convert.commandToJson({ + projects: { + list: { organizationId }, + }, + }), + ); + + return handleResponse(Convert.toResponseForProjectsResponse(response)); + } + + async update(id: string, name: string, organizationId: string): Promise { + const response = await this.client.run_command( + Convert.commandToJson({ + projects: { + update: { id, name, organizationId }, + }, + }), + ); + + return handleResponse(Convert.toResponseForProjectResponse(response)); + } + + async delete(ids: string[]): Promise { + const response = await this.client.run_command( + Convert.commandToJson({ + projects: { + delete: { ids }, + }, + }), ); - return Convert.toResponseForSecretsDeleteResponse(response); + return handleResponse(Convert.toResponseForProjectsDeleteResponse(response)); } } diff --git a/languages/js/sdk-client/src/logging_level.ts b/languages/js/sdk-client/src/logging_level.ts deleted file mode 100644 index 2453b1eb6..000000000 --- a/languages/js/sdk-client/src/logging_level.ts +++ /dev/null @@ -1,7 +0,0 @@ -export enum LoggingLevel { - Trace, - Debug, - Info, - Warn, - Error, -} diff --git a/languages/js/sdk-client/tsconfig.json b/languages/js/sdk-client/tsconfig.json index 453623d5f..987e8d679 100644 --- a/languages/js/sdk-client/tsconfig.json +++ b/languages/js/sdk-client/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "outDir": "./dist/", - "module": "esnext", + "module": "commonjs", "target": "es5", "moduleResolution": "node", "sourceMap": true, diff --git a/openapitools.json b/openapitools.json index a3883a34f..e73b97583 100644 --- a/openapitools.json +++ b/openapitools.json @@ -2,6 +2,6 @@ "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", "spaces": 2, "generator-cli": { - "version": "6.5.0" + "version": "7.2.0" } } diff --git a/support/build-api.sh b/support/build-api.sh new file mode 100755 index 000000000..a668b5564 --- /dev/null +++ b/support/build-api.sh @@ -0,0 +1,26 @@ +# Delete old directory to ensure all files are updated +rm -rf crates/bitwarden-api-api/src + +# Generate new API bindings +npx openapi-generator-cli generate \ + -i ../server/api.json \ + -g rust \ + -o crates/bitwarden-api-api \ + --package-name bitwarden-api-api \ + -t ./support/openapi-template \ + --additional-properties=packageVersion=1.0.0 + +# Delete old directory to ensure all files are updated +rm -rf crates/bitwarden-api-identity/src + +# Generate new Identity bindings +npx openapi-generator-cli generate \ + -i ../server/identity.json \ + -g rust \ + -o crates/bitwarden-api-identity \ + --package-name bitwarden-api-identity \ + -t ./support/openapi-template \ + --additional-properties=packageVersion=1.0.0 + +cargo +nightly fmt +npm run prettier diff --git a/support/openapi-template/Cargo.mustache b/support/openapi-template/Cargo.mustache index 3b89aa079..6417d15cd 100644 --- a/support/openapi-template/Cargo.mustache +++ b/support/openapi-template/Cargo.mustache @@ -1,42 +1,71 @@ [package] name = "{{{packageName}}}" version = "{{#lambdaVersion}}{{{packageVersion}}}{{/lambdaVersion}}" +{{#infoEmail}} +authors = ["{{{.}}}"] +{{/infoEmail}} +{{^infoEmail}} authors = ["OpenAPI Generator team and contributors"] +{{/infoEmail}} +{{#appDescription}} +description = "{{{.}}}" +{{/appDescription}} +{{#licenseInfo}} +license = "{{.}}" +{{/licenseInfo}} +{{^licenseInfo}} +# Override this license by providing a License Object in the OpenAPI. +license = "Unlicense" +{{/licenseInfo}} edition = "2018" +{{#publishRustRegistry}} +publish = ["{{.}}"] +{{/publishRustRegistry}} +{{#repositoryUrl}} +repository = "{{.}}" +{{/repositoryUrl}} +{{#documentationUrl}} +documentation = "{{.}}" +{{/documentationUrl}} +{{#homePageUrl}} +homepage = "{{.}} +{{/homePageUrl}} [dependencies] serde = "^1.0" serde_derive = "^1.0" +{{#serdeWith}} +serde_with = "^2.0" +{{/serdeWith}} serde_json = "^1.0" serde_repr = "^0.1" url = "^2.2" -uuid = { version = "^1.0", features = ["serde"] } +uuid = { version = "^1.0", features = ["serde", "v4"] } {{#hyper}} hyper = { version = "~0.14", features = ["full"] } hyper-tls = "~0.5" http = "~0.2" -serde_yaml = "0.7" base64 = "~0.7.0" futures = "^0.3" {{/hyper}} +{{#withAWSV4Signature}} +aws-sigv4 = "0.3.0" +http = "0.2.5" +secrecy = "0.8.0" +{{/withAWSV4Signature}} {{#reqwest}} {{^supportAsync}} -reqwest = "~0.9" +[dependencies.reqwest] +version = "^0.11" +features = ["json", "blocking", "multipart"] {{/supportAsync}} {{#supportAsync}} +{{#supportMiddleware}} +reqwest-middleware = "0.2.0" +{{/supportMiddleware}} [dependencies.reqwest] version = "^0.11" features = ["json", "multipart"] default-features = false {{/supportAsync}} {{/reqwest}} -{{#withAWSV4Signature}} -aws-sigv4 = "0.3.0" -http = "0.2.5" -secrecy = "0.8.0" -{{/withAWSV4Signature}} - -[dev-dependencies] -{{#hyper}} -tokio-core = "*" -{{/hyper}} diff --git a/support/openapi-template/git_push.sh.mustache b/support/openapi-template/git_push.sh.mustache old mode 100644 new mode 100755 diff --git a/support/openapi-template/hyper/api.mustache b/support/openapi-template/hyper/api.mustache index 03ea90ad0..dffab3ce8 100644 --- a/support/openapi-template/hyper/api.mustache +++ b/support/openapi-template/hyper/api.mustache @@ -28,7 +28,7 @@ impl {{{classname}}}Client pub trait {{{classname}}} { {{#operations}} {{#operation}} - fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}&str{{/isString}}{{#isUuid}}uuid::Uuid{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin>>>; + fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{^isUuid}}&str{{/isUuid}}{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin>>>; {{/operation}} {{/operations}} } @@ -38,7 +38,7 @@ impl{{{classname}}} for {{{classname}}}Clien {{#operations}} {{#operation}} #[allow(unused_mut)] - fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}&str{{/isString}}{{#isUuid}}uuid::Uuid{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin>>> { + fn {{{operationId}}}(&self, {{#allParams}}{{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{^isUuid}}&str{{/isUuid}}{{/isString}}{{#isUuid}}&str{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -> Pin>>> { let mut req = __internal_request::Request::new(hyper::Method::{{{httpMethod.toUpperCase}}}, "{{{path}}}".to_string()) {{#hasAuthMethods}} {{#authMethods}} @@ -49,9 +49,9 @@ impl{{{classname}}} for {{{classname}}}Clien param_name: "{{{keyParamName}}}".to_owned(), })) {{/isApiKey}} - {{#isBasic}} + {{#isBasicBasic}} .with_auth(__internal_request::Auth::Basic) - {{/isBasic}} + {{/isBasicBasic}} {{#isOAuth}} .with_auth(__internal_request::Auth::Oauth) {{/isOAuth}} @@ -66,7 +66,7 @@ impl{{{classname}}} for {{{classname}}}Clien {{#isNullable}} match {{{paramName}}} { Some(param_value) => { req = req.with_query_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, - None => { req = req.with_query_param("{{{baseName}}}".to_string(), String::new()); }, + None => { req = req.with_query_param("{{{baseName}}}".to_string(), "".to_string()); }, } {{/isNullable}} {{/required}} @@ -85,7 +85,7 @@ impl{{{classname}}} for {{{classname}}}Clien {{#isNullable}} match {{{paramName}}} { Some(param_value) => { req = req.with_path_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, - None => { req = req.with_path_param("{{{baseName}}}".to_string(), String::new()); }, + None => { req = req.with_path_param("{{{baseName}}}".to_string(), "".to_string()); }, } {{/isNullable}} {{/required}} @@ -104,7 +104,7 @@ impl{{{classname}}} for {{{classname}}}Clien {{#isNullable}} match {{{paramName}}} { Some(param_value) => { req = req.with_header_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, - None => { req = req.with_header_param("{{{baseName}}}".to_string(), String::new()); }, + None => { req = req.with_header_param("{{{baseName}}}".to_string(), "".to_string()); }, } {{/isNullable}} {{/required}} @@ -143,7 +143,7 @@ impl{{{classname}}} for {{{classname}}}Clien {{#isNullable}} match {{{paramName}}} { Some(param_value) => { req = req.with_form_param("{{{baseName}}}".to_string(), param_value{{#isArray}}.join(","){{/isArray}}.to_string()); }, - None => { req = req.with_form_param("{{{baseName}}}".to_string(), String::new()); }, + None => { req = req.with_form_param("{{{baseName}}}".to_string(), "".to_string()); }, } {{/isNullable}} {{/required}} diff --git a/support/openapi-template/model.mustache b/support/openapi-template/model.mustache index 233c88010..4a22118a8 100644 --- a/support/openapi-template/model.mustache +++ b/support/openapi-template/model.mustache @@ -100,7 +100,7 @@ pub enum {{{classname}}} { {{!-- for non-enum schemas --}} {{^isEnum}} {{^discriminator}} -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct {{{classname}}} { {{#vars}} {{#description}} diff --git a/support/openapi-template/request.rs b/support/openapi-template/request.rs index 6e534abaa..81497706a 100644 --- a/support/openapi-template/request.rs +++ b/support/openapi-template/request.rs @@ -2,10 +2,10 @@ use std::collections::HashMap; use std::pin::Pin; use futures; -use futures::future::*; use futures::Future; +use futures::future::*; use hyper; -use hyper::header::{HeaderValue, AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, USER_AGENT}; +use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, USER_AGENT}; use serde; use serde_json; @@ -50,6 +50,7 @@ pub(crate) struct Request { serialized_body: Option, } +#[allow(dead_code)] impl Request { pub fn new(method: hyper::Method, path: String) -> Self { Request { @@ -75,16 +76,19 @@ impl Request { self } + #[allow(unused)] pub fn with_query_param(mut self, basename: String, param: String) -> Self { self.query_params.insert(basename, param); self } + #[allow(unused)] pub fn with_path_param(mut self, basename: String, param: String) -> Self { self.path_params.insert(basename, param); self } + #[allow(unused)] pub fn with_form_param(mut self, basename: String, param: String) -> Self { self.form_params.insert(basename, param); self @@ -103,13 +107,13 @@ impl Request { pub fn execute<'a, C, U>( self, conf: &configuration::Configuration, - ) -> Pin> + 'a>> - where - C: hyper::client::connect::Connect + Clone + std::marker::Send + Sync, - U: Sized + std::marker::Send + 'a, - for<'de> U: serde::Deserialize<'de>, + ) -> Pin> + 'a>> + where + C: hyper::client::connect::Connect + Clone + std::marker::Send + Sync, + U: Sized + std::marker::Send + 'a, + for<'de> U: serde::Deserialize<'de>, { - let mut query_string = ::url::form_urlencoded::Serializer::new(String::new()); + let mut query_string = ::url::form_urlencoded::Serializer::new("".to_owned()); let mut path = self.path; for (k, v) in self.path_params { @@ -133,7 +137,9 @@ impl Request { Ok(u) => u, }; - let mut req_builder = hyper::Request::builder().uri(uri).method(self.method); + let mut req_builder = hyper::Request::builder() + .uri(uri) + .method(self.method); // Detect the authorization type if it hasn't been set. let auth = self.auth.unwrap_or_else(|| @@ -180,13 +186,10 @@ impl Request { } if let Some(ref user_agent) = conf.user_agent { - req_builder = req_builder.header( - USER_AGENT, - match HeaderValue::from_str(user_agent) { - Ok(header_value) => header_value, - Err(e) => return Box::pin(futures::future::err(super::Error::Header(e))), - }, - ); + req_builder = req_builder.header(USER_AGENT, match HeaderValue::from_str(user_agent) { + Ok(header_value) => header_value, + Err(e) => return Box::pin(futures::future::err(super::Error::Header(e))) + }); } for (k, v) in self.header_params { @@ -195,11 +198,8 @@ impl Request { let req_headers = req_builder.headers_mut().unwrap(); let request_result = if self.form_params.len() > 0 { - req_headers.insert( - CONTENT_TYPE, - HeaderValue::from_static("application/ x-www-form-urlencoded"), - ); - let mut enc = ::url::form_urlencoded::Serializer::new(String::new()); + req_headers.insert(CONTENT_TYPE, HeaderValue::from_static("application/x-www-form-urlencoded")); + let mut enc = ::url::form_urlencoded::Serializer::new("".to_owned()); for (k, v) in self.form_params { enc.append_pair(&k, &v); } @@ -213,37 +213,30 @@ impl Request { }; let request = match request_result { Ok(request) => request, - Err(e) => return Box::pin(futures::future::err(Error::from(e))), + Err(e) => return Box::pin(futures::future::err(Error::from(e))) }; let no_return_type = self.no_return_type; - Box::pin( - conf.client - .request(request) - .map_err(Error::from) - .and_then(move |response| { - let status = response.status(); - if !status.is_success() { - futures::future::err::(Error::from(( - status, - response.into_body(), - ))) - .boxed() - } else if no_return_type { - // This is a hack; if there's no_ret_type, U is (), but serde_json gives an - // error when deserializing "" into (), so deserialize 'null' into it - // instead. - // An alternate option would be to require U: Default, and then return - // U::default() here instead since () implements that, but then we'd - // need to impl default for all models. - futures::future::ok::(serde_json::Value::Null).boxed() - } else { - hyper::body::to_bytes(response.into_body()) - .map(|bytes| serde_json::from_slice(&bytes.unwrap())) - .map_err(Error::from) - .boxed() - } - }), - ) + Box::pin(conf.client + .request(request) + .map_err(|e| Error::from(e)) + .and_then(move |response| { + let status = response.status(); + if !status.is_success() { + futures::future::err::(Error::from((status, response.into_body()))).boxed() + } else if no_return_type { + // This is a hack; if there's no_ret_type, U is (), but serde_json gives an + // error when deserializing "" into (), so deserialize 'null' into it + // instead. + // An alternate option would be to require U: Default, and then return + // U::default() here instead since () implements that, but then we'd + // need to impl default for all models. + futures::future::ok::(serde_json::from_str("null").expect("serde null value")).boxed() + } else { + hyper::body::to_bytes(response.into_body()) + .map(|bytes| serde_json::from_slice(&bytes.unwrap())) + .map_err(|e| Error::from(e)).boxed() + } + })) } } diff --git a/support/openapi-template/reqwest/api.mustache b/support/openapi-template/reqwest/api.mustache index b1a2ec245..8128244a2 100644 --- a/support/openapi-template/reqwest/api.mustache +++ b/support/openapi-template/reqwest/api.mustache @@ -11,13 +11,13 @@ use super::{Error, configuration}; {{#allParams}} {{#-first}} /// struct for passing parameters to the method [`{{operationId}}`] -#[derive(Clone, Debug, Default)] +#[derive(Clone, Debug)] pub struct {{{operationIdCamelCase}}}Params { {{/-first}} {{#description}} /// {{{.}}} {{/description}} - pub {{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isString}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}uuid::Uuid{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}},{{/-last}} + pub {{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{^isUuid}}{{#isString}}{{#isArray}}Vec<{{/isArray}}String{{#isArray}}>{{/isArray}}{{/isString}}{{/isUuid}}{{#isUuid}}{{#isArray}}Vec<{{/isArray}}uuid::Uuid{{#isArray}}>{{/isArray}}{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}{{#isBodyParam}}crate::models::{{/isBodyParam}}{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{^-last}},{{/-last}} {{#-last}} } @@ -103,12 +103,27 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: {{#required}} {{#isArray}} local_var_req_builder = match "{{collectionFormat}}" { - "multi" => local_var_req_builder.query(&{{{paramName}}}.into_iter().map(|p| ("{{{baseName}}}".to_owned(), p)).collect::>()), + "multi" => local_var_req_builder.query(&{{{paramName}}}.into_iter().map(|p| ("{{{baseName}}}".to_owned(), p.to_string())).collect::>()), _ => local_var_req_builder.query(&[("{{{baseName}}}", &{{{paramName}}}.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), }; {{/isArray}} {{^isArray}} + {{^isNullable}} local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", &{{{paramName}}}.to_string())]); + {{/isNullable}} + {{#isNullable}} + {{#isDeepObject}} + if let Some(ref local_var_str) = {{{paramName}}} { + let params = crate::apis::parse_deep_object("{{{baseName}}}", local_var_str); + local_var_req_builder = local_var_req_builder.query(¶ms); + }; + {{/isDeepObject}} + {{^isDeepObject}} + if let Some(ref local_var_str) = {{{paramName}}} { + local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", &local_var_str.to_string())]); + }; + {{/isDeepObject}} + {{/isNullable}} {{/isArray}} {{/required}} {{^required}} @@ -120,7 +135,13 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: }; {{/isArray}} {{^isArray}} + {{#isDeepObject}} + let params = crate::apis::parse_deep_object("{{{baseName}}}", local_var_str); + local_var_req_builder = local_var_req_builder.query(¶ms); + {{/isDeepObject}} + {{^isDeepObject}} local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", &local_var_str.to_string())]); + {{/isDeepObject}} {{/isArray}} } {{/required}} @@ -223,7 +244,7 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: {{/hasAuthMethods}} {{#isMultipart}} {{#hasFormParams}} - let mut local_var_form = reqwest::multipart::Form::new(); + let mut local_var_form = reqwest{{^supportAsync}}::blocking{{/supportAsync}}::multipart::Form::new(); {{#formParams}} {{#isFile}} {{^supportAsync}} diff --git a/support/openapi-template/reqwest/api_mod.mustache b/support/openapi-template/reqwest/api_mod.mustache index 628ec898a..347f33379 100644 --- a/support/openapi-template/reqwest/api_mod.mustache +++ b/support/openapi-template/reqwest/api_mod.mustache @@ -14,6 +14,9 @@ pub struct ResponseContent { #[derive(Debug)] pub enum Error { Reqwest(reqwest::Error), + {{#supportMiddleware}} + ReqwestMiddleware(reqwest_middleware::Error), + {{/supportMiddleware}} Serde(serde_json::Error), Io(std::io::Error), ResponseError(ResponseContent), @@ -26,12 +29,15 @@ 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()), + {{#supportMiddleware}} + Error::ReqwestMiddleware(e) => ("reqwest-middleware", e.to_string()), + {{/supportMiddleware}} Error::Serde(e) => ("serde", e.to_string()), Error::Io(e) => ("IO", e.to_string()), Error::ResponseError(e) => ("response", format!("status code {}", e.status)), - {{#withAWSV4Signature}} + {{#withAWSV4Signature}} Error::AWSV4SignatureError(e) => ("aws v4 signature", e.to_string()), - {{/withAWSV4Signature}} + {{/withAWSV4Signature}} }; write!(f, "error in {}: {}", module, e) } @@ -41,12 +47,15 @@ impl error::Error for Error { fn source(&self) -> Option<&(dyn error::Error + 'static)> { Some(match self { Error::Reqwest(e) => e, + {{#supportMiddleware}} + Error::ReqwestMiddleware(e) => e, + {{/supportMiddleware}} Error::Serde(e) => e, Error::Io(e) => e, Error::ResponseError(_) => return None, - {{#withAWSV4Signature}} - Error::AWSV4SignatureError(_) => return None, - {{/withAWSV4Signature}} + {{#withAWSV4Signature}} + Error::AWSV4SignatureError(_) => return None, + {{/withAWSV4Signature}} }) } } @@ -57,6 +66,14 @@ impl From for Error { } } +{{#supportMiddleware}} +impl From for Error { + fn from(e: reqwest_middleware::Error) -> Self { + Error::ReqwestMiddleware(e) + } +} + +{{/supportMiddleware}} impl From for Error { fn from(e: serde_json::Error) -> Self { Error::Serde(e) @@ -73,6 +90,35 @@ 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") +} + {{#apiInfo}} {{#apis}} pub mod {{{classFilename}}}; diff --git a/support/openapi-template/reqwest/configuration.mustache b/support/openapi-template/reqwest/configuration.mustache index cbc21644e..0de2884a8 100644 --- a/support/openapi-template/reqwest/configuration.mustache +++ b/support/openapi-template/reqwest/configuration.mustache @@ -1,7 +1,5 @@ {{>partial_header}} -use reqwest; - {{#withAWSV4Signature}} use std::time::SystemTime; use aws_sigv4::http_request::{sign, SigningSettings, SigningParams, SignableRequest}; @@ -13,7 +11,7 @@ use secrecy::{SecretString, ExposeSecret}; pub struct Configuration { pub base_path: String, pub user_agent: Option, - pub client: reqwest::Client, + pub client: {{#supportMiddleware}}reqwest_middleware::ClientWithMiddleware{{/supportMiddleware}}{{^supportMiddleware}}reqwest{{^supportAsync}}::blocking{{/supportAsync}}::Client{{/supportMiddleware}}, pub basic_auth: Option, pub oauth_access_token: Option, pub bearer_access_token: Option, @@ -82,7 +80,7 @@ impl Default for Configuration { Configuration { base_path: "{{{basePath}}}".to_owned(), user_agent: {{#httpUserAgent}}Some("{{{.}}}".to_owned()){{/httpUserAgent}}{{^httpUserAgent}}Some("OpenAPI-Generator/{{{version}}}/rust".to_owned()){{/httpUserAgent}}, - client: reqwest::Client::new(), + client: {{#supportMiddleware}}reqwest_middleware::ClientBuilder::new(reqwest{{^supportAsync}}::blocking{{/supportAsync}}::Client::new()).build(){{/supportMiddleware}}{{^supportMiddleware}}reqwest{{^supportAsync}}::blocking{{/supportAsync}}::Client::new(){{/supportMiddleware}}, basic_auth: None, oauth_access_token: None, bearer_access_token: None,